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

Side by Side Diff: webrtc/pc/peerconnection.cc

Issue 2692723002: Adding RTCErrorOr class to be used by ORTC APIs. (Closed)
Patch Set: Changing "CreateAndLogError" to a macro. Created 3 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 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 if (error) { 451 if (error) {
452 error->set_type(type); 452 error->set_type(type);
453 } 453 }
454 return type == webrtc::RTCErrorType::NONE; 454 return type == webrtc::RTCErrorType::NONE;
455 } 455 }
456 456
457 } // namespace 457 } // namespace
458 458
459 namespace webrtc { 459 namespace webrtc {
460 460
461 static const char* const kRTCErrorTypeNames[] = {
462 "NONE",
463 "UNSUPPORTED_PARAMETER",
464 "INVALID_PARAMETER",
465 "INVALID_RANGE",
466 "SYNTAX_ERROR",
467 "INVALID_STATE",
468 "INVALID_MODIFICATION",
469 "NETWORK_ERROR",
470 "INTERNAL_ERROR",
471 };
472 static_assert(static_cast<int>(RTCErrorType::INTERNAL_ERROR) ==
473 (arraysize(kRTCErrorTypeNames) - 1),
474 "kRTCErrorTypeNames must have as many strings as RTCErrorType "
475 "has values.");
476
477 std::ostream& operator<<(std::ostream& stream, RTCErrorType error) {
478 int index = static_cast<int>(error);
479 return stream << kRTCErrorTypeNames[index];
480 }
481
482 bool PeerConnectionInterface::RTCConfiguration::operator==( 461 bool PeerConnectionInterface::RTCConfiguration::operator==(
483 const PeerConnectionInterface::RTCConfiguration& o) const { 462 const PeerConnectionInterface::RTCConfiguration& o) const {
484 // This static_assert prevents us from accidentally breaking operator==. 463 // This static_assert prevents us from accidentally breaking operator==.
485 struct stuff_being_tested_for_equality { 464 struct stuff_being_tested_for_equality {
486 IceTransportsType type; 465 IceTransportsType type;
487 IceServers servers; 466 IceServers servers;
488 BundlePolicy bundle_policy; 467 BundlePolicy bundle_policy;
489 RtcpMuxPolicy rtcp_mux_policy; 468 RtcpMuxPolicy rtcp_mux_policy;
490 TcpCandidatePolicy tcp_candidate_policy; 469 TcpCandidatePolicy tcp_candidate_policy;
491 CandidateNetworkPolicy candidate_network_policy; 470 CandidateNetworkPolicy candidate_network_policy;
(...skipping 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after
2579 } 2558 }
2580 return event_log_->StartLogging(file, max_size_bytes); 2559 return event_log_->StartLogging(file, max_size_bytes);
2581 } 2560 }
2582 2561
2583 void PeerConnection::StopRtcEventLog_w() { 2562 void PeerConnection::StopRtcEventLog_w() {
2584 if (event_log_) { 2563 if (event_log_) {
2585 event_log_->StopLogging(); 2564 event_log_->StopLogging();
2586 } 2565 }
2587 } 2566 }
2588 } // namespace webrtc 2567 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698