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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/atomicops.h" | 10 #include "base/atomicops.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 0x73, 0x44, 0x89, 0xab, 0xa4, 0x00, 0x21, 0x32, | 58 0x73, 0x44, 0x89, 0xab, 0xa4, 0x00, 0x21, 0x32, |
59 0x4a, 0x06, 0x06, 0xf1, 0x51, 0x3c, 0x51, 0xba, | 59 0x4a, 0x06, 0x06, 0xf1, 0x51, 0x3c, 0x51, 0xba, |
60 0x31, 0x2f, 0xbc, 0xb3, 0x99, 0x07, 0xdc, 0x9c | 60 0x31, 0x2f, 0xbc, 0xb3, 0x99, 0x07, 0xdc, 0x9c |
61 }; | 61 }; |
62 | 62 |
63 component->pk_hash.assign(sha256_hash, &sha256_hash[arraysize(sha256_hash)]); | 63 component->pk_hash.assign(sha256_hash, &sha256_hash[arraysize(sha256_hash)]); |
64 } | 64 } |
65 | 65 |
66 // If we don't have Pnacl installed, this is the version we claim. | 66 // If we don't have Pnacl installed, this is the version we claim. |
67 const char kNullVersion[] = "0.0.0.0"; | 67 const char kNullVersion[] = "0.0.0.0"; |
68 const char kMinPnaclVersion[] = "0.1.0.13154"; | 68 const char kMinPnaclVersion[] = "0.1.0.13367"; |
69 | 69 |
70 // Initially say that we do not need OnDemand updates. This should be | 70 // Initially say that we do not need OnDemand updates. This should be |
71 // updated by CheckVersionCompatiblity(), before doing any URLRequests | 71 // updated by CheckVersionCompatiblity(), before doing any URLRequests |
72 // that depend on PNaCl. | 72 // that depend on PNaCl. |
73 volatile base::subtle::Atomic32 needs_on_demand_update = 0; | 73 volatile base::subtle::Atomic32 needs_on_demand_update = 0; |
74 | 74 |
75 void CheckVersionCompatiblity(const base::Version& current_version) { | 75 void CheckVersionCompatiblity(const base::Version& current_version) { |
76 // Using NoBarrier, since needs_on_demand_update is standalone and does | 76 // Using NoBarrier, since needs_on_demand_update is standalone and does |
77 // not have other associated data. | 77 // not have other associated data. |
78 base::subtle::NoBarrier_Store(&needs_on_demand_update, | 78 base::subtle::NoBarrier_Store(&needs_on_demand_update, |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 } // namespace component_updater | 383 } // namespace component_updater |
384 | 384 |
385 namespace pnacl { | 385 namespace pnacl { |
386 | 386 |
387 bool NeedsOnDemandUpdate() { | 387 bool NeedsOnDemandUpdate() { |
388 return base::subtle::NoBarrier_Load( | 388 return base::subtle::NoBarrier_Load( |
389 &component_updater::needs_on_demand_update) != 0; | 389 &component_updater::needs_on_demand_update) != 0; |
390 } | 390 } |
391 | 391 |
392 } // namespace pnacl | 392 } // namespace pnacl |
OLD | NEW |