Back out bug 1173467 (changesets a20799ebf48c, 9312c5cb756e, c0e8bba17067, af075443ab21, 30cefdf8d020) for assertion failures in test_app_protocol.html.
This commit is contained in:
@@ -322,7 +322,6 @@ class CacheCreator final : public PromiseNativeHandler
|
||||
public:
|
||||
explicit CacheCreator(WorkerPrivate* aWorkerPrivate)
|
||||
: mCacheName(aWorkerPrivate->ServiceWorkerCacheName())
|
||||
, mPrivateBrowsing(aWorkerPrivate->IsInPrivateBrowsing())
|
||||
{
|
||||
MOZ_ASSERT(aWorkerPrivate->IsServiceWorker());
|
||||
MOZ_ASSERT(aWorkerPrivate->LoadScriptAsPartOfLoadingServiceWorkerScript());
|
||||
@@ -383,7 +382,6 @@ private:
|
||||
nsTArray<nsRefPtr<CacheScriptLoader>> mLoaders;
|
||||
|
||||
nsString mCacheName;
|
||||
bool mPrivateBrowsing;
|
||||
};
|
||||
|
||||
class CacheScriptLoader final : public PromiseNativeHandler
|
||||
@@ -1243,19 +1241,11 @@ CacheCreator::CreateCacheStorage(nsIPrincipal* aPrincipal)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// If we're in private browsing mode, don't even try to create the
|
||||
// CacheStorage. Instead, just fail immediately to terminate the
|
||||
// ServiceWorker load.
|
||||
if (NS_WARN_IF(mPrivateBrowsing)) {
|
||||
return NS_ERROR_DOM_SECURITY_ERR;
|
||||
}
|
||||
|
||||
ErrorResult error;
|
||||
mCacheStorage =
|
||||
CacheStorage::CreateOnMainThread(cache::CHROME_ONLY_NAMESPACE,
|
||||
mSandboxGlobalObject,
|
||||
aPrincipal, mPrivateBrowsing,
|
||||
error);
|
||||
aPrincipal, error);
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
return error.StealNSResult();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user