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

Unified Diff: third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp

Issue 2124693002: Worker: Fix broken GC logic on Dedicated Worker while DOMTimer is set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/core/workers/InProcessWorkerMessagingProxy.cpp
diff --git a/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp b/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
index 8ccb106ab96a23b1832a052f6984c7f504d5c69c..f8718d3708324a29c6c6e0f8a8739bfaead2c026 100644
--- a/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
+++ b/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
@@ -28,7 +28,6 @@
#include "core/workers/InProcessWorkerMessagingProxy.h"
-#include "bindings/core/v8/V8GCController.h"
#include "core/dom/CrossThreadTask.h"
#include "core/dom/Document.h"
#include "core/dom/SecurityContext.h"
@@ -65,26 +64,23 @@ void processMessageOnWorkerGlobalScope(PassRefPtr<SerializedScriptValue> message
WorkerGlobalScope* globalScope = toWorkerGlobalScope(scriptContext);
MessagePortArray* ports = MessagePort::entanglePorts(*scriptContext, std::move(channels));
globalScope->dispatchEvent(MessageEvent::create(ports, message));
- workerObjectProxy->confirmMessageFromWorkerObject(V8GCController::hasPendingActivity(globalScope->thread()->isolate(), scriptContext));
+ workerObjectProxy->reportPendingActivity(globalScope);
+ workerObjectProxy->confirmMessageFromWorkerObject();
}
static int s_liveMessagingProxyCount = 0;
} // namespace
-InProcessWorkerMessagingProxy::InProcessWorkerMessagingProxy(InProcessWorkerBase* workerObject, WorkerClients* workerClients)
- : m_executionContext(workerObject->getExecutionContext())
+InProcessWorkerMessagingProxy::InProcessWorkerMessagingProxy(ExecutionContext* executionContext, InProcessWorkerBase* workerObject, WorkerClients* workerClients)
+ : m_executionContext(executionContext)
, m_workerObjectProxy(InProcessWorkerObjectProxy::create(this))
, m_workerObject(workerObject)
- , m_mayBeDestroyed(false)
, m_unconfirmedMessageCount(0)
- , m_workerThreadHadPendingActivity(false)
- , m_askedToTerminate(false)
, m_workerInspectorProxy(WorkerInspectorProxy::create())
, m_workerClients(workerClients)
{
DCHECK(isParentContextThread());
- DCHECK(m_workerObject);
s_liveMessagingProxyCount++;
}
@@ -270,14 +266,13 @@ void InProcessWorkerMessagingProxy::postMessageToPageInspector(const String& mes
m_workerInspectorProxy->dispatchMessageFromWorker(message);
}
-void InProcessWorkerMessagingProxy::confirmMessageFromWorkerObject(bool hasPendingActivity)
+void InProcessWorkerMessagingProxy::confirmMessageFromWorkerObject()
{
DCHECK(isParentContextThread());
- if (!m_askedToTerminate) {
- DCHECK(m_unconfirmedMessageCount);
- --m_unconfirmedMessageCount;
- }
- reportPendingActivity(hasPendingActivity);
+ if (m_askedToTerminate)
+ return;
+ DCHECK(m_unconfirmedMessageCount);
+ --m_unconfirmedMessageCount;
}
void InProcessWorkerMessagingProxy::reportPendingActivity(bool hasPendingActivity)

Powered by Google App Engine
This is Rietveld 408576698