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

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: rebase 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;
yhirano 2016/02/10 18:13:23 +class ScriptState;
Guido Urdaneta 2016/02/10 20:21:28 Done.
57 class VoidCallback; 59 class VoidCallback;
58 60
59 class RTCPeerConnection final 61 class RTCPeerConnection final
60 : public RefCountedGarbageCollectedEventTargetWithInlineData<RTCPeerConnecti on> 62 : public RefCountedGarbageCollectedEventTargetWithInlineData<RTCPeerConnecti on>
61 , public WebRTCPeerConnectionHandlerClient 63 , public WebRTCPeerConnectionHandlerClient
62 , public ActiveDOMObject { 64 , public ActiveDOMObject {
63 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RTCPeerConnection); 65 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RTCPeerConnection);
64 DEFINE_WRAPPERTYPEINFO(); 66 DEFINE_WRAPPERTYPEINFO();
65 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection); 67 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection);
66 public: 68 public:
67 // TODO(hbos): Create with expired RTCCertificate should fail, see crbug.com /565278. 69 // TODO(hbos): Create with expired RTCCertificate should fail, see crbug.com /565278.
68 static RTCPeerConnection* create(ExecutionContext*, const Dictionary&, const Dictionary&, ExceptionState&); 70 static RTCPeerConnection* create(ExecutionContext*, const Dictionary&, const Dictionary&, ExceptionState&);
69 ~RTCPeerConnection() override; 71 ~RTCPeerConnection() override;
70 72
71 void createOffer(ExecutionContext*, RTCSessionDescriptionCallback*, RTCError Callback*, const Dictionary&, ExceptionState&); 73 void createOffer(ExecutionContext*, RTCSessionDescriptionCallback*, RTCError Callback*, const Dictionary&, ExceptionState&);
72 74
73 void createAnswer(ExecutionContext*, RTCSessionDescriptionCallback*, RTCErro rCallback*, const Dictionary&, ExceptionState&); 75 void createAnswer(ExecutionContext*, RTCSessionDescriptionCallback*, RTCErro rCallback*, const Dictionary&, ExceptionState&);
74 76
75 void setLocalDescription(ExecutionContext*, RTCSessionDescription*, VoidCall back*, RTCErrorCallback*, ExceptionState&); 77 ScriptPromise setLocalDescription(ScriptState*, const RTCSessionDescriptionI nit&);
78 ScriptPromise setLocalDescription(ExecutionContext*, RTCSessionDescription*, VoidCallback*, RTCErrorCallback*);
76 RTCSessionDescription* localDescription(); 79 RTCSessionDescription* localDescription();
77 80
78 void setRemoteDescription(ExecutionContext*, RTCSessionDescription*, VoidCal lback*, RTCErrorCallback*, ExceptionState&); 81 ScriptPromise setRemoteDescription(ScriptState*, const RTCSessionDescription Init&);
82 ScriptPromise setRemoteDescription(ExecutionContext*, RTCSessionDescription* , VoidCallback*, RTCErrorCallback*);
79 RTCSessionDescription* remoteDescription(); 83 RTCSessionDescription* remoteDescription();
80 84
81 String signalingState() const; 85 String signalingState() const;
82 86
83 void updateIce(ExecutionContext*, const Dictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionState&); 87 void updateIce(ExecutionContext*, const Dictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionState&);
84 88
85 // Certificate management 89 // Certificate management
86 // http://w3c.github.io/webrtc-pc/#sec.cert-mgmt 90 // http://w3c.github.io/webrtc-pc/#sec.cert-mgmt
87 static ScriptPromise generateCertificate(ScriptState*, const AlgorithmIdenti fier& keygenAlgorithm, ExceptionState&); 91 static ScriptPromise generateCertificate(ScriptState*, const AlgorithmIdenti fier& keygenAlgorithm, ExceptionState&);
88 92
89 // DEPRECATED 93 ScriptPromise addIceCandidate(ScriptState*, const RTCIceCandidateInitOrRTCIc eCandidate&);
90 void addIceCandidate(RTCIceCandidate*, ExceptionState&); 94 ScriptPromise addIceCandidate(RTCIceCandidate*, VoidCallback*, RTCErrorCallb ack*);
91
92 void addIceCandidate(RTCIceCandidate*, VoidCallback*, RTCErrorCallback*, Exc eptionState&);
93 95
94 String iceGatheringState() const; 96 String iceGatheringState() const;
95 97
96 String iceConnectionState() const; 98 String iceConnectionState() const;
97 99
98 MediaStreamVector getLocalStreams() const; 100 MediaStreamVector getLocalStreams() const;
99 101
100 MediaStreamVector getRemoteStreams() const; 102 MediaStreamVector getRemoteStreams() const;
101 103
102 MediaStream* getStreamById(const String& streamId); 104 MediaStream* getStreamById(const String& streamId);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 Member<AsyncMethodRunner<RTCPeerConnection>> m_dispatchScheduledEventRunner; 206 Member<AsyncMethodRunner<RTCPeerConnection>> m_dispatchScheduledEventRunner;
205 HeapVector<Member<EventWrapper>> m_scheduledEvents; 207 HeapVector<Member<EventWrapper>> m_scheduledEvents;
206 208
207 bool m_stopped; 209 bool m_stopped;
208 bool m_closed; 210 bool m_closed;
209 }; 211 };
210 212
211 } // namespace blink 213 } // namespace blink
212 214
213 #endif // RTCPeerConnection_h 215 #endif // RTCPeerConnection_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698