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

Side by Side Diff: third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h

Issue 1661493002: Add promise-based addIceCandidate, setLocalDescription and setRemoteDescription to RTCPeerConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: philipj's comments on tests Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "public/platform/WebRTCPeerConnectionHandler.h" 43 #include "public/platform/WebRTCPeerConnectionHandler.h"
44 #include "public/platform/WebRTCPeerConnectionHandlerClient.h" 44 #include "public/platform/WebRTCPeerConnectionHandlerClient.h"
45 45
46 namespace blink { 46 namespace blink {
47 class ExceptionState; 47 class ExceptionState;
48 class MediaStreamTrack; 48 class MediaStreamTrack;
49 class RTCConfiguration; 49 class RTCConfiguration;
50 class RTCDTMFSender; 50 class RTCDTMFSender;
51 class RTCDataChannel; 51 class RTCDataChannel;
52 class RTCErrorCallback; 52 class RTCErrorCallback;
53 class RTCIceCandidateInitOrRTCIceCandidate;
53 class RTCOfferOptions; 54 class RTCOfferOptions;
54 class RTCSessionDescription; 55 class RTCSessionDescription;
55 class RTCSessionDescriptionCallback; 56 class RTCSessionDescriptionCallback;
57 class RTCSessionDescriptionInit;
56 class RTCStatsCallback; 58 class RTCStatsCallback;
59 class ScriptState;
57 class VoidCallback; 60 class VoidCallback;
58 61
59 class RTCPeerConnection final 62 class RTCPeerConnection final
60 : public RefCountedGarbageCollectedEventTargetWithInlineData<RTCPeerConnecti on> 63 : public RefCountedGarbageCollectedEventTargetWithInlineData<RTCPeerConnecti on>
61 , public WebRTCPeerConnectionHandlerClient 64 , public WebRTCPeerConnectionHandlerClient
62 , public ActiveDOMObject { 65 , public ActiveDOMObject {
63 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RTCPeerConnection); 66 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RTCPeerConnection);
64 DEFINE_WRAPPERTYPEINFO(); 67 DEFINE_WRAPPERTYPEINFO();
65 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection); 68 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection);
66 public: 69 public:
67 // TODO(hbos): Create with expired RTCCertificate should fail, see crbug.com /565278. 70 // TODO(hbos): Create with expired RTCCertificate should fail, see crbug.com /565278.
68 static RTCPeerConnection* create(ExecutionContext*, const Dictionary&, const Dictionary&, ExceptionState&); 71 static RTCPeerConnection* create(ExecutionContext*, const Dictionary&, const Dictionary&, ExceptionState&);
69 ~RTCPeerConnection() override; 72 ~RTCPeerConnection() override;
70 73
71 void createOffer(ExecutionContext*, RTCSessionDescriptionCallback*, RTCError Callback*, const Dictionary&, ExceptionState&); 74 void createOffer(ExecutionContext*, RTCSessionDescriptionCallback*, RTCError Callback*, const Dictionary&, ExceptionState&);
72 75
73 void createAnswer(ExecutionContext*, RTCSessionDescriptionCallback*, RTCErro rCallback*, const Dictionary&, ExceptionState&); 76 void createAnswer(ExecutionContext*, RTCSessionDescriptionCallback*, RTCErro rCallback*, const Dictionary&, ExceptionState&);
74 77
75 void setLocalDescription(ExecutionContext*, RTCSessionDescription*, VoidCall back*, RTCErrorCallback*, ExceptionState&); 78 ScriptPromise setLocalDescription(ScriptState*, const RTCSessionDescriptionI nit&);
79 ScriptPromise setLocalDescription(ScriptState*, RTCSessionDescription*, Void Callback*, RTCErrorCallback*);
76 RTCSessionDescription* localDescription(); 80 RTCSessionDescription* localDescription();
77 81
78 void setRemoteDescription(ExecutionContext*, RTCSessionDescription*, VoidCal lback*, RTCErrorCallback*, ExceptionState&); 82 ScriptPromise setRemoteDescription(ScriptState*, const RTCSessionDescription Init&);
83 ScriptPromise setRemoteDescription(ScriptState*, RTCSessionDescription*, Voi dCallback*, RTCErrorCallback*);
79 RTCSessionDescription* remoteDescription(); 84 RTCSessionDescription* remoteDescription();
80 85
81 String signalingState() const; 86 String signalingState() const;
82 87
83 void updateIce(ExecutionContext*, const Dictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionState&); 88 void updateIce(ExecutionContext*, const Dictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionState&);
84 89
85 // Certificate management 90 // Certificate management
86 // http://w3c.github.io/webrtc-pc/#sec.cert-mgmt 91 // http://w3c.github.io/webrtc-pc/#sec.cert-mgmt
87 static ScriptPromise generateCertificate(ScriptState*, const AlgorithmIdenti fier& keygenAlgorithm, ExceptionState&); 92 static ScriptPromise generateCertificate(ScriptState*, const AlgorithmIdenti fier& keygenAlgorithm, ExceptionState&);
88 93
89 // DEPRECATED 94 ScriptPromise addIceCandidate(ScriptState*, const RTCIceCandidateInitOrRTCIc eCandidate&);
90 void addIceCandidate(RTCIceCandidate*, ExceptionState&); 95 ScriptPromise addIceCandidate(ScriptState*, RTCIceCandidate*, VoidCallback*, RTCErrorCallback*);
91
92 void addIceCandidate(RTCIceCandidate*, VoidCallback*, RTCErrorCallback*, Exc eptionState&);
93 96
94 String iceGatheringState() const; 97 String iceGatheringState() const;
95 98
96 String iceConnectionState() const; 99 String iceConnectionState() const;
97 100
98 MediaStreamVector getLocalStreams() const; 101 MediaStreamVector getLocalStreams() const;
99 102
100 MediaStreamVector getRemoteStreams() const; 103 MediaStreamVector getRemoteStreams() const;
101 104
102 MediaStream* getStreamById(const String& streamId); 105 MediaStream* getStreamById(const String& streamId);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 Member<AsyncMethodRunner<RTCPeerConnection>> m_dispatchScheduledEventRunner; 207 Member<AsyncMethodRunner<RTCPeerConnection>> m_dispatchScheduledEventRunner;
205 HeapVector<Member<EventWrapper>> m_scheduledEvents; 208 HeapVector<Member<EventWrapper>> m_scheduledEvents;
206 209
207 bool m_stopped; 210 bool m_stopped;
208 bool m_closed; 211 bool m_closed;
209 }; 212 };
210 213
211 } // namespace blink 214 } // namespace blink
212 215
213 #endif // RTCPeerConnection_h 216 #endif // RTCPeerConnection_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698