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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 LOG(WARNING) << "'name' field in manifest is invalid (" << name | 175 LOG(WARNING) << "'name' field in manifest is invalid (" << name |
176 << ") -- missing (" << kPnaclManifestName << ")"; | 176 << ") -- missing (" << kPnaclManifestName << ")"; |
177 return false; | 177 return false; |
178 } | 178 } |
179 | 179 |
180 std::string proposed_version; | 180 std::string proposed_version; |
181 if (!manifest.GetStringASCII("version", &proposed_version)) { | 181 if (!manifest.GetStringASCII("version", &proposed_version)) { |
182 LOG(WARNING) << "'version' field is missing from manifest!"; | 182 LOG(WARNING) << "'version' field is missing from manifest!"; |
183 return false; | 183 return false; |
184 } | 184 } |
185 base::Version version(proposed_version.c_str()); | 185 base::Version version(proposed_version); |
186 if (!version.IsValid()) { | 186 if (!version.IsValid()) { |
187 LOG(WARNING) << "'version' field in manifest is invalid " | 187 LOG(WARNING) << "'version' field in manifest is invalid " |
188 << version.GetString(); | 188 << version.GetString(); |
189 return false; | 189 return false; |
190 } | 190 } |
191 | 191 |
192 // Now check the |pnacl_manifest|. | 192 // Now check the |pnacl_manifest|. |
193 std::string arch; | 193 std::string arch; |
194 if (!pnacl_manifest.GetStringASCII("pnacl-arch", &arch)) { | 194 if (!pnacl_manifest.GetStringASCII("pnacl-arch", &arch)) { |
195 LOG(WARNING) << "'pnacl-arch' field is missing from pnacl-manifest!"; | 195 LOG(WARNING) << "'pnacl-arch' field is missing from pnacl-manifest!"; |
(...skipping 194 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 |