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

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

Issue 2733283004: Expose WebServiceWorkerNetworkProvider on DataSource (Closed)
Patch Set: consistency 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
« no previous file with comments | « third_party/WebKit/Source/web/WebSharedWorkerImpl.h ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0a5ad0959f3c8618bf00a9c8514b29bf564b5074 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,18 @@ 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();
+ 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 +202,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,
« no previous file with comments | « third_party/WebKit/Source/web/WebSharedWorkerImpl.h ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698