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

Side by Side 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: Fix code review issues found by Wei. Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 #include "content/renderer/media/mock_web_rtc_peer_connection_handler_client.h"
5
6 #include "base/logging.h"
7 #include "base/utf_string_conversions.h"
8 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebICECandid ateDescriptor.h"
9 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre amDescriptor.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
11
12 namespace WebKit {
13
14 MockWebRTCPeerConnectionHandlerClient::
15 MockWebRTCPeerConnectionHandlerClient()
16 : renegotiate_(false),
17 ready_state_(ReadyStateNew),
18 ice_state_(ICEStateNew),
19 candidate_mline_index_(-1) {
20 }
21
22 MockWebRTCPeerConnectionHandlerClient::
23 ~MockWebRTCPeerConnectionHandlerClient() {}
24
25 void MockWebRTCPeerConnectionHandlerClient::doRenegotiate() {
26 renegotiate_ = true;
27 }
28
29 void MockWebRTCPeerConnectionHandlerClient::didGenerateICECandidate(
30 const WebRTCICECandidateDescriptor& candidate) {
31 if (!candidate.isNull()) {
32 candidate_sdp_ = UTF16ToUTF8(candidate.candidate());
33 candidate_mline_index_ = candidate.sdpMLineIndex();
34 candidate_mid_ = UTF16ToUTF8(candidate.sdpMid());
35 } else {
36 candidate_sdp_ = "";
37 candidate_mline_index_ = 0;
Ronghua Wu (Left Chromium) 2012/08/14 00:59:03 -1? 0 is a valid value.
perkj_chrome 2012/08/14 09:15:40 Done.
38 candidate_mid_ = "";
39 }
40 }
41
42 void MockWebRTCPeerConnectionHandlerClient::didChangeReadyState(
43 ReadyState state) {
44 ready_state_ = state;
45 }
46
47 void MockWebRTCPeerConnectionHandlerClient::didChangeICEState(ICEState state) {
48 ice_state_ = state;
49 }
50
51 void MockWebRTCPeerConnectionHandlerClient::didAddRemoteStream(
52 const WebMediaStreamDescriptor& stream_descriptor) {
53 stream_label_ = UTF16ToUTF8(stream_descriptor.label());
54 }
55
56 void MockWebRTCPeerConnectionHandlerClient::didRemoveRemoteStream(
57 const WebMediaStreamDescriptor& stream_descriptor) {
58 DCHECK(stream_label_ == UTF16ToUTF8(stream_descriptor.label()));
59 stream_label_.clear();
60 }
61
62 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698