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

Unified Diff: Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 1102363002: Add Client Attribute to FetchEvent- Blink Side. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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/platform/exported/WebServiceWorkerRequest.cpp ('k') | public/platform/WebServiceWorkerRequest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/ServiceWorkerGlobalScopeProxy.cpp
diff --git a/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/Source/web/ServiceWorkerGlobalScopeProxy.cpp
index 6b3513a7d5fa1fc44bff93e0b01799d74c2069b7..be40bcbb75ae5e3472a70a11c95b1c3b6878def5 100644
--- a/Source/web/ServiceWorkerGlobalScopeProxy.cpp
+++ b/Source/web/ServiceWorkerGlobalScopeProxy.cpp
@@ -51,7 +51,9 @@
#include "modules/push_messaging/PushMessageData.h"
#include "modules/serviceworkers/ExtendableEvent.h"
#include "modules/serviceworkers/FetchEvent.h"
+#include "modules/serviceworkers/ServiceWorkerClient.h"
#include "modules/serviceworkers/ServiceWorkerGlobalScope.h"
+#include "modules/serviceworkers/ServiceWorkerWindowClient.h"
#include "modules/serviceworkers/WaitUntilObserver.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "public/platform/WebCrossOriginServiceWorkerClient.h"
@@ -103,7 +105,12 @@ void ServiceWorkerGlobalScopeProxy::dispatchFetchEvent(int eventID, const WebSer
request->headers()->setGuard(Headers::ImmutableGuard);
FetchEventInit eventInit;
eventInit.setRequest(request);
- eventInit.setIsReload(webRequest.isReload());
+ if (webRequest.client().clientType == WebServiceWorkerClientTypeWindow) {
+ eventInit.setClient(ServiceWorkerWindowClient::create(webRequest.client()));
+ eventInit.setIsReload(webRequest.isReload());
+ } else {
+ eventInit.setClient(ServiceWorkerClient::create(webRequest.client()));
+ }
RefPtrWillBeRawPtr<FetchEvent> fetchEvent(FetchEvent::create(EventTypeNames::fetch, eventInit, observer));
defaultPrevented = !m_workerGlobalScope->dispatchEvent(fetchEvent.release());
observer->didDispatchEvent(defaultPrevented);
« no previous file with comments | « Source/platform/exported/WebServiceWorkerRequest.cpp ('k') | public/platform/WebServiceWorkerRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698