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

Side by Side Diff: Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp

Issue 929953002: CachedMetadata support for ServiceWorker script. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated kinuko's comment Created 5 years, 10 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
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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 void ServiceWorkerGlobalScope::importScripts(const Vector<String>& urls, Excepti onState& exceptionState) 204 void ServiceWorkerGlobalScope::importScripts(const Vector<String>& urls, Excepti onState& exceptionState)
205 { 205 {
206 // Bust the MemoryCache to ensure script requests reach the browser-side 206 // Bust the MemoryCache to ensure script requests reach the browser-side
207 // and get added to and retrieved from the ServiceWorker's script cache. 207 // and get added to and retrieved from the ServiceWorker's script cache.
208 // FIXME: Revisit in light of the solution to crbug/388375. 208 // FIXME: Revisit in light of the solution to crbug/388375.
209 for (Vector<String>::const_iterator it = urls.begin(); it != urls.end(); ++i t) 209 for (Vector<String>::const_iterator it = urls.begin(); it != urls.end(); ++i t)
210 MemoryCache::removeURLFromCache(this->executionContext(), completeURL(*i t)); 210 MemoryCache::removeURLFromCache(this->executionContext(), completeURL(*i t));
211 WorkerGlobalScope::importScripts(urls, exceptionState); 211 WorkerGlobalScope::importScripts(urls, exceptionState);
212 } 212 }
213 213
214 void ServiceWorkerGlobalScope::setCachedMetadata(const KURL& url, const char* da ta, size_t size)
215 {
216 ServiceWorkerGlobalScopeClient::from(this)->setCachedMetadata(url, data, siz e);
217 }
218
219 void ServiceWorkerGlobalScope::clearCachedMetadata(const KURL& url)
220 {
221 ServiceWorkerGlobalScopeClient::from(this)->clearCachedMetadata(url);
222 }
223
214 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRe fPtrWillBeRawPtr<ScriptCallStack> callStack) 224 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRe fPtrWillBeRawPtr<ScriptCallStack> callStack)
215 { 225 {
216 WorkerGlobalScope::logExceptionToConsole(errorMessage, scriptId, sourceURL, lineNumber, columnNumber, callStack); 226 WorkerGlobalScope::logExceptionToConsole(errorMessage, scriptId, sourceURL, lineNumber, columnNumber, callStack);
217 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(J SMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber); 227 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(J SMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber);
218 consoleMessage->setScriptId(scriptId); 228 consoleMessage->setScriptId(scriptId);
219 consoleMessage->setCallStack(callStack); 229 consoleMessage->setCallStack(callStack);
220 addMessageToWorkerConsole(consoleMessage.release()); 230 addMessageToWorkerConsole(consoleMessage.release());
221 } 231 }
222 232
223 } // namespace blink 233 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698