Commit 031bfa42 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Switch RtcDataChannel away from WebString

... and use WTF::String instead.

BUG=78725
R=guidou@chromium.org, haraken@chromium.org

Change-Id: I24b5c1c5cee12c82f9ab5f57caccaed502f1336e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1882131
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712050}
parent bd653237
...@@ -249,7 +249,7 @@ RTCDataChannel::~RTCDataChannel() = default; ...@@ -249,7 +249,7 @@ RTCDataChannel::~RTCDataChannel() = default;
String RTCDataChannel::label() const { String RTCDataChannel::label() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return WebString::FromUTF8(channel()->label()); return String::FromUTF8(channel()->label());
} }
bool RTCDataChannel::reliable() const { bool RTCDataChannel::reliable() const {
...@@ -284,7 +284,7 @@ uint16_t RTCDataChannel::maxRetransmits(bool& is_null) const { ...@@ -284,7 +284,7 @@ uint16_t RTCDataChannel::maxRetransmits(bool& is_null) const {
String RTCDataChannel::protocol() const { String RTCDataChannel::protocol() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return WebString::FromUTF8(channel()->protocol()); return String::FromUTF8(channel()->protocol());
} }
bool RTCDataChannel::negotiated() const { bool RTCDataChannel::negotiated() const {
...@@ -359,8 +359,7 @@ void RTCDataChannel::send(const String& data, ExceptionState& exception_state) { ...@@ -359,8 +359,7 @@ void RTCDataChannel::send(const String& data, ExceptionState& exception_state) {
return; return;
} }
std::string utf8_buffer = static_cast<WebString>(data).Utf8(); webrtc::DataBuffer data_buffer(data.Utf8());
webrtc::DataBuffer data_buffer(utf8_buffer);
buffered_amount_ += data_buffer.size(); buffered_amount_ += data_buffer.size();
RecordMessageSent(*channel().get(), data_buffer.size()); RecordMessageSent(*channel().get(), data_buffer.size());
if (!channel()->Send(data_buffer)) { if (!channel()->Send(data_buffer)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment