summaryrefslogtreecommitdiffstats
path: root/chrome/browser/nacl_host/pnacl_host.cc
diff options
context:
space:
mode:
authorvitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-04 22:31:52 +0000
committervitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-04 22:31:52 +0000
commitc6cf676e31bfd696ad7c9538424cc0dd9fcb6f72 (patch)
treedc8b93163663993c5a9ab73065db4233d10bdf93 /chrome/browser/nacl_host/pnacl_host.cc
parent2dead0dc2d232a9950f51aecee70571f69bb9b49 (diff)
downloadchromium_src-c6cf676e31bfd696ad7c9538424cc0dd9fcb6f72.zip
chromium_src-c6cf676e31bfd696ad7c9538424cc0dd9fcb6f72.tar.gz
chromium_src-c6cf676e31bfd696ad7c9538424cc0dd9fcb6f72.tar.bz2
Revert 221275 "Handle cache-control:no-store header in PNaCl tra..."
> Handle cache-control:no-store header in PNaCl translation cache > > Pexe files with the cache-control:no-store header should not be cached. > Add a field to the PnaclCacheInfo struct, plumb the value all the way > from the plugin to the browser, and treat it basically the same way we > currently treat incognito translations (since we currently don't have an > off-the-record cache for those). > R=jvoung@chromium.org > BUG=none, noticed this was missing when doing cleanup > > Review URL: https://chromiumcodereview.appspot.com/23458015 TBR=dschuff@chromium.org Review URL: https://codereview.chromium.org/23684032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221281 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/nacl_host/pnacl_host.cc')
-rw-r--r--chrome/browser/nacl_host/pnacl_host.cc24
1 files changed, 10 insertions, 14 deletions
diff --git a/chrome/browser/nacl_host/pnacl_host.cc b/chrome/browser/nacl_host/pnacl_host.cc
index 59f579f9..2c3a082 100644
--- a/chrome/browser/nacl_host/pnacl_host.cc
+++ b/chrome/browser/nacl_host/pnacl_host.cc
@@ -45,12 +45,6 @@ PnaclHost::PendingTranslation::PendingTranslation()
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 @@ void PnaclHost::OnTempFileReturn(const TranslationID& id,
// 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 @@ void PnaclHost::CheckCacheQueryReady(
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 @@ void PnaclHost::TranslationFinished(int render_process_id,
// 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 @@ void PnaclHost::RendererClosing(int render_process_id) {
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);
}
}