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 { |