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

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

Issue 1713953002: Report errors in RTCPeerConnection legacy functions via the the failure callback instead of excepti… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix expected 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 , public WebRTCPeerConnectionHandlerClient 64 , public WebRTCPeerConnectionHandlerClient
65 , public ActiveDOMObject { 65 , public ActiveDOMObject {
66 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RTCPeerConnection); 66 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RTCPeerConnection);
67 DEFINE_WRAPPERTYPEINFO(); 67 DEFINE_WRAPPERTYPEINFO();
68 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection); 68 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection);
69 public: 69 public:
70 // 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.
71 static RTCPeerConnection* create(ExecutionContext*, const Dictionary&, const Dictionary&, ExceptionState&); 71 static RTCPeerConnection* create(ExecutionContext*, const Dictionary&, const Dictionary&, ExceptionState&);
72 ~RTCPeerConnection() override; 72 ~RTCPeerConnection() override;
73 73
74 void createOffer(ExecutionContext*, RTCSessionDescriptionCallback*, RTCError Callback*, const Dictionary&, ExceptionState&); 74 void createOffer(ExecutionContext*, RTCSessionDescriptionCallback*, RTCError Callback*, const Dictionary&);
75 75
76 void createAnswer(ExecutionContext*, RTCSessionDescriptionCallback*, RTCErro rCallback*, const Dictionary&, ExceptionState&); 76 void createAnswer(ExecutionContext*, RTCSessionDescriptionCallback*, RTCErro rCallback*, const Dictionary&);
77 77
78 ScriptPromise setLocalDescription(ScriptState*, const RTCSessionDescriptionI nit&); 78 ScriptPromise setLocalDescription(ScriptState*, const RTCSessionDescriptionI nit&);
79 ScriptPromise setLocalDescription(ScriptState*, RTCSessionDescription*, Void Callback*, RTCErrorCallback*); 79 ScriptPromise setLocalDescription(ScriptState*, RTCSessionDescription*, Void Callback*, RTCErrorCallback*);
80 RTCSessionDescription* localDescription(); 80 RTCSessionDescription* localDescription();
81 81
82 ScriptPromise setRemoteDescription(ScriptState*, const RTCSessionDescription Init&); 82 ScriptPromise setRemoteDescription(ScriptState*, const RTCSessionDescription Init&);
83 ScriptPromise setRemoteDescription(ScriptState*, RTCSessionDescription*, Voi dCallback*, RTCErrorCallback*); 83 ScriptPromise setRemoteDescription(ScriptState*, RTCSessionDescription*, Voi dCallback*, RTCErrorCallback*);
84 RTCSessionDescription* remoteDescription(); 84 RTCSessionDescription* remoteDescription();
85 85
86 String signalingState() const; 86 String signalingState() const;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 171
172 RefPtrWillBeMember<Event> m_event; 172 RefPtrWillBeMember<Event> m_event;
173 173
174 private: 174 private:
175 OwnPtr<BoolFunction> m_setupFunction; 175 OwnPtr<BoolFunction> m_setupFunction;
176 }; 176 };
177 177
178 RTCPeerConnection(ExecutionContext*, RTCConfiguration*, WebMediaConstraints, ExceptionState&); 178 RTCPeerConnection(ExecutionContext*, RTCConfiguration*, WebMediaConstraints, ExceptionState&);
179 179
180 static RTCConfiguration* parseConfiguration(const Dictionary&, ExceptionStat e&); 180 static RTCConfiguration* parseConfiguration(const Dictionary&, ExceptionStat e&);
181 static RTCOfferOptions* parseOfferOptions(const Dictionary&, ExceptionState& ); 181 static RTCOfferOptions* parseOfferOptions(const Dictionary&, RTCErrorCallbac k*, bool& hadError);
182 182
183 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); 183 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>);
184 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>, PassOwnPtr<BoolFun ction>); 184 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>, PassOwnPtr<BoolFun ction>);
185 void dispatchScheduledEvent(); 185 void dispatchScheduledEvent();
186 bool hasLocalStreamWithTrackId(const String& trackId); 186 bool hasLocalStreamWithTrackId(const String& trackId);
187 187
188 void changeSignalingState(WebRTCPeerConnectionHandlerClient::SignalingState) ; 188 void changeSignalingState(WebRTCPeerConnectionHandlerClient::SignalingState) ;
189 void changeIceGatheringState(WebRTCPeerConnectionHandlerClient::ICEGathering State); 189 void changeIceGatheringState(WebRTCPeerConnectionHandlerClient::ICEGathering State);
190 // Changes the state immediately; does not fire an event. 190 // Changes the state immediately; does not fire an event.
191 // Returns true if the state was changed. 191 // Returns true if the state was changed.
(...skipping 15 matching lines...) Expand all
207 Member<AsyncMethodRunner<RTCPeerConnection>> m_dispatchScheduledEventRunner; 207 Member<AsyncMethodRunner<RTCPeerConnection>> m_dispatchScheduledEventRunner;
208 HeapVector<Member<EventWrapper>> m_scheduledEvents; 208 HeapVector<Member<EventWrapper>> m_scheduledEvents;
209 209
210 bool m_stopped; 210 bool m_stopped;
211 bool m_closed; 211 bool m_closed;
212 }; 212 };
213 213
214 } // namespace blink 214 } // namespace blink
215 215
216 #endif // RTCPeerConnection_h 216 #endif // RTCPeerConnection_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698