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

Unified Diff: components/nacl/renderer/json_manifest.cc

Issue 649603004: Non-SFI NaCl: Batch-open resource files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: components/nacl/renderer/json_manifest.cc
diff --git a/components/nacl/renderer/json_manifest.cc b/components/nacl/renderer/json_manifest.cc
index e2063acd1d6c87a826917db7b7f78845827341cf..b27a6fee0f076a2ab2c1a7f9f1e39a8ae34d450a 100644
--- a/components/nacl/renderer/json_manifest.cc
+++ b/components/nacl/renderer/json_manifest.cc
@@ -459,6 +459,29 @@ bool JsonManifest::GetProgramURL(std::string* full_url,
return true;
}
+bool JsonManifest::GetFilesUrl(std::vector<std::string>* full_urls,
+ std::vector<std::string>* out_keys) const {
+ if (full_urls == NULL || out_keys == NULL)
+ return false;
+
+ const Json::Value& files = dictionary_[kFilesKey];
+ if (!files.isObject()) {
+ VLOG(1) << "ResolveKey failed: no \"files\" dictionary";
+ return false;
+ }
+
+ const std::vector<std::string>& keys = files.getMemberNames();
+ for (size_t i = 0; i < keys.size(); ++i) {
+ std::string full_url;
+ PP_PNaClOptions pnacl_options;
+ if (!GetKeyUrl(files, keys[i], &full_url, &pnacl_options))
+ return false;
+ full_urls->push_back(full_url);
+ out_keys->push_back(keys[i]);
+ }
+ return true;
+}
+
bool JsonManifest::ResolveKey(const std::string& key,
std::string* full_url,
PP_PNaClOptions* pnacl_options) const {

Powered by Google App Engine
This is Rietveld 408576698