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

Unified Diff: trunk/src/chrome/browser/nacl_host/pnacl_host.cc

Issue 23684032: Revert 221275 "Handle cache-control:no-store header in PNaCl tra..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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: trunk/src/chrome/browser/nacl_host/pnacl_host.cc
===================================================================
--- trunk/src/chrome/browser/nacl_host/pnacl_host.cc (revision 221280)
+++ trunk/src/chrome/browser/nacl_host/pnacl_host.cc (working copy)
@@ -45,12 +45,6 @@
cache_info(nacl::PnaclCacheInfo()) {}
PnaclHost::PendingTranslation::~PendingTranslation() {}
-bool PnaclHost::TranslationMayBeCached(
- const PendingTranslationMap::iterator& entry) {
- return !entry->second.is_incognito &&
- !entry->second.cache_info.has_no_store_header;
-}
-
/////////////////////////////////////// Initialization
static base::FilePath GetCachePath() {
@@ -274,10 +268,11 @@
// waiting for its result.
LOG(ERROR) << "OnTempFileReturn: temp file creation failed";
std::string key(entry->second.cache_key);
+ bool is_incognito = entry->second.is_incognito;
entry->second.callback.Run(fd, false);
pending_translations_.erase(entry);
- // No translations will be waiting for entries that will not be stored.
- if (TranslationMayBeCached(entry))
+ // No translations will be waiting for an incongnito translation
+ if (!is_incognito)
RequeryMatchingTranslations(key);
return;
}
@@ -304,9 +299,9 @@
if (it->second.cache_key == entry->second.cache_key &&
// and it's not this translation,
it->first != entry->first &&
- // and it can be stored in the cache,
- TranslationMayBeCached(it) &&
- // and it's already gotten past this check and returned the miss.
+ // and it's not incognito,
+ !it->second.is_incognito &&
+ // and if it's already gotten past this check and returned the miss.
it->second.got_cache_reply &&
it->second.got_nexe_fd) {
return;
@@ -389,7 +384,7 @@
// TODO(dschuff): use a separate in-memory cache for incognito
// translations.
if (!entry->second.got_nexe_fd || !entry->second.got_cache_reply ||
- !success || !TranslationMayBeCached(entry)) {
+ !success || entry->second.is_incognito) {
store_nexe = false;
} else if (!base::PostTaskAndReplyWithResult(
BrowserThread::GetBlockingPool(),
@@ -530,9 +525,10 @@
base::Bind(base::IgnoreResult(base::ClosePlatformFile),
to_erase->second.nexe_fd));
std::string key(to_erase->second.cache_key);
+ bool is_incognito = to_erase->second.is_incognito;
pending_translations_.erase(to_erase);
- // No translations will be waiting for entries that will not be stored.
- if (TranslationMayBeCached(to_erase))
+ // No translations will be blocked waiting for an incongnito translation
+ if (!is_incognito)
RequeryMatchingTranslations(key);
}
}
« no previous file with comments | « trunk/src/chrome/browser/nacl_host/pnacl_host.h ('k') | trunk/src/chrome/browser/nacl_host/pnacl_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698