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

Unified Diff: remoting/protocol/webrtc_data_stream_adapter.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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
« no previous file with comments | « remoting/protocol/webrtc_connection_to_host.cc ('k') | remoting/protocol/webrtc_transport.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/webrtc_data_stream_adapter.cc
diff --git a/remoting/protocol/webrtc_data_stream_adapter.cc b/remoting/protocol/webrtc_data_stream_adapter.cc
index 0a0ef01dda0a75fc9b5fabe8291bc794736dc1c2..92007c6e79162928f0fc8b81c04d2007aeaec432 100644
--- a/remoting/protocol/webrtc_data_stream_adapter.cc
+++ b/remoting/protocol/webrtc_data_stream_adapter.cc
@@ -11,6 +11,7 @@
#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/thread_task_runner_handle.h"
#include "net/base/net_errors.h"
#include "remoting/base/compound_buffer.h"
@@ -144,7 +145,7 @@ void WebrtcDataStreamAdapter::Channel::OnError() {
void WebrtcDataStreamAdapter::Channel::OnMessage(
const webrtc::DataBuffer& rtc_buffer) {
- scoped_ptr<CompoundBuffer> buffer(new CompoundBuffer());
+ std::unique_ptr<CompoundBuffer> buffer(new CompoundBuffer());
buffer->AppendCopyOf(reinterpret_cast<const char*>(rtc_buffer.data.data()),
rtc_buffer.data.size());
buffer->Lock();
@@ -153,7 +154,7 @@ void WebrtcDataStreamAdapter::Channel::OnMessage(
struct WebrtcDataStreamAdapter::PendingChannel {
PendingChannel() {}
- PendingChannel(scoped_ptr<Channel> channel,
+ PendingChannel(std::unique_ptr<Channel> channel,
const ChannelCreatedCallback& connected_callback)
: channel(std::move(channel)), connected_callback(connected_callback) {}
PendingChannel(PendingChannel&& other)
@@ -165,7 +166,7 @@ struct WebrtcDataStreamAdapter::PendingChannel {
return *this;
}
- scoped_ptr<Channel> channel;
+ std::unique_ptr<Channel> channel;
ChannelCreatedCallback connected_callback;
};
@@ -204,7 +205,7 @@ void WebrtcDataStreamAdapter::CreateChannel(
DCHECK(pending_channels_.find(name) == pending_channels_.end());
Channel* channel = new Channel(weak_factory_.GetWeakPtr());
- pending_channels_[name] = PendingChannel(make_scoped_ptr(channel), callback);
+ pending_channels_[name] = PendingChannel(base::WrapUnique(channel), callback);
if (outgoing_) {
webrtc::DataChannelInit config;
« no previous file with comments | « remoting/protocol/webrtc_connection_to_host.cc ('k') | remoting/protocol/webrtc_transport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698