Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(964)

Side by Side Diff: chrome/common/nacl_paths.cc

Issue 17198013: Don't use PathService for the location of nacl_helper and nacl_helper_bootstrap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bring nacl_paths back Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/common/nacl_paths.h ('k') | chrome/nacl.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 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.
4
5 #include "chrome/common/nacl_paths.h"
6
7 #include "base/file_util.h"
8 #include "base/path_service.h"
9
10 namespace {
11
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");
18 #endif
19
20 } // namespace
21
22 namespace nacl {
23
24 bool PathProvider(int key, base::FilePath* result) {
25 base::FilePath cur;
26 switch (key) {
27 #if defined(OS_LINUX)
28 case FILE_NACL_HELPER:
29 if (!PathService::Get(base::DIR_MODULE, &cur))
30 return false;
31 cur = cur.Append(kInternalNaClHelperFileName);
32 break;
33 case FILE_NACL_HELPER_BOOTSTRAP:
34 if (!PathService::Get(base::DIR_MODULE, &cur))
35 return false;
36 cur = cur.Append(kInternalNaClHelperBootstrapFileName);
37 break;
38 #endif
39 default:
40 return false;
41 }
42
43 *result = cur;
44 return true;
45 }
46
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);
51 }
52
53 } // namespace nacl
OLDNEW
« no previous file with comments | « chrome/common/nacl_paths.h ('k') | chrome/nacl.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698