OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/component_updater/pnacl/pnacl_component_installer.h" | 5 #include "chrome/browser/component_updater/pnacl/pnacl_component_installer.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // manifest.json. Use that to check that everything is unpacked. | 42 // manifest.json. Use that to check that everything is unpacked. |
43 // However, that would make startup detection even slower (need to check for | 43 // However, that would make startup detection even slower (need to check for |
44 // more than one file!). | 44 // more than one file!). |
45 const char kPnaclCompilerFileName[] = "llc_nexe"; | 45 const char kPnaclCompilerFileName[] = "llc_nexe"; |
46 | 46 |
47 // Name of the Pnacl component specified in the manifest. | 47 // Name of the Pnacl component specified in the manifest. |
48 const char kPnaclManifestNamePrefix[] = "PNaCl"; | 48 const char kPnaclManifestNamePrefix[] = "PNaCl"; |
49 | 49 |
50 // Sanitize characters from Pnacl Arch value so that they can be used | 50 // Sanitize characters from Pnacl Arch value so that they can be used |
51 // in path names. This should only be characters in the set: [a-z0-9_]. | 51 // in path names. This should only be characters in the set: [a-z0-9_]. |
52 // Keep in sync with chrome/browser/nacl_host/pnacl_file_host. | 52 // Keep in sync with chrome/browser/nacl_host/nacl_file_host. |
53 std::string SanitizeForPath(const std::string& input) { | 53 std::string SanitizeForPath(const std::string& input) { |
54 std::string result; | 54 std::string result; |
55 ReplaceChars(input, "-", "_", &result); | 55 ReplaceChars(input, "-", "_", &result); |
56 return result; | 56 return result; |
57 } | 57 } |
58 | 58 |
59 // Set the component's hash to the arch-specific PNaCl package. | 59 // Set the component's hash to the arch-specific PNaCl package. |
60 void SetPnaclHash(CrxComponent* component) { | 60 void SetPnaclHash(CrxComponent* component) { |
61 #if defined(ARCH_CPU_X86_FAMILY) | 61 #if defined(ARCH_CPU_X86_FAMILY) |
62 // Define both x86_32 and x86_64, and choose below. | 62 // Define both x86_32 and x86_64, and choose below. |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 // No need to check the commandline flags again here. | 430 // No need to check the commandline flags again here. |
431 // We could only have gotten here after RegisterPnaclComponent | 431 // We could only have gotten here after RegisterPnaclComponent |
432 // found --enable-pnacl, since that is where we create the profile_observer_, | 432 // found --enable-pnacl, since that is where we create the profile_observer_, |
433 // which in turn calls ReRegisterPnacl. | 433 // which in turn calls ReRegisterPnacl. |
434 DCHECK(per_user_); | 434 DCHECK(per_user_); |
435 // Figure out profile information, before proceeding to look for files. | 435 // Figure out profile information, before proceeding to look for files. |
436 BrowserThread::PostTask( | 436 BrowserThread::PostTask( |
437 BrowserThread::UI, FROM_HERE, | 437 BrowserThread::UI, FROM_HERE, |
438 base::Bind(&GetProfileInformation, this)); | 438 base::Bind(&GetProfileInformation, this)); |
439 } | 439 } |
OLD | NEW |