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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerGlobalScope.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 #include "config.h" 30 #include "config.h"
31 #include "ServiceWorkerGlobalScope.h" 31 #include "ServiceWorkerGlobalScope.h"
32 32
33 #include "bindings/core/v8/ScriptPromise.h" 33 #include "bindings/core/v8/ScriptPromise.h"
34 #include "bindings/core/v8/ScriptState.h" 34 #include "bindings/core/v8/ScriptState.h"
35 #include "bindings/core/v8/V8ThrowException.h" 35 #include "bindings/core/v8/V8ThrowException.h"
36 #include "core/fetch/MemoryCache.h"
36 #include "core/fetch/ResourceLoaderOptions.h" 37 #include "core/fetch/ResourceLoaderOptions.h"
37 #include "core/inspector/ScriptCallStack.h" 38 #include "core/inspector/ScriptCallStack.h"
38 #include "core/loader/ThreadableLoader.h" 39 #include "core/loader/ThreadableLoader.h"
39 #include "core/workers/WorkerClients.h" 40 #include "core/workers/WorkerClients.h"
40 #include "core/workers/WorkerThreadStartupData.h" 41 #include "core/workers/WorkerThreadStartupData.h"
41 #include "modules/CachePolyfill.h" 42 #include "modules/CachePolyfill.h"
42 #include "modules/CacheStoragePolyfill.h" 43 #include "modules/CacheStoragePolyfill.h"
43 #include "modules/EventTargetModules.h" 44 #include "modules/EventTargetModules.h"
44 #include "modules/serviceworkers/CacheStorage.h" 45 #include "modules/serviceworkers/CacheStorage.h"
45 #include "modules/serviceworkers/FetchManager.h" 46 #include "modules/serviceworkers/FetchManager.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 return EventTargetNames::ServiceWorkerGlobalScope; 171 return EventTargetNames::ServiceWorkerGlobalScope;
171 } 172 }
172 173
173 void ServiceWorkerGlobalScope::trace(Visitor* visitor) 174 void ServiceWorkerGlobalScope::trace(Visitor* visitor)
174 { 175 {
175 visitor->trace(m_clients); 176 visitor->trace(m_clients);
176 visitor->trace(m_caches); 177 visitor->trace(m_caches);
177 WorkerGlobalScope::trace(visitor); 178 WorkerGlobalScope::trace(visitor);
178 } 179 }
179 180
181 void ServiceWorkerGlobalScope::importScripts(const Vector<String>& urls, Excepti onState& exceptionState)
182 {
183 // Bust the MemoryCache to ensure script requests reach the browser-side
184 // 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
185 // 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
186 for (Vector<String>::const_iterator it = urls.begin(); it != urls.end(); ++i t)
187 MemoryCache::removeURLFromCache(this->executionContext(), completeURL(*i t));
188 WorkerGlobalScope::importScripts(urls, exceptionState);
189 }
190
180 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawP tr<ScriptCallStack> callStack) 191 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawP tr<ScriptCallStack> callStack)
181 { 192 {
182 WorkerGlobalScope::logExceptionToConsole(errorMessage, sourceURL, lineNumber , columnNumber, callStack); 193 WorkerGlobalScope::logExceptionToConsole(errorMessage, sourceURL, lineNumber , columnNumber, callStack);
183 addMessageToWorkerConsole(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, callStack, 0); 194 addMessageToWorkerConsole(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, callStack, 0);
184 } 195 }
185 196
186 } // namespace blink 197 } // namespace blink
OLDNEW
« 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