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

Unified Diff: third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h

Issue 1523213002: Make sure peer connection states are updated properly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/modules/mediastream/RTCPeerConnection.h
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h
index ddbd951d8745f936f3cf9ef2f0df4d6c26404ca1..f6c664c586a656453e91ef44292955de7eede101 100644
--- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h
+++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h
@@ -44,7 +44,6 @@
#include "public/platform/WebRTCPeerConnectionHandlerClient.h"
namespace blink {
-
class ExceptionState;
class MediaStreamTrack;
class RTCConfiguration;
@@ -156,17 +155,33 @@ public:
DECLARE_VIRTUAL_TRACE();
private:
+ typedef Function<bool()> BoolFunction;
+ class EventWrapper {
+ public:
+ EventWrapper(PassRefPtrWillBeRawPtr<Event>, PassOwnPtrWillBeRawPtr<BoolFunction>);
+ // Returns true if |m_setupFunction| returns true or it is null.
+ // |m_event| will only be fired if setup() returns true;
+ bool setup();
+
+ RefPtrWillBeMember<Event> m_event;
+
+ private:
+ PassOwnPtrWillBeRawPtr<BoolFunction> m_setupFunction;
+ };
+
RTCPeerConnection(ExecutionContext*, RTCConfiguration*, WebMediaConstraints, ExceptionState&);
static RTCConfiguration* parseConfiguration(const Dictionary&, ExceptionState&);
static RTCOfferOptions* parseOfferOptions(const Dictionary&, ExceptionState&);
void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>);
+ void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>, PassOwnPtrWillBeRawPtr<BoolFunction>);
void dispatchScheduledEvent();
bool hasLocalStreamWithTrackId(const String& trackId);
void changeSignalingState(WebRTCPeerConnectionHandlerClient::SignalingState);
void changeIceGatheringState(WebRTCPeerConnectionHandlerClient::ICEGatheringState);
+ bool setIceConnectionState(WebRTCPeerConnectionHandlerClient::ICEConnectionState);
pthatcher2 2015/12/15 23:59:20 Can you leave a comment saying something like "set
honghaiz 2015/12/16 00:21:01 Done.
void changeIceConnectionState(WebRTCPeerConnectionHandlerClient::ICEConnectionState);
void closeInternal();
@@ -183,7 +198,7 @@ private:
OwnPtr<WebRTCPeerConnectionHandler> m_peerHandler;
AsyncMethodRunner<RTCPeerConnection> m_dispatchScheduledEventRunner;
- WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents;
+ WillBeHeapVector<EventWrapper> m_scheduledEvents;
bool m_stopped;
bool m_closed;

Powered by Google App Engine
This is Rietveld 408576698