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

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

Issue 424643002: Introducing the WebServiceWorkerCacheStorage (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: parameter naming 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 | Annotate | Revision Log
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 m_fetchManager.clear(); 82 m_fetchManager.clear();
83 } 83 }
84 84
85 String ServiceWorkerGlobalScope::scope(ExecutionContext* context) 85 String ServiceWorkerGlobalScope::scope(ExecutionContext* context)
86 { 86 {
87 return ServiceWorkerGlobalScopeClient::from(context)->scope().string(); 87 return ServiceWorkerGlobalScopeClient::from(context)->scope().string();
88 } 88 }
89 89
90 PassRefPtrWillBeRawPtr<CacheStorage> ServiceWorkerGlobalScope::caches(ExecutionC ontext* context) 90 PassRefPtrWillBeRawPtr<CacheStorage> ServiceWorkerGlobalScope::caches(ExecutionC ontext* context)
91 { 91 {
92 if (!m_cacheStorage) 92 if (!m_caches)
93 m_cacheStorage = CacheStorage::create(); 93 m_caches = CacheStorage::create(ServiceWorkerGlobalScopeClient::from(con text)->cacheStorage());
94 return m_cacheStorage; 94 return m_caches;
95 } 95 }
96 96
97 ScriptPromise ServiceWorkerGlobalScope::fetch(ScriptState* scriptState, Request* request) 97 ScriptPromise ServiceWorkerGlobalScope::fetch(ScriptState* scriptState, Request* request)
98 { 98 {
99 if (!m_fetchManager) 99 if (!m_fetchManager)
100 return ScriptPromise::reject(scriptState, V8ThrowException::createTypeEr ror("ServiceWorkerGlobalScope is shutting down.", scriptState->isolate())); 100 return ScriptPromise::reject(scriptState, V8ThrowException::createTypeEr ror("ServiceWorkerGlobalScope is shutting down.", scriptState->isolate()));
101 // "Let |r| be the associated request of the result of invoking the initial 101 // "Let |r| be the associated request of the result of invoking the initial
102 // value of Request as constructor with |input| and |init| as arguments. If 102 // value of Request as constructor with |input| and |init| as arguments. If
103 // this throws an exception, reject |p| with it." 103 // this throws an exception, reject |p| with it."
104 TrackExceptionState exceptionState; 104 TrackExceptionState exceptionState;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 } 166 }
167 167
168 const AtomicString& ServiceWorkerGlobalScope::interfaceName() const 168 const AtomicString& ServiceWorkerGlobalScope::interfaceName() const
169 { 169 {
170 return EventTargetNames::ServiceWorkerGlobalScope; 170 return EventTargetNames::ServiceWorkerGlobalScope;
171 } 171 }
172 172
173 void ServiceWorkerGlobalScope::trace(Visitor* visitor) 173 void ServiceWorkerGlobalScope::trace(Visitor* visitor)
174 { 174 {
175 visitor->trace(m_clients); 175 visitor->trace(m_clients);
176 visitor->trace(m_cacheStorage); 176 visitor->trace(m_caches);
177 WorkerGlobalScope::trace(visitor); 177 WorkerGlobalScope::trace(visitor);
178 } 178 }
179 179
180 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawP tr<ScriptCallStack> callStack) 180 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawP tr<ScriptCallStack> callStack)
181 { 181 {
182 WorkerGlobalScope::logExceptionToConsole(errorMessage, sourceURL, lineNumber , columnNumber, callStack); 182 WorkerGlobalScope::logExceptionToConsole(errorMessage, sourceURL, lineNumber , columnNumber, callStack);
183 addMessageToWorkerConsole(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, callStack, 0); 183 addMessageToWorkerConsole(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, callStack, 0);
184 } 184 }
185 185
186 } // namespace blink 186 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerGlobalScope.h ('k') | Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698