| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/nacl/renderer/json_manifest.h" | 5 #include "components/nacl/renderer/json_manifest.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 bool JsonManifest::ResolveKey(const std::string& key, | 445 bool JsonManifest::ResolveKey(const std::string& key, |
| 446 std::string* full_url, | 446 std::string* full_url, |
| 447 PP_PNaClOptions* pnacl_options) const { | 447 PP_PNaClOptions* pnacl_options) const { |
| 448 // key must be one of kProgramKey or kFileKey '/' file-section-key | 448 // key must be one of kProgramKey or kFileKey '/' file-section-key |
| 449 if (full_url == NULL || pnacl_options == NULL) | 449 if (full_url == NULL || pnacl_options == NULL) |
| 450 return false; | 450 return false; |
| 451 | 451 |
| 452 if (key == kProgramKey) | 452 if (key == kProgramKey) |
| 453 return GetKeyUrl(dictionary_, key, full_url, pnacl_options); | 453 return GetKeyUrl(dictionary_, key, full_url, pnacl_options); |
| 454 | 454 |
| 455 std::string::const_iterator p = find(key.begin(), key.end(), '/'); | 455 std::string::const_iterator p = std::find(key.begin(), key.end(), '/'); |
| 456 if (p == key.end()) { | 456 if (p == key.end()) { |
| 457 VLOG(1) << "ResolveKey failed: invalid key, no slash: " << key; | 457 VLOG(1) << "ResolveKey failed: invalid key, no slash: " << key; |
| 458 return false; | 458 return false; |
| 459 } | 459 } |
| 460 | 460 |
| 461 // generalize to permit other sections? | 461 // generalize to permit other sections? |
| 462 std::string prefix(key.begin(), p); | 462 std::string prefix(key.begin(), p); |
| 463 if (prefix != kFilesKey) { | 463 if (prefix != kFilesKey) { |
| 464 VLOG(1) << "ResolveKey failed: invalid key, no \"files\" prefix: " << key; | 464 VLOG(1) << "ResolveKey failed: invalid key, no \"files\" prefix: " << key; |
| 465 return false; | 465 return false; |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 } else { | 645 } else { |
| 646 // NaCl | 646 // NaCl |
| 647 *url = isa_spec[kUrlKey].asString(); | 647 *url = isa_spec[kUrlKey].asString(); |
| 648 pnacl_options->translate = PP_FALSE; | 648 pnacl_options->translate = PP_FALSE; |
| 649 } | 649 } |
| 650 | 650 |
| 651 return true; | 651 return true; |
| 652 } | 652 } |
| 653 | 653 |
| 654 } // namespace nacl | 654 } // namespace nacl |
| OLD | NEW |