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

Unified Diff: components/nacl/browser/pnacl_translation_cache.cc

Issue 163433015: Add sandbox ISA and extra compile flag fields to PNaCl translation cache key (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 6 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/browser/pnacl_translation_cache.cc
diff --git a/components/nacl/browser/pnacl_translation_cache.cc b/components/nacl/browser/pnacl_translation_cache.cc
index e27103adf8d5f2fc9f81763d4866931f8f4b8ab0..95afade4b94c20b40a1a4dc43e3b5cacf9d7cc5a 100644
--- a/components/nacl/browser/pnacl_translation_cache.cc
+++ b/components/nacl/browser/pnacl_translation_cache.cc
@@ -398,9 +398,13 @@ int PnaclTranslationCache::Size() {
return disk_cache_->GetEntryCount();
}
+// Beware that any changes to this function or to PnaclCacheInfo will
+// effectively invalidate existing translation cache entries.
+
// static
std::string PnaclTranslationCache::GetKey(const nacl::PnaclCacheInfo& info) {
- if (!info.pexe_url.is_valid() || info.abi_version < 0 || info.opt_level < 0)
+ if (!info.pexe_url.is_valid() || info.abi_version < 0 || info.opt_level < 0 ||
+ info.extra_flags.size() > 512)
return std::string();
std::string retval("ABI:");
retval += IntToString(info.abi_version) + ";" + "opt:" +
@@ -426,7 +430,9 @@ std::string PnaclTranslationCache::GetKey(const nacl::PnaclCacheInfo& info) {
IntToString(exploded.hour) + ":" + IntToString(exploded.minute) +
":" + IntToString(exploded.second) + ":" +
IntToString(exploded.millisecond) + ":UTC;";
- retval += "etag:" + info.etag;
+ retval += "etag:" + info.etag + ";";
+ retval += "sandbox:" + info.sandbox_isa + ";";
+ retval += "extra_flags:" + info.extra_flags + ";";
return retval;
}
« no previous file with comments | « no previous file | components/nacl/browser/pnacl_translation_cache_unittest.cc » ('j') | ppapi/api/private/ppb_nacl_private.idl » ('J')

Powered by Google App Engine
This is Rietveld 408576698