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

Unified Diff: Source/web/WebEmbeddedWorkerImpl.cpp

Issue 194073002: Identify service worker version at main resource load time (BlinkSide) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/WebEmbeddedWorkerImpl.h ('k') | public/web/WebServiceWorkerContextClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebEmbeddedWorkerImpl.cpp
diff --git a/Source/web/WebEmbeddedWorkerImpl.cpp b/Source/web/WebEmbeddedWorkerImpl.cpp
index 57e6730cd64c6c6fa5dbad05f85c897d9815122c..b5da7daf9ff4e7ab8912537329e1006877532087 100644
--- a/Source/web/WebEmbeddedWorkerImpl.cpp
+++ b/Source/web/WebEmbeddedWorkerImpl.cpp
@@ -36,6 +36,7 @@
#include "WebDataSourceImpl.h"
#include "WebFrameImpl.h"
#include "WebServiceWorkerContextClient.h"
+#include "WebServiceWorkerNetworkProvider.h"
#include "WebView.h"
#include "WebWorkerPermissionClientProxy.h"
#include "WorkerPermissionClient.h"
@@ -204,10 +205,21 @@ void WebEmbeddedWorkerImpl::prepareShadowPageForLoader()
webFrame->frame()->loader().load(FrameLoadRequest(0, ResourceRequest(m_workerStartData.scriptURL), SubstituteData(buffer, "text/html", "UTF-8", KURL())));
}
+void WebEmbeddedWorkerImpl::willSendRequest(
+ WebFrame* frame, unsigned, WebURLRequest& request,
+ const WebURLResponse& redirectResponse)
+{
+ if (m_networkProvider)
+ m_networkProvider->willSendRequest(frame->dataSource(), request);
+}
+
void WebEmbeddedWorkerImpl::didFinishDocumentLoad(WebFrame* frame)
{
ASSERT(!m_mainScriptLoader);
+ ASSERT(!m_networkProvider);
ASSERT(m_mainFrame);
+ ASSERT(m_workerContextClient);
+ m_networkProvider = adoptPtr(m_workerContextClient->createServiceWorkerNetworkProvider(frame->dataSource()));
m_mainScriptLoader = Loader::create();
m_mainScriptLoader->load(
toWebFrameImpl(m_mainFrame)->frame()->document(),
« no previous file with comments | « Source/web/WebEmbeddedWorkerImpl.h ('k') | public/web/WebServiceWorkerContextClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698