1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/nacl/common/nacl_paths.h"
7 #include "base/file_util.h"
8 #include "base/path_service.h"
12 #if defined(OS_POSIX) && !defined(OS_MACOSX)
13 // File name of the nacl_helper and nacl_helper_bootstrap, Linux only.
14 const base::FilePath::CharType kInternalNaClHelperFileName
[] =
15 FILE_PATH_LITERAL("nacl_helper");
16 const base::FilePath::CharType kInternalNaClHelperBootstrapFileName
[] =
17 FILE_PATH_LITERAL("nacl_helper_bootstrap");
24 bool PathProvider(int key
, base::FilePath
* result
) {
28 case FILE_NACL_HELPER
:
29 if (!PathService::Get(base::DIR_MODULE
, &cur
))
31 cur
= cur
.Append(kInternalNaClHelperFileName
);
33 case FILE_NACL_HELPER_BOOTSTRAP
:
34 if (!PathService::Get(base::DIR_MODULE
, &cur
))
36 cur
= cur
.Append(kInternalNaClHelperBootstrapFileName
);
47 // This cannot be done as a static initializer sadly since Visual Studio will
48 // eliminate this object file if there is no direct entry point into it.
49 void RegisterPathProvider() {
50 PathService::RegisterProvider(PathProvider
, PATH_START
, PATH_END
);