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/atomicops.h" | 7 #include "base/atomicops.h" |
8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
27 #include "chrome/browser/profiles/profile_manager.h" | 27 #include "chrome/browser/profiles/profile_manager.h" |
28 #include "chrome/common/chrome_paths.h" | 28 #include "chrome/common/chrome_paths.h" |
29 #include "chrome/common/omaha_query_params/omaha_query_params.h" | 29 #include "chrome/common/omaha_query_params/omaha_query_params.h" |
30 #include "components/nacl/common/nacl_switches.h" | 30 #include "components/nacl/common/nacl_switches.h" |
31 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
32 | 32 |
33 using chrome::OmahaQueryParams; | 33 using chrome::OmahaQueryParams; |
34 using content::BrowserThread; | 34 using content::BrowserThread; |
35 | 35 |
| 36 namespace component_updater { |
| 37 |
36 namespace { | 38 namespace { |
37 | 39 |
38 // Name of the Pnacl component specified in the manifest. | 40 // Name of the Pnacl component specified in the manifest. |
39 const char kPnaclManifestName[] = "PNaCl Translator"; | 41 const char kPnaclManifestName[] = "PNaCl Translator"; |
40 | 42 |
41 // Sanitize characters from Pnacl Arch value so that they can be used | 43 // Sanitize characters from Pnacl Arch value so that they can be used |
42 // in path names. This should only be characters in the set: [a-z0-9_]. | 44 // in path names. This should only be characters in the set: [a-z0-9_]. |
43 // Keep in sync with chrome/browser/nacl_host/nacl_file_host. | 45 // Keep in sync with chrome/browser/nacl_host/nacl_file_host. |
44 std::string SanitizeForPath(const std::string& input) { | 46 std::string SanitizeForPath(const std::string& input) { |
45 std::string result; | 47 std::string result; |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 } | 450 } |
449 | 451 |
450 void PnaclComponentInstaller::ReRegisterPnacl() { | 452 void PnaclComponentInstaller::ReRegisterPnacl() { |
451 DCHECK(per_user_); | 453 DCHECK(per_user_); |
452 // Figure out profile information, before proceeding to look for files. | 454 // Figure out profile information, before proceeding to look for files. |
453 BrowserThread::PostTask( | 455 BrowserThread::PostTask( |
454 BrowserThread::UI, FROM_HERE, | 456 BrowserThread::UI, FROM_HERE, |
455 base::Bind(&GetProfileInformation, this)); | 457 base::Bind(&GetProfileInformation, this)); |
456 } | 458 } |
457 | 459 |
| 460 } // namespace component_updater |
458 | 461 |
459 namespace pnacl { | 462 namespace pnacl { |
460 | 463 |
461 bool NeedsOnDemandUpdate() { | 464 bool NeedsOnDemandUpdate() { |
462 return base::subtle::NoBarrier_Load(&needs_on_demand_update) != 0; | 465 return base::subtle::NoBarrier_Load( |
| 466 &component_updater::needs_on_demand_update) != 0; |
463 } | 467 } |
464 | 468 |
465 } // namespace pnacl | 469 } // namespace pnacl |
OLD | NEW |