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_component_installer.h" | 5 #include "chrome/browser/component_updater/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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 return found; | 126 return found; |
127 } | 127 } |
128 | 128 |
129 // Read a manifest file in. | 129 // Read a manifest file in. |
130 base::DictionaryValue* ReadJSONManifest(const base::FilePath& manifest_path) { | 130 base::DictionaryValue* ReadJSONManifest(const base::FilePath& manifest_path) { |
131 JSONFileValueDeserializer deserializer(manifest_path); | 131 JSONFileValueDeserializer deserializer(manifest_path); |
132 std::string error; | 132 std::string error; |
133 std::unique_ptr<base::Value> root = deserializer.Deserialize(NULL, &error); | 133 std::unique_ptr<base::Value> root = deserializer.Deserialize(NULL, &error); |
134 if (!root.get()) | 134 if (!root.get()) |
135 return NULL; | 135 return NULL; |
136 if (!root->IsType(base::Value::TYPE_DICTIONARY)) | 136 if (!root->IsType(base::Value::Type::DICTIONARY)) |
137 return NULL; | 137 return NULL; |
138 return static_cast<base::DictionaryValue*>(root.release()); | 138 return static_cast<base::DictionaryValue*>(root.release()); |
139 } | 139 } |
140 | 140 |
141 // Read the PNaCl specific manifest. | 141 // Read the PNaCl specific manifest. |
142 base::DictionaryValue* ReadPnaclManifest(const base::FilePath& unpack_path) { | 142 base::DictionaryValue* ReadPnaclManifest(const base::FilePath& unpack_path) { |
143 base::FilePath manifest_path = | 143 base::FilePath manifest_path = |
144 GetPlatformDir(unpack_path).AppendASCII("pnacl_public_pnacl_json"); | 144 GetPlatformDir(unpack_path).AppendASCII("pnacl_public_pnacl_json"); |
145 if (!base::PathExists(manifest_path)) | 145 if (!base::PathExists(manifest_path)) |
146 return NULL; | 146 return NULL; |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 } // namespace component_updater | 390 } // namespace component_updater |
391 | 391 |
392 namespace pnacl { | 392 namespace pnacl { |
393 | 393 |
394 bool NeedsOnDemandUpdate() { | 394 bool NeedsOnDemandUpdate() { |
395 return base::subtle::NoBarrier_Load( | 395 return base::subtle::NoBarrier_Load( |
396 &component_updater::needs_on_demand_update) != 0; | 396 &component_updater::needs_on_demand_update) != 0; |
397 } | 397 } |
398 | 398 |
399 } // namespace pnacl | 399 } // namespace pnacl |
OLD | NEW |