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

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

Issue 380923002: Introducing the WebServiceWorkerCacheStorage. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: api fixes Created 6 years, 5 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 85
86 String ServiceWorkerGlobalScope::scope(ExecutionContext* context) 86 String ServiceWorkerGlobalScope::scope(ExecutionContext* context)
87 { 87 {
88 return ServiceWorkerGlobalScopeClient::from(context)->scope().string(); 88 return ServiceWorkerGlobalScopeClient::from(context)->scope().string();
89 } 89 }
90 90
91 PassRefPtr<CacheStorage> ServiceWorkerGlobalScope::caches(ExecutionContext* cont ext) 91 PassRefPtr<CacheStorage> ServiceWorkerGlobalScope::caches(ExecutionContext* cont ext)
92 { 92 {
93 if (!m_cacheStorage) 93 if (!m_cacheStorage)
94 m_cacheStorage = CacheStorage::create(); 94 m_cacheStorage = CacheStorage::create(ServiceWorkerGlobalScopeClient::fr om(context)->cacheStorage());
95 return m_cacheStorage; 95 return m_cacheStorage;
96 } 96 }
97 97
98 ScriptPromise ServiceWorkerGlobalScope::fetch(ScriptState* scriptState, Request* request) 98 ScriptPromise ServiceWorkerGlobalScope::fetch(ScriptState* scriptState, Request* request)
99 { 99 {
100 OwnPtr<ResourceRequest> resourceRequest(request->createResourceRequest()); 100 OwnPtr<ResourceRequest> resourceRequest(request->createResourceRequest());
101 resourceRequest->setRequestContext(blink::WebURLRequest::RequestContextFetch ); 101 resourceRequest->setRequestContext(blink::WebURLRequest::RequestContextFetch );
102 return m_fetchManager->fetch(scriptState, resourceRequest.release()); 102 return m_fetchManager->fetch(scriptState, resourceRequest.release());
103 } 103 }
104 104
(...skipping 26 matching lines...) Expand all
131 WorkerGlobalScope::trace(visitor); 131 WorkerGlobalScope::trace(visitor);
132 } 132 }
133 133
134 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawP tr<ScriptCallStack> callStack) 134 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawP tr<ScriptCallStack> callStack)
135 { 135 {
136 WorkerGlobalScope::logExceptionToConsole(errorMessage, sourceURL, lineNumber , columnNumber, callStack); 136 WorkerGlobalScope::logExceptionToConsole(errorMessage, sourceURL, lineNumber , columnNumber, callStack);
137 addMessageToWorkerConsole(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, callStack, 0); 137 addMessageToWorkerConsole(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, callStack, 0);
138 } 138 }
139 139
140 } // namespace blink 140 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698