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

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: Added comments 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0edbdb75fb472e410c3ef4ce8a56e157773ba90f 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,36 @@ 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;
haraken 2015/12/17 03:03:20 This is wrong even on non-oilpan... This must be a
+ };
+
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);
+ // Changes the state immediately; does not fire an event.
+ // Returns true if the state was changed.
+ bool setIceConnectionState(WebRTCPeerConnectionHandlerClient::ICEConnectionState);
+ // Changes the state asynchronously and fires an event immediately after changing the state.
void changeIceConnectionState(WebRTCPeerConnectionHandlerClient::ICEConnectionState);
void closeInternal();
@@ -183,7 +201,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;
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698