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 <stdint.h> | 7 #include <stdint.h> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 *latest_version = version; | 118 *latest_version = version; |
119 *latest_dir = path; | 119 *latest_dir = path; |
120 found = true; | 120 found = true; |
121 } | 121 } |
122 } | 122 } |
123 return found; | 123 return found; |
124 } | 124 } |
125 | 125 |
126 // Read a manifest file in. | 126 // Read a manifest file in. |
127 base::DictionaryValue* ReadJSONManifest(const base::FilePath& manifest_path) { | 127 base::DictionaryValue* ReadJSONManifest(const base::FilePath& manifest_path) { |
128 JSONFileValueSerializer serializer(manifest_path); | 128 JSONFileValueDeserializer deserializer(manifest_path); |
129 std::string error; | 129 std::string error; |
130 scoped_ptr<base::Value> root(serializer.Deserialize(NULL, &error)); | 130 scoped_ptr<base::Value> root(deserializer.Deserialize(NULL, &error)); |
131 if (!root.get()) | 131 if (!root.get()) |
132 return NULL; | 132 return NULL; |
133 if (!root->IsType(base::Value::TYPE_DICTIONARY)) | 133 if (!root->IsType(base::Value::TYPE_DICTIONARY)) |
134 return NULL; | 134 return NULL; |
135 return static_cast<base::DictionaryValue*>(root.release()); | 135 return static_cast<base::DictionaryValue*>(root.release()); |
136 } | 136 } |
137 | 137 |
138 // Read the PNaCl specific manifest. | 138 // Read the PNaCl specific manifest. |
139 base::DictionaryValue* ReadPnaclManifest(const base::FilePath& unpack_path) { | 139 base::DictionaryValue* ReadPnaclManifest(const base::FilePath& unpack_path) { |
140 base::FilePath manifest_path = | 140 base::FilePath manifest_path = |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 } // namespace component_updater | 379 } // namespace component_updater |
380 | 380 |
381 namespace pnacl { | 381 namespace pnacl { |
382 | 382 |
383 bool NeedsOnDemandUpdate() { | 383 bool NeedsOnDemandUpdate() { |
384 return base::subtle::NoBarrier_Load( | 384 return base::subtle::NoBarrier_Load( |
385 &component_updater::needs_on_demand_update) != 0; | 385 &component_updater::needs_on_demand_update) != 0; |
386 } | 386 } |
387 | 387 |
388 } // namespace pnacl | 388 } // namespace pnacl |
OLD | NEW |