Chromium Code Reviews| 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); |