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

Side by Side Diff: webrtc/api/peerconnectioninterface.h

Issue 2564683002: Adding error enum to be used by PeerConnectionInterface methods. (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 virtual void AddHistogramSample(PeerConnectionMetricsName type, 134 virtual void AddHistogramSample(PeerConnectionMetricsName type,
135 int value) = 0; 135 int value) = 0;
136 136
137 protected: 137 protected:
138 virtual ~MetricsObserverInterface() {} 138 virtual ~MetricsObserverInterface() {}
139 }; 139 };
140 140
141 typedef MetricsObserverInterface UMAObserver; 141 typedef MetricsObserverInterface UMAObserver;
142 142
143 // Enumeration to represent distinct classes of errors that an application
144 // may wish to act upon differently. These roughly map to DOMExceptions in
145 // the web API, as described in the comments below.
146 enum class RtcError {
hta-webrtc 2016/12/09 10:13:16 Almost every time I've had an error enum, there's
Taylor Brandstetter 2016/12/09 18:39:07 Ah yes, we do need that. Would have realized the f
147 // A supplied parameter is valid, but currently unsupported.
148 // Maps to InvalidAccessError DOMException.
149 UNSUPPORTED_PARAMETER,
hta-webrtc 2016/12/09 10:13:16 Why the ALL_CAPS_YELLING_NAMES? https://google.gi
Taylor Brandstetter 2016/12/09 18:39:07 The Chromium guide says to use this style, and I t
pthatcher1 2016/12/10 02:14:44 Yeah, we just had that discussion back in June.
150 // General error indicating that a supplied parameter is invalid.
151 // Maps to InvalidAccessError or TypeError DOMException depending on context.
152 INVALID_PARAMETER,
153 // Slightly more specific than INVALID_PARAMETER; a parameter's value was
154 // outside the allowed range.
155 // Maps to RangeError DOMException.
156 INVALID_RANGE,
157 // Slightly more specific than INVALID_PARAMETER; an error occurred while
158 // parsing string input.
159 // Maps to SyntaxError DOMException.
160 SYNTAX_ERROR,
161 // The object does not support this operation in its current state.
162 // Maps to InvalidStateError DOMException.
163 INVALID_STATE,
164 // An attempt was made to modify the object in an invalid way.
165 // Maps to InvalidModificationError DOMException.
166 INVALID_MODIFICATION,
167 // An error occurred within an underlying network protocol.
168 // Maps to NetworkError DOMException.
169 NETWORK_ERROR,
170 // The operation failed due to an internal error.
171 // Maps to OperationError DOMException.
172 INTERNAL_ERROR,
173 };
174
hta-webrtc 2016/12/09 10:13:16 I've found it wise to add an ostream& operator<< (
Taylor Brandstetter 2016/12/09 18:39:07 Done.
143 class PeerConnectionInterface : public rtc::RefCountInterface { 175 class PeerConnectionInterface : public rtc::RefCountInterface {
144 public: 176 public:
145 // See http://dev.w3.org/2011/webrtc/editor/webrtc.html#state-definitions . 177 // See http://dev.w3.org/2011/webrtc/editor/webrtc.html#state-definitions .
146 enum SignalingState { 178 enum SignalingState {
147 kStable, 179 kStable,
148 kHaveLocalOffer, 180 kHaveLocalOffer,
149 kHaveLocalPrAnswer, 181 kHaveLocalPrAnswer,
150 kHaveRemoteOffer, 182 kHaveRemoteOffer,
151 kHaveRemotePrAnswer, 183 kHaveRemotePrAnswer,
152 kClosed, 184 kClosed,
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 cricket::WebRtcVideoEncoderFactory* encoder_factory, 801 cricket::WebRtcVideoEncoderFactory* encoder_factory,
770 cricket::WebRtcVideoDecoderFactory* decoder_factory) { 802 cricket::WebRtcVideoDecoderFactory* decoder_factory) {
771 return CreatePeerConnectionFactory( 803 return CreatePeerConnectionFactory(
772 worker_and_network_thread, worker_and_network_thread, signaling_thread, 804 worker_and_network_thread, worker_and_network_thread, signaling_thread,
773 default_adm, encoder_factory, decoder_factory); 805 default_adm, encoder_factory, decoder_factory);
774 } 806 }
775 807
776 } // namespace webrtc 808 } // namespace webrtc
777 809
778 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ 810 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698