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

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

Issue 7795010: Use chain-loading for Linux nacl_helper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review nits Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/chrome_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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/chrome_paths.h" 5 #include "chrome/common/chrome_paths.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #if defined(OS_WIN) 46 #if defined(OS_WIN)
47 FILE_PATH_LITERAL("ppGoogleNaClPluginChrome.dll"); 47 FILE_PATH_LITERAL("ppGoogleNaClPluginChrome.dll");
48 #elif defined(OS_MACOSX) 48 #elif defined(OS_MACOSX)
49 // TODO(noelallen) Please verify this extention name is correct. 49 // TODO(noelallen) Please verify this extention name is correct.
50 FILE_PATH_LITERAL("ppGoogleNaClPluginChrome.plugin"); 50 FILE_PATH_LITERAL("ppGoogleNaClPluginChrome.plugin");
51 #else // Linux and Chrome OS 51 #else // Linux and Chrome OS
52 FILE_PATH_LITERAL("libppGoogleNaClPluginChrome.so"); 52 FILE_PATH_LITERAL("libppGoogleNaClPluginChrome.so");
53 #endif 53 #endif
54 54
55 #if defined(OS_POSIX) && !defined(OS_MACOSX) 55 #if defined(OS_POSIX) && !defined(OS_MACOSX)
56 // File name of the nacl_helper, Linux only. 56 // File name of the nacl_helper and nacl_helper_bootstrap, Linux only.
57 const FilePath::CharType kInternalNaClHelperFileName[] = 57 const FilePath::CharType kInternalNaClHelperFileName[] =
58 FILE_PATH_LITERAL("nacl_helper");
59 const FilePath::CharType kInternalNaClHelperBootstrapFileName[] =
58 FILE_PATH_LITERAL("nacl_helper_bootstrap"); 60 FILE_PATH_LITERAL("nacl_helper_bootstrap");
59 #endif 61 #endif
60 62
61 } // namespace 63 } // namespace
62 64
63 namespace chrome { 65 namespace chrome {
64 66
65 // Gets the path for internal plugins. 67 // Gets the path for internal plugins.
66 bool GetInternalPluginsDirectory(FilePath* result) { 68 bool GetInternalPluginsDirectory(FilePath* result) {
67 #if defined(OS_MACOSX) 69 #if defined(OS_MACOSX)
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 if (!GetInternalPluginsDirectory(&cur)) 241 if (!GetInternalPluginsDirectory(&cur))
240 return false; 242 return false;
241 cur = cur.Append(kInternalNaClPluginFileName); 243 cur = cur.Append(kInternalNaClPluginFileName);
242 break; 244 break;
243 #if defined(OS_POSIX) && !defined(OS_MACOSX) 245 #if defined(OS_POSIX) && !defined(OS_MACOSX)
244 case chrome::FILE_NACL_HELPER: 246 case chrome::FILE_NACL_HELPER:
245 if (!PathService::Get(base::DIR_MODULE, &cur)) 247 if (!PathService::Get(base::DIR_MODULE, &cur))
246 return false; 248 return false;
247 cur = cur.Append(kInternalNaClHelperFileName); 249 cur = cur.Append(kInternalNaClHelperFileName);
248 break; 250 break;
251 case chrome::FILE_NACL_HELPER_BOOTSTRAP:
252 if (!PathService::Get(base::DIR_MODULE, &cur))
253 return false;
254 cur = cur.Append(kInternalNaClHelperBootstrapFileName);
255 break;
249 #endif 256 #endif
250 case chrome::FILE_RESOURCES_PACK: 257 case chrome::FILE_RESOURCES_PACK:
251 #if defined(OS_MACOSX) 258 #if defined(OS_MACOSX)
252 if (base::mac::AmIBundled()) { 259 if (base::mac::AmIBundled()) {
253 cur = base::mac::MainAppBundlePath(); 260 cur = base::mac::MainAppBundlePath();
254 cur = cur.Append(FILE_PATH_LITERAL("Resources")) 261 cur = cur.Append(FILE_PATH_LITERAL("Resources"))
255 .Append(FILE_PATH_LITERAL("resources.pak")); 262 .Append(FILE_PATH_LITERAL("resources.pak"));
256 break; 263 break;
257 } 264 }
258 // If we're not bundled on mac, resources.pak should be next to the 265 // If we're not bundled on mac, resources.pak should be next to the
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 return true; 365 return true;
359 } 366 }
360 367
361 // This cannot be done as a static initializer sadly since Visual Studio will 368 // This cannot be done as a static initializer sadly since Visual Studio will
362 // eliminate this object file if there is no direct entry point into it. 369 // eliminate this object file if there is no direct entry point into it.
363 void RegisterPathProvider() { 370 void RegisterPathProvider() {
364 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 371 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
365 } 372 }
366 373
367 } // namespace chrome 374 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/chrome_paths.h ('k') | chrome/nacl.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698