Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(853)

Side by Side Diff: components/nacl/renderer/json_manifest.cc

Issue 1109723002: Use of base::StringPairs appropriately in nacl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated review comments. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 error_info->string = 435 error_info->string =
436 "could not resolve url '" + nexe_url + 436 "could not resolve url '" + nexe_url +
437 "' relative to manifest base url '" + manifest_base_url_.c_str() + 437 "' relative to manifest base url '" + manifest_base_url_.c_str() +
438 "'."; 438 "'.";
439 return false; 439 return false;
440 } 440 }
441 *full_url = resolved_gurl.possibly_invalid_spec(); 441 *full_url = resolved_gurl.possibly_invalid_spec();
442 return true; 442 return true;
443 } 443 }
444 444
445 void JsonManifest::GetPrefetchableFiles( 445 void JsonManifest::GetPrefetchableFiles(base::StringPairs* out_files) const {
446 std::vector<std::pair<std::string, std::string> >* out_files) const {
447 const Json::Value& files = dictionary_[kFilesKey]; 446 const Json::Value& files = dictionary_[kFilesKey];
448 if (!files.isObject()) 447 if (!files.isObject())
449 return; 448 return;
450 449
451 Json::Value::Members keys = files.getMemberNames(); 450 Json::Value::Members keys = files.getMemberNames();
452 for (size_t i = 0; i < keys.size(); ++i) { 451 for (size_t i = 0; i < keys.size(); ++i) {
453 std::string full_url; 452 std::string full_url;
454 PP_PNaClOptions unused_pnacl_options; // pnacl does not support "files". 453 PP_PNaClOptions unused_pnacl_options; // pnacl does not support "files".
455 // We skip invalid entries in "files". 454 // We skip invalid entries in "files".
456 if (GetKeyUrl(files, keys[i], &full_url, &unused_pnacl_options)) { 455 if (GetKeyUrl(files, keys[i], &full_url, &unused_pnacl_options)) {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 } else { 644 } else {
646 // NaCl 645 // NaCl
647 *url = isa_spec[kUrlKey].asString(); 646 *url = isa_spec[kUrlKey].asString();
648 pnacl_options->translate = PP_FALSE; 647 pnacl_options->translate = PP_FALSE;
649 } 648 }
650 649
651 return true; 650 return true;
652 } 651 }
653 652
654 } // namespace nacl 653 } // namespace nacl
OLDNEW
« no previous file with comments | « components/nacl/renderer/json_manifest.h ('k') | components/nacl/renderer/ppb_nacl_private_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698