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

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

Issue 1070233007: Stop adding the "files/" prefix when sending open_resource IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 5 years, 8 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
« no previous file with comments | « no previous file | components/nacl/renderer/ppb_nacl_private_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/renderer/json_manifest.cc
diff --git a/components/nacl/renderer/json_manifest.cc b/components/nacl/renderer/json_manifest.cc
index 15425a531e514a2a27a08cf476465aadc1432dea..56a4b2a2352cd36f138de148484a52095b865817 100644
--- a/components/nacl/renderer/json_manifest.cc
+++ b/components/nacl/renderer/json_manifest.cc
@@ -463,38 +463,20 @@ void JsonManifest::GetPrefetchableFiles(
bool JsonManifest::ResolveKey(const std::string& key,
std::string* full_url,
PP_PNaClOptions* pnacl_options) const {
- // key must be one of kProgramKey or kFileKey '/' file-section-key
if (full_url == NULL || pnacl_options == NULL)
return false;
- if (key == kProgramKey)
Mark Seaborn 2015/04/16 20:45:14 In the commit message, can you comment that kProgr
- return GetKeyUrl(dictionary_, key, full_url, pnacl_options);
-
- std::string::const_iterator p = std::find(key.begin(), key.end(), '/');
- if (p == key.end()) {
- VLOG(1) << "ResolveKey failed: invalid key, no slash: " << key;
- return false;
- }
-
- // generalize to permit other sections?
- std::string prefix(key.begin(), p);
- if (prefix != kFilesKey) {
- VLOG(1) << "ResolveKey failed: invalid key, no \"files\" prefix: " << key;
- return false;
- }
-
const Json::Value& files = dictionary_[kFilesKey];
if (!files.isObject()) {
VLOG(1) << "ResolveKey failed: no \"files\" dictionary";
return false;
}
- std::string rest(p + 1, key.end());
- if (!files.isMember(rest)) {
+ if (!files.isMember(key)) {
VLOG(1) << "ResolveKey failed: no such \"files\" entry: " << key;
return false;
}
- return GetKeyUrl(files, rest, full_url, pnacl_options);
+ return GetKeyUrl(files, key, full_url, pnacl_options);
}
bool JsonManifest::MatchesSchema(ErrorInfo* error_info) {
« no previous file with comments | « no previous file | components/nacl/renderer/ppb_nacl_private_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698