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

Unified Diff: content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc

Issue 10703095: New PeerConnection handler in Chrome to support latest PeerConnection draft (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Readd the UMA histogram for Deprecated PeerConnection to not screw up the stats. Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc
diff --git a/content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc b/content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc
new file mode 100644
index 0000000000000000000000000000000000000000..18fddfdd22fab35992feaf4caef6e69935478234
--- /dev/null
+++ b/content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc
@@ -0,0 +1,62 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#include "content/renderer/media/mock_web_rtc_peer_connection_handler_client.h"
+
+#include "base/logging.h"
+#include "base/utf_string_conversions.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebICECandidateDescriptor.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStreamDescriptor.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
+
+namespace WebKit {
+
+MockWebRTCPeerConnectionHandlerClient::
+MockWebRTCPeerConnectionHandlerClient()
+ : renegotiate_(false),
+ ready_state_(ReadyStateNew),
+ ice_state_(ICEStateNew),
+ candidate_mline_index_(-1) {
+}
+
+MockWebRTCPeerConnectionHandlerClient::
+~MockWebRTCPeerConnectionHandlerClient() {}
+
+void MockWebRTCPeerConnectionHandlerClient::negotiationNeeded() {
+ renegotiate_ = true;
+}
+
+void MockWebRTCPeerConnectionHandlerClient::didGenerateICECandidate(
+ const WebRTCICECandidate& candidate) {
+ if (!candidate.isNull()) {
+ candidate_sdp_ = UTF16ToUTF8(candidate.candidate());
+ candidate_mline_index_ = candidate.sdpMLineIndex();
+ candidate_mid_ = UTF16ToUTF8(candidate.sdpMid());
+ } else {
+ candidate_sdp_ = "";
+ candidate_mline_index_ = -1;
+ candidate_mid_ = "";
+ }
+}
+
+void MockWebRTCPeerConnectionHandlerClient::didChangeReadyState(
+ ReadyState state) {
+ ready_state_ = state;
+}
+
+void MockWebRTCPeerConnectionHandlerClient::didChangeICEState(ICEState state) {
+ ice_state_ = state;
+}
+
+void MockWebRTCPeerConnectionHandlerClient::didAddRemoteStream(
+ const WebMediaStreamDescriptor& stream_descriptor) {
+ stream_label_ = UTF16ToUTF8(stream_descriptor.label());
+}
+
+void MockWebRTCPeerConnectionHandlerClient::didRemoveRemoteStream(
+ const WebMediaStreamDescriptor& stream_descriptor) {
+ DCHECK(stream_label_ == UTF16ToUTF8(stream_descriptor.label()));
+ stream_label_.clear();
+}
+
+} // namespace WebKit

Powered by Google App Engine
This is Rietveld 408576698