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

Unified Diff: third_party/WebKit/Source/core/dom/MessagePort.cpp

Issue 1922923003: Have MessagePort use Oilpan-based weak pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/dom/MessagePort.cpp
diff --git a/third_party/WebKit/Source/core/dom/MessagePort.cpp b/third_party/WebKit/Source/core/dom/MessagePort.cpp
index 155592f3286587353d75ab2823731857359c1944..94fb61b9e220874153fac78f8ead1f3659f41885 100644
--- a/third_party/WebKit/Source/core/dom/MessagePort.cpp
+++ b/third_party/WebKit/Source/core/dom/MessagePort.cpp
@@ -55,7 +55,6 @@ MessagePort::MessagePort(ExecutionContext& executionContext)
, ActiveDOMObject(&executionContext)
, m_started(false)
, m_closed(false)
- , m_weakFactory(this)
{
}
@@ -73,7 +72,6 @@ void MessagePort::postMessage(ExecutionContext* context, PassRefPtr<SerializedSc
DCHECK(getExecutionContext());
DCHECK(m_entangledChannel);
- OwnPtr<MessagePortChannelArray> channels;
// Make sure we aren't connected to any of the passed-in ports.
for (unsigned i = 0; i < ports.size(); ++i) {
if (ports[i] == this) {
@@ -81,7 +79,7 @@ void MessagePort::postMessage(ExecutionContext* context, PassRefPtr<SerializedSc
return;
}
}
- channels = MessagePort::disentanglePorts(context, ports, exceptionState);
+ OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(context, ports, exceptionState);
if (exceptionState.hadException())
return;
@@ -126,7 +124,7 @@ PassOwnPtr<WebMessagePortChannel> MessagePort::disentangle()
void MessagePort::messageAvailable()
{
DCHECK(getExecutionContext());
- getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&MessagePort::dispatchMessages, m_weakFactory.createWeakPtr()));
+ getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&MessagePort::dispatchMessages, CrossThreadWeakPersistentThisPointer<MessagePort>(this)));
}
void MessagePort::start()

Powered by Google App Engine
This is Rietveld 408576698