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

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

Issue 1710903002: Revert of service worker: use 200 OK for update requests even in the no update case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/WebEmbeddedWorkerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
index a933efb7ed5e498c903ac7b50f3f1aa6ac22c9d2..303b19e23f291aed8f8284c243a84ac51b70e6dc 100644
--- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
@@ -88,7 +88,6 @@
, m_mainFrame(nullptr)
, m_loadingShadowPage(false)
, m_askedToTerminate(false)
- , m_pauseAfterDownloadState(DontPauseAfterDownload)
, m_waitingForDebuggerState(NotWaitingForDebugger)
{
runningWorkerInstances().add(this);
@@ -125,10 +124,7 @@
{
ASSERT(!m_askedToTerminate);
ASSERT(!m_mainScriptLoader);
- ASSERT(m_pauseAfterDownloadState == DontPauseAfterDownload);
m_workerStartData = data;
- if (data.pauseAfterDownloadMode == WebEmbeddedWorkerStartData::PauseAfterDownload)
- m_pauseAfterDownloadState = DoPauseAfterDownload;
prepareShadowPageForLoader();
}
@@ -151,23 +147,14 @@
}
if (!m_workerThread) {
// The worker thread has not been created yet if the worker is asked to
- // terminate during waiting for debugger or paused after download.
- ASSERT(m_workerStartData.waitForDebuggerMode == WebEmbeddedWorkerStartData::WaitForDebugger || m_pauseAfterDownloadState == IsPausedAfterDownload);
+ // terminate during waiting for debugger.
+ ASSERT(m_workerStartData.waitForDebuggerMode == WebEmbeddedWorkerStartData::WaitForDebugger);
// This deletes 'this'.
m_workerContextClient->workerContextFailedToStart();
return;
}
m_workerThread->terminate();
m_workerInspectorProxy->workerThreadTerminated();
-}
-
-void WebEmbeddedWorkerImpl::resumeAfterDownload()
-{
- ASSERT(!m_askedToTerminate);
- ASSERT(m_pauseAfterDownloadState == IsPausedAfterDownload);
-
- m_pauseAfterDownloadState = DontPauseAfterDownload;
- startWorkerThread();
}
void WebEmbeddedWorkerImpl::attachDevTools(const WebString& hostId, int sessionId)
@@ -250,7 +237,7 @@
// If we were asked to wait for debugger then it is the good time to do that.
m_workerContextClient->workerReadyForInspection();
if (m_workerStartData.waitForDebuggerMode == WebEmbeddedWorkerStartData::WaitForDebugger) {
- m_waitingForDebuggerState = WaitingForDebugger;
+ m_waitingForDebuggerState = WaitingForDebuggerBeforeLoadingScript;
return;
}
@@ -304,15 +291,18 @@
void WebEmbeddedWorkerImpl::resumeStartup()
{
- bool wasWaiting = (m_waitingForDebuggerState == WaitingForDebugger);
+ WaitingForDebuggerState waitingForDebuggerState = m_waitingForDebuggerState;
m_waitingForDebuggerState = NotWaitingForDebugger;
- if (wasWaiting)
+ if (waitingForDebuggerState == WaitingForDebuggerBeforeLoadingScript)
loadShadowPage();
+ else if (waitingForDebuggerState == WaitingForDebuggerAfterScriptLoaded)
+ startWorkerThread();
}
void WebEmbeddedWorkerImpl::onScriptLoaderFinished()
{
ASSERT(m_mainScriptLoader);
+
if (m_askedToTerminate)
return;
@@ -331,16 +321,11 @@
scriptCachedMetadataSizeHistogram.count(m_mainScriptLoader->cachedMetadata()->size());
}
- if (m_pauseAfterDownloadState == DoPauseAfterDownload) {
- m_pauseAfterDownloadState = IsPausedAfterDownload;
- return;
- }
startWorkerThread();
}
void WebEmbeddedWorkerImpl::startWorkerThread()
{
- ASSERT(m_pauseAfterDownloadState == DontPauseAfterDownload);
ASSERT(!m_askedToTerminate);
Document* document = m_mainFrame->frame()->document();
« no previous file with comments | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h ('k') | third_party/WebKit/Source/web/WebEmbeddedWorkerImplTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698