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

Unified Diff: third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp

Issue 2733283004: Expose WebServiceWorkerNetworkProvider on DataSource (Closed)
Patch Set: . Created 3 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
Index: third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
index 1ffd05db72fc99a89274c835b1bf4eadf2fe8cf8..1bd6a82e681aec3b91e18702e95ef8a6c3b78e00 100644
--- a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
@@ -59,12 +59,12 @@
#include "public/platform/WebString.h"
#include "public/platform/WebURL.h"
#include "public/platform/WebURLRequest.h"
+#include "public/platform/modules/serviceworker/WebServiceWorkerNetworkProvider.h"
#include "public/web/WebDevToolsAgent.h"
#include "public/web/WebFrame.h"
#include "public/web/WebSettings.h"
#include "public/web/WebView.h"
#include "public/web/WebWorkerContentSettingsClientProxy.h"
-#include "public/web/modules/serviceworker/WebServiceWorkerNetworkProvider.h"
#include "web/IndexedDBClientImpl.h"
#include "web/LocalFileSystemClient.h"
#include "web/WebDataSourceImpl.h"
@@ -170,17 +170,17 @@ void WebSharedWorkerImpl::loadShadowPage() {
void WebSharedWorkerImpl::willSendRequest(WebLocalFrame* frame,
WebURLRequest& request) {
- DCHECK(isMainThread());
- if (m_networkProvider)
- m_networkProvider->willSendRequest(frame->dataSource(), request);
+ auto networkProvider = frame->dataSource()->getServiceWorkerNetworkProvider();
dcheng 2017/03/10 04:48:38 Nit: auto* (this is checked automatically in Chrom
kinuko 2017/03/10 05:52:29 Done.
+ if (networkProvider)
+ networkProvider->willSendRequest(request);
}
void WebSharedWorkerImpl::didFinishDocumentLoad(WebLocalFrame* frame) {
DCHECK(isMainThread());
DCHECK(!m_loadingDocument);
DCHECK(!m_mainScriptLoader);
- m_networkProvider = WTF::wrapUnique(
- m_client->createServiceWorkerNetworkProvider(frame->dataSource()));
+ frame->dataSource()->setServiceWorkerNetworkProvider(
+ WTF::wrapUnique(m_client->createServiceWorkerNetworkProvider()));
m_mainScriptLoader = WorkerScriptLoader::create();
m_mainScriptLoader->setRequestContext(
WebURLRequest::RequestContextSharedWorker);
@@ -201,20 +201,6 @@ void WebSharedWorkerImpl::didFinishDocumentLoad(WebLocalFrame* frame) {
// invoked and |this| might have been deleted at this point.
}
-bool WebSharedWorkerImpl::isControlledByServiceWorker(
- WebDataSource& dataSource) {
- DCHECK(isMainThread());
- return m_networkProvider &&
- m_networkProvider->isControlledByServiceWorker(dataSource);
-}
-
-int64_t WebSharedWorkerImpl::serviceWorkerID(WebDataSource& dataSource) {
- DCHECK(isMainThread());
- if (!m_networkProvider)
- return -1;
- return m_networkProvider->serviceWorkerID(dataSource);
-}
-
void WebSharedWorkerImpl::sendProtocolMessage(int sessionId,
int callId,
const WebString& message,

Powered by Google App Engine
This is Rietveld 408576698