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

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 5 years, 10 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 951894679760a82f6db2cf8f0afe7de9da57bbce..8f39930c3f7596e84042262d36169703b105f588 100644
--- a/components/nacl/renderer/json_manifest.cc
+++ b/components/nacl/renderer/json_manifest.cc
@@ -442,6 +442,25 @@ bool JsonManifest::GetProgramURL(std::string* full_url,
return true;
}
+void JsonManifest::GetFiles(
+ std::vector<std::pair<std::string, std::string> >* out_files,
+ const std::string& scheme) const {
Mark Seaborn 2015/02/12 03:57:34 If this arg is always the same, you might as well
Yusuke Sato 2015/02/13 23:01:17 Done.
+ const Json::Value& files = dictionary_[kFilesKey];
+ if (!files.isObject())
+ return;
+
+ const std::vector<std::string>& keys = files.getMemberNames();
+ for (size_t i = 0; i < keys.size(); ++i) {
+ std::string full_url;
+ PP_PNaClOptions unused_pnacl_options; // pnacl does not support "files".
+ // We skip invalid entries in "files".
+ if (GetKeyUrl(files, keys[i], &full_url, &unused_pnacl_options)) {
+ if (scheme.empty() || GURL(full_url).SchemeIs(scheme.c_str()))
Mark Seaborn 2015/02/12 03:57:34 scheme is always passed as "chrome-extension", so
Yusuke Sato 2015/02/13 23:01:17 Done.
+ out_files->push_back(std::make_pair(full_url, keys[i]));
+ }
+ }
+}
+
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