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

Side by Side Diff: Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 587213003: [ServiceWorker] Plumbing the request mode from the renderer to the ServiceWorker. [1/2 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 ASSERT(m_workerGlobalScope); 77 ASSERT(m_workerGlobalScope);
78 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::Activate, eventID); 78 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::Activate, eventID);
79 observer->willDispatchEvent(); 79 observer->willDispatchEvent();
80 m_workerGlobalScope->dispatchEvent(InstallPhaseEvent::create(EventTypeNames: :activate, EventInit(), observer)); 80 m_workerGlobalScope->dispatchEvent(InstallPhaseEvent::create(EventTypeNames: :activate, EventInit(), observer));
81 observer->didDispatchEvent(); 81 observer->didDispatchEvent();
82 } 82 }
83 83
84 void ServiceWorkerGlobalScopeProxy::dispatchFetchEvent(int eventID, const WebSer viceWorkerRequest& webRequest) 84 void ServiceWorkerGlobalScopeProxy::dispatchFetchEvent(int eventID, const WebSer viceWorkerRequest& webRequest)
85 { 85 {
86 ASSERT(m_workerGlobalScope); 86 ASSERT(m_workerGlobalScope);
87 RespondWithObserver* observer = RespondWithObserver::create(m_workerGlobalSc ope, eventID); 87 RespondWithObserver* observer = RespondWithObserver::create(m_workerGlobalSc ope, eventID, webRequest.mode());
88 if (!RuntimeEnabledFeatures::serviceWorkerOnFetchEnabled()) { 88 if (!RuntimeEnabledFeatures::serviceWorkerOnFetchEnabled()) {
89 observer->didDispatchEvent(); 89 observer->didDispatchEvent();
90 return; 90 return;
91 } 91 }
92
93 Request* request = Request::create(m_workerGlobalScope, webRequest); 92 Request* request = Request::create(m_workerGlobalScope, webRequest);
94 RefPtrWillBeRawPtr<FetchEvent> fetchEvent(FetchEvent::create(observer, reque st)); 93 RefPtrWillBeRawPtr<FetchEvent> fetchEvent(FetchEvent::create(observer, reque st));
95 fetchEvent->setIsReload(webRequest.isReload()); 94 fetchEvent->setIsReload(webRequest.isReload());
96 m_workerGlobalScope->dispatchEvent(fetchEvent.release()); 95 m_workerGlobalScope->dispatchEvent(fetchEvent.release());
97 observer->didDispatchEvent(); 96 observer->didDispatchEvent();
98 } 97 }
99 98
100 void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& messag e, const WebMessagePortChannelArray& webChannels) 99 void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& messag e, const WebMessagePortChannelArray& webChannels)
101 { 100 {
102 ASSERT(m_workerGlobalScope); 101 ASSERT(m_workerGlobalScope);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 164
166 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) 165 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client)
167 : m_embeddedWorker(embeddedWorker) 166 : m_embeddedWorker(embeddedWorker)
168 , m_document(document) 167 , m_document(document)
169 , m_client(client) 168 , m_client(client)
170 , m_workerGlobalScope(0) 169 , m_workerGlobalScope(0)
171 { 170 {
172 } 171 }
173 172
174 } // namespace blink 173 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698