Back out 2 changesets (bug 1244122) for a 50% failure rate in (at least) 10.6 e10s browser_force_refresh.js

Backed out changeset d383f170be3f (bug 1244122)
Backed out changeset b1eacad41db4 (bug 1244122)
This commit is contained in:
Phil Ringnalda 2016-02-01 19:53:55 -08:00
parent 8c03ed4b8a
commit 77e89ae1cd
4 changed files with 8 additions and 32 deletions

View File

@ -30,9 +30,7 @@ function test() {
['dom.serviceWorkers.exemptFromPerDomainMax', true], ['dom.serviceWorkers.exemptFromPerDomainMax', true],
['dom.serviceWorkers.testing.enabled', true], ['dom.serviceWorkers.testing.enabled', true],
['dom.serviceWorkers.interception.enabled', true], ['dom.serviceWorkers.interception.enabled', true],
['dom.caches.enabled', true], ['dom.caches.enabled', true]]},
['browser.cache.disk.enable', false],
['browser.cache.memory.enable', false]]},
function() { function() {
var url = gTestRoot + 'browser_base_force_refresh.html'; var url = gTestRoot + 'browser_base_force_refresh.html';
var tab = gBrowser.addTab(); var tab = gBrowser.addTab();
@ -41,37 +39,24 @@ function test() {
tab.linkedBrowser.messageManager.loadFrameScript("data:,(" + encodeURIComponent(frameScript) + ")()", true); tab.linkedBrowser.messageManager.loadFrameScript("data:,(" + encodeURIComponent(frameScript) + ")()", true);
gBrowser.loadURI(url); gBrowser.loadURI(url);
function done() {
tab.linkedBrowser.messageManager.removeMessageListener("test:event", eventHandler);
gBrowser.removeTab(tab);
executeSoon(finish);
}
var cachedLoad = false; var cachedLoad = false;
var baseLoadCount = 0;
function eventHandler(msg) { function eventHandler(msg) {
if (msg.data.type === 'base-load') { if (msg.data.type === 'base-load') {
baseLoadCount += 1;
if (cachedLoad) { if (cachedLoad) {
is(baseLoadCount, 2, 'cached load should occur before second base load'); tab.linkedBrowser.messageManager.removeMessageListener("test:event", eventHandler);
return done();
} gBrowser.removeTab(tab);
if (baseLoadCount !== 1) { executeSoon(finish);
ok(false, 'base load without cached load should only occur once');
return done();
} }
} else if (msg.data.type === 'base-register') { } else if (msg.data.type === 'base-register') {
ok(!cachedLoad, 'cached load should not occur before base register'); ok(!cachedLoad, 'cached load should not occur before base register');
is(baseLoadCount, 1, 'register should occur after first base load'); refresh();
} else if (msg.data.type === 'base-sw-ready') { } else if (msg.data.type === 'base-sw-ready') {
ok(!cachedLoad, 'cached load should not occur before base ready'); ok(!cachedLoad, 'cached load should not occur before base ready');
is(baseLoadCount, 1, 'ready should occur after first base load');
refresh(); refresh();
} else if (msg.data.type === 'cached-load') { } else if (msg.data.type === 'cached-load') {
ok(!cachedLoad, 'cached load should not occur twice'); ok(!cachedLoad, 'cached load should not occur twice');
is(baseLoadCount, 1, 'cache load occur after first base load');
cachedLoad = true; cachedLoad = true;
forceRefresh(); forceRefresh();
} }

View File

@ -48,14 +48,12 @@ NS_IMETHODIMP CacheStorage::AsyncOpenURI(nsIURI *aURI,
if (!CacheStorageService::Self()) if (!CacheStorageService::Self())
return NS_ERROR_NOT_INITIALIZED; return NS_ERROR_NOT_INITIALIZED;
if (MOZ_UNLIKELY(!CacheObserver::UseDiskCache()) && mWriteToDisk && if (MOZ_UNLIKELY(!CacheObserver::UseDiskCache()) && mWriteToDisk) {
!(aFlags & OPEN_INTERCEPTED)) {
aCallback->OnCacheEntryAvailable(nullptr, false, nullptr, NS_ERROR_NOT_AVAILABLE); aCallback->OnCacheEntryAvailable(nullptr, false, nullptr, NS_ERROR_NOT_AVAILABLE);
return NS_OK; return NS_OK;
} }
if (MOZ_UNLIKELY(!CacheObserver::UseMemoryCache()) && !mWriteToDisk && if (MOZ_UNLIKELY(!CacheObserver::UseMemoryCache()) && !mWriteToDisk) {
!(aFlags & OPEN_INTERCEPTED)) {
aCallback->OnCacheEntryAvailable(nullptr, false, nullptr, NS_ERROR_NOT_AVAILABLE); aCallback->OnCacheEntryAvailable(nullptr, false, nullptr, NS_ERROR_NOT_AVAILABLE);
return NS_OK; return NS_OK;
} }

View File

@ -56,12 +56,6 @@ interface nsICacheStorage : nsISupports
*/ */
const uint32_t OPEN_SECRETLY = 1 << 5; const uint32_t OPEN_SECRETLY = 1 << 5;
/**
* Entry is being opened as part of a service worker interception. Do not
* allow the cache to be disabled in this case.
*/
const uint32_t OPEN_INTERCEPTED = 1 << 6;
/** /**
* Asynchronously opens a cache entry for the specified URI. * Asynchronously opens a cache entry for the specified URI.
* Result is fetched asynchronously via the callback. * Result is fetched asynchronously via the callback.

View File

@ -2991,7 +2991,6 @@ nsHttpChannel::OpenCacheEntry(bool isHttps)
intercepted->NotifyController(); intercepted->NotifyController();
} else { } else {
if (mInterceptCache == INTERCEPTED) { if (mInterceptCache == INTERCEPTED) {
cacheEntryOpenFlags |= nsICacheStorage::OPEN_INTERCEPTED;
DebugOnly<bool> exists; DebugOnly<bool> exists;
MOZ_ASSERT(NS_SUCCEEDED(cacheStorage->Exists(openURI, extension, &exists)) && exists, MOZ_ASSERT(NS_SUCCEEDED(cacheStorage->Exists(openURI, extension, &exists)) && exists,
"The entry must exist in the cache after we create it here"); "The entry must exist in the cache after we create it here");