| Index: Source/modules/mediastream/RTCPeerConnection.h
|
| diff --git a/Source/modules/mediastream/RTCPeerConnection.h b/Source/modules/mediastream/RTCPeerConnection.h
|
| index 03c6137400bfefde3f731e99e64024106e89e41d..a5de70933aa69e18efeca99b0ea9e1ece5940ecd 100644
|
| --- a/Source/modules/mediastream/RTCPeerConnection.h
|
| +++ b/Source/modules/mediastream/RTCPeerConnection.h
|
| @@ -104,6 +104,10 @@ public:
|
|
|
| void close(ExceptionState&);
|
|
|
| + // We allow getStats after close, but not other calls or callbacks.
|
| + bool requestMayFireNonStatsCallback() { return !m_closed && !m_stopped; }
|
| + bool requestMayFireStatsCallback() { return !m_stopped; }
|
| +
|
| DEFINE_ATTRIBUTE_EVENT_LISTENER(negotiationneeded);
|
| DEFINE_ATTRIBUTE_EVENT_LISTENER(icecandidate);
|
| DEFINE_ATTRIBUTE_EVENT_LISTENER(signalingstatechange);
|
| @@ -131,7 +135,20 @@ public:
|
| virtual void suspend() OVERRIDE;
|
| virtual void resume() OVERRIDE;
|
| virtual void stop() OVERRIDE;
|
| - virtual bool hasPendingActivity() const OVERRIDE { return !m_stopped; }
|
| + // We require a call to close() or stop() before the object can be garbage
|
| + // collected. In close(), stop() is called on |m_peer_handler|, after which
|
| + // no events are fired on this object
|
| + // (blink::WebRTCPeerConnectionHandlerClient interface). In stop(),
|
| + // |m_peer_handler| is deleted. Note that async operations such as
|
| + // createOffer or getStats doesn't respond through this object, but through
|
| + // a request object containing the callback. The request object is handed to
|
| + // the client. Hence, we don't need to keep track of if there are still
|
| + // outstandning requests. The request is given a pointer to this object and
|
| + // checks if it should fire the callback before doing so.
|
| + virtual bool hasPendingActivity() const OVERRIDE
|
| + {
|
| + return !m_closed && !m_stopped;
|
| + }
|
|
|
| virtual void trace(Visitor*) OVERRIDE;
|
|
|
| @@ -161,7 +178,12 @@ private:
|
| AsyncMethodRunner<RTCPeerConnection> m_dispatchScheduledEventRunner;
|
| WillBeHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents;
|
|
|
| +#if !ENABLE(OILPAN)
|
| + WeakPtrFactory<RTCPeerConnection> m_weakPtrFactory;
|
| +#endif
|
| +
|
| bool m_stopped;
|
| + bool m_closed;
|
| };
|
|
|
| } // namespace WebCore
|
|
|