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

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

Issue 2478113002: Fix UAF in closures posted from InProcessWorkerObjectProxy (Closed)
Patch Set: Created 4 years, 1 month 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 63a575e51722765e7ef34032507dbb8fca4e423e..62e12b774d113ee14d3bff78f4bc51c1b4b40628 100644
--- a/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
+++ b/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
@@ -87,11 +87,14 @@ InProcessWorkerMessagingProxy::InProcessWorkerMessagingProxy(
InProcessWorkerBase* workerObject,
WorkerClients* workerClients)
: ThreadedMessagingProxyBase(executionContext),
- m_workerObjectProxy(InProcessWorkerObjectProxy::create(this)),
m_workerObject(workerObject),
m_workerClients(workerClients),
m_unconfirmedMessageCount(0),
- m_workerGlobalScopeMayHavePendingActivity(false) {}
+ m_workerGlobalScopeMayHavePendingActivity(false),
+ m_weakPtrFactory(this) {
+ m_workerObjectProxy =
+ InProcessWorkerObjectProxy::create(m_weakPtrFactory.createWeakPtr());
+}
InProcessWorkerMessagingProxy::~InProcessWorkerMessagingProxy() {
DCHECK(!m_workerObject);

Powered by Google App Engine
This is Rietveld 408576698