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

Side by Side Diff: content/renderer/media/rtc_data_channel_handler.cc

Issue 121033002: Update uses of UTF conversions in content/ to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/rtc_data_channel_handler.h" 5 #include "content/renderer/media/rtc_data_channel_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 12 matching lines...) Expand all
23 DVLOG(1) << "::dtor"; 23 DVLOG(1) << "::dtor";
24 channel_->UnregisterObserver(); 24 channel_->UnregisterObserver();
25 } 25 }
26 26
27 void RtcDataChannelHandler::setClient( 27 void RtcDataChannelHandler::setClient(
28 blink::WebRTCDataChannelHandlerClient* client) { 28 blink::WebRTCDataChannelHandlerClient* client) {
29 webkit_client_ = client; 29 webkit_client_ = client;
30 } 30 }
31 31
32 blink::WebString RtcDataChannelHandler::label() { 32 blink::WebString RtcDataChannelHandler::label() {
33 return UTF8ToUTF16(channel_->label()); 33 return base::UTF8ToUTF16(channel_->label());
34 } 34 }
35 35
36 bool RtcDataChannelHandler::isReliable() { 36 bool RtcDataChannelHandler::isReliable() {
37 return channel_->reliable(); 37 return channel_->reliable();
38 } 38 }
39 39
40 bool RtcDataChannelHandler::ordered() const { 40 bool RtcDataChannelHandler::ordered() const {
41 return channel_->ordered(); 41 return channel_->ordered();
42 } 42 }
43 43
44 unsigned short RtcDataChannelHandler::maxRetransmitTime() const { 44 unsigned short RtcDataChannelHandler::maxRetransmitTime() const {
45 return channel_->maxRetransmitTime(); 45 return channel_->maxRetransmitTime();
46 } 46 }
47 47
48 unsigned short RtcDataChannelHandler::maxRetransmits() const { 48 unsigned short RtcDataChannelHandler::maxRetransmits() const {
49 return channel_->maxRetransmits(); 49 return channel_->maxRetransmits();
50 } 50 }
51 51
52 blink::WebString RtcDataChannelHandler::protocol() const { 52 blink::WebString RtcDataChannelHandler::protocol() const {
53 return UTF8ToUTF16(channel_->protocol()); 53 return base::UTF8ToUTF16(channel_->protocol());
54 } 54 }
55 55
56 bool RtcDataChannelHandler::negotiated() const { 56 bool RtcDataChannelHandler::negotiated() const {
57 return channel_->negotiated(); 57 return channel_->negotiated();
58 } 58 }
59 59
60 unsigned short RtcDataChannelHandler::id() const { 60 unsigned short RtcDataChannelHandler::id() const {
61 return channel_->id(); 61 return channel_->id();
62 } 62 }
63 63
64 unsigned long RtcDataChannelHandler::bufferedAmount() { 64 unsigned long RtcDataChannelHandler::bufferedAmount() {
65 return channel_->buffered_amount(); 65 return channel_->buffered_amount();
66 } 66 }
67 67
68 bool RtcDataChannelHandler::sendStringData(const blink::WebString& data) { 68 bool RtcDataChannelHandler::sendStringData(const blink::WebString& data) {
69 std::string utf8_buffer = UTF16ToUTF8(data); 69 std::string utf8_buffer = base::UTF16ToUTF8(data);
70 talk_base::Buffer buffer(utf8_buffer.c_str(), utf8_buffer.length()); 70 talk_base::Buffer buffer(utf8_buffer.c_str(), utf8_buffer.length());
71 webrtc::DataBuffer data_buffer(buffer, false); 71 webrtc::DataBuffer data_buffer(buffer, false);
72 return channel_->Send(data_buffer); 72 return channel_->Send(data_buffer);
73 } 73 }
74 74
75 bool RtcDataChannelHandler::sendRawData(const char* data, size_t length) { 75 bool RtcDataChannelHandler::sendRawData(const char* data, size_t length) {
76 talk_base::Buffer buffer(data, length); 76 talk_base::Buffer buffer(data, length);
77 webrtc::DataBuffer data_buffer(buffer, true); 77 webrtc::DataBuffer data_buffer(buffer, true);
78 return channel_->Send(data_buffer); 78 return channel_->Send(data_buffer);
79 } 79 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 void RtcDataChannelHandler::OnMessage(const webrtc::DataBuffer& buffer) { 114 void RtcDataChannelHandler::OnMessage(const webrtc::DataBuffer& buffer) {
115 if (!webkit_client_) { 115 if (!webkit_client_) {
116 LOG(ERROR) << "WebRTCDataChannelHandlerClient not set."; 116 LOG(ERROR) << "WebRTCDataChannelHandlerClient not set.";
117 return; 117 return;
118 } 118 }
119 119
120 if (buffer.binary) { 120 if (buffer.binary) {
121 webkit_client_->didReceiveRawData(buffer.data.data(), buffer.data.length()); 121 webkit_client_->didReceiveRawData(buffer.data.data(), buffer.data.length());
122 } else { 122 } else {
123 base::string16 utf16; 123 base::string16 utf16;
124 if (!UTF8ToUTF16(buffer.data.data(), buffer.data.length(), &utf16)) { 124 if (!base::UTF8ToUTF16(buffer.data.data(), buffer.data.length(), &utf16)) {
125 LOG(ERROR) << "Failed convert received data to UTF16"; 125 LOG(ERROR) << "Failed convert received data to UTF16";
126 return; 126 return;
127 } 127 }
128 webkit_client_->didReceiveStringData(utf16); 128 webkit_client_->didReceiveStringData(utf16);
129 } 129 }
130 } 130 }
131 131
132 } // namespace content 132 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/remote_media_stream_impl.cc ('k') | content/renderer/media/rtc_dtmf_sender_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698