| Index: third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
|
| diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
|
| index b77dd2f8ae5540744ef64cc33e49bd450fbe26e6..8bfd9bc601afb519021353d4d1e58b50ff8a0a77 100644
|
| --- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
|
| +++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
|
| @@ -413,6 +413,7 @@ RTCPeerConnection::RTCPeerConnection(ExecutionContext* context, RTCConfiguration
|
| , m_stopped(false)
|
| , m_closed(false)
|
| {
|
| + ThreadState::current()->registerPreFinalizer(this);
|
| Document* document = toDocument(getExecutionContext());
|
|
|
| // If we fail, set |m_closed| and |m_stopped| to true, to avoid hitting the assert in the destructor.
|
| @@ -449,6 +450,13 @@ RTCPeerConnection::~RTCPeerConnection()
|
| DCHECK(m_closed || m_stopped);
|
| }
|
|
|
| +void RTCPeerConnection::dispose()
|
| +{
|
| + // Promptly clears a raw reference from content/ to an on-heap object
|
| + // so that content/ doesn't access it in a lazy sweeping phase.
|
| + m_peerHandler.clear();
|
| +}
|
| +
|
| ScriptPromise RTCPeerConnection::createOffer(ScriptState* scriptState, const RTCOfferOptions& options)
|
| {
|
| if (m_signalingState == SignalingStateClosed)
|
|
|