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

Unified Diff: Source/web/ServiceWorkerGlobalScopeClientImpl.cpp

Issue 185423005: Add more plumbing for FetchEvent including WebServiceWorkerResponse (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: BLINK_EXPORT -> BLINK_PLATFORM_EXPORT Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/ServiceWorkerGlobalScopeClientImpl.h ('k') | Source/web/ServiceWorkerGlobalScopeProxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/ServiceWorkerGlobalScopeClientImpl.cpp
diff --git a/Source/web/ServiceWorkerGlobalScopeClientImpl.cpp b/Source/web/ServiceWorkerGlobalScopeClientImpl.cpp
index b3d673dd0128da6e5ebca9c3b1791830fc342d7c..10b5cff59cf7575a133eb5fb2d86729c59e4e250 100644
--- a/Source/web/ServiceWorkerGlobalScopeClientImpl.cpp
+++ b/Source/web/ServiceWorkerGlobalScopeClientImpl.cpp
@@ -34,6 +34,7 @@
#include "WebServiceWorkerContextClient.h"
#include "modules/serviceworkers/Response.h"
#include "platform/NotImplemented.h"
+#include "public/platform/WebServiceWorkerResponse.h"
#include "wtf/PassOwnPtr.h"
namespace blink {
@@ -55,7 +56,16 @@ void ServiceWorkerGlobalScopeClientImpl::didHandleInstallEvent(int installEventI
void ServiceWorkerGlobalScopeClientImpl::didHandleFetchEvent(int fetchEventID, PassRefPtr<WebCore::Response> response)
{
- notImplemented();
+ if (!m_client)
+ return;
+ if (!response) {
+ m_client->didHandleFetchEvent(fetchEventID);
+ return;
+ }
+
+ WebServiceWorkerResponse webResponse;
+ response->populateWebServiceWorkerResponse(webResponse);
+ m_client->didHandleFetchEvent(fetchEventID, webResponse);
}
ServiceWorkerGlobalScopeClientImpl::ServiceWorkerGlobalScopeClientImpl(PassOwnPtr<WebServiceWorkerContextClient> client)
« no previous file with comments | « Source/web/ServiceWorkerGlobalScopeClientImpl.h ('k') | Source/web/ServiceWorkerGlobalScopeProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698