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

Unified Diff: Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp

Issue 419693002: reviving xiang's cl as a stopgap for the memcache + serviceworker interop problem (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerGlobalScope.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
diff --git a/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp b/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
index 80a39fb8b0e323ef70127f5cbfecd9cf62fac2da..7eb835d011b4395368562ae4acdc02623d77044e 100644
--- a/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
@@ -33,6 +33,7 @@
#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptState.h"
#include "bindings/core/v8/V8ThrowException.h"
+#include "core/fetch/MemoryCache.h"
#include "core/fetch/ResourceLoaderOptions.h"
#include "core/inspector/ScriptCallStack.h"
#include "core/loader/ThreadableLoader.h"
@@ -177,6 +178,16 @@ void ServiceWorkerGlobalScope::trace(Visitor* visitor)
WorkerGlobalScope::trace(visitor);
}
+void ServiceWorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState& exceptionState)
+{
+ // Bust the MemoryCache to ensure script requests reach the browser-side
+ // and get added to and retrieved from the ServiceWorker's script cache.
dominicc (has gone to gerrit) 2014/08/08 05:27:57 I think the "and retrieved from" is a bit inaccura
michaeln 2014/08/08 19:51:42 i think it's accurate, maybe less obvious. once th
+ // FIXME: Revisit in light of the solution to crbug/388375.
dominicc (has gone to gerrit) 2014/08/08 05:27:57 I don't think you need this FIXME; I think CR38837
michaeln 2014/08/08 19:51:42 I don't want to leave the impression that this is
+ for (Vector<String>::const_iterator it = urls.begin(); it != urls.end(); ++it)
+ MemoryCache::removeURLFromCache(this->executionContext(), completeURL(*it));
+ WorkerGlobalScope::importScripts(urls, exceptionState);
+}
+
void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallStack> callStack)
{
WorkerGlobalScope::logExceptionToConsole(errorMessage, sourceURL, lineNumber, columnNumber, callStack);
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerGlobalScope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698