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

Unified Diff: remoting/protocol/webrtc_transport.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_transport.h ('k') | remoting/protocol/webrtc_transport_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/webrtc_transport.cc
diff --git a/remoting/protocol/webrtc_transport.cc b/remoting/protocol/webrtc_transport.cc
index fbec3d271f923fc8cec806b23ffc64ced8d8ec93..8b630a82431bef0202ea27c7fc414058fb92f312 100644
--- a/remoting/protocol/webrtc_transport.cc
+++ b/remoting/protocol/webrtc_transport.cc
@@ -10,6 +10,7 @@
#include "base/callback_helpers.h"
#include "base/command_line.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
@@ -69,8 +70,9 @@ class CreateSessionDescriptionObserver
: public webrtc::CreateSessionDescriptionObserver {
public:
typedef base::Callback<void(
- scoped_ptr<webrtc::SessionDescriptionInterface> description,
- const std::string& error)> ResultCallback;
+ std::unique_ptr<webrtc::SessionDescriptionInterface> description,
+ const std::string& error)>
+ ResultCallback;
static CreateSessionDescriptionObserver* Create(
const ResultCallback& result_callback) {
@@ -79,7 +81,7 @@ class CreateSessionDescriptionObserver
}
void OnSuccess(webrtc::SessionDescriptionInterface* desc) override {
base::ResetAndReturn(&result_callback_)
- .Run(make_scoped_ptr(desc), std::string());
+ .Run(base::WrapUnique(desc), std::string());
}
void OnFailure(const std::string& error) override {
base::ResetAndReturn(&result_callback_).Run(nullptr, error);
@@ -185,7 +187,7 @@ void WebrtcTransport::Start(
constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp,
webrtc::MediaConstraintsInterface::kValueTrue);
- scoped_ptr<cricket::PortAllocator> port_allocator =
+ std::unique_ptr<cricket::PortAllocator> port_allocator =
transport_context_->port_allocator_factory()->CreatePortAllocator(
transport_context_);
peer_connection_ = peer_connection_factory_->CreatePeerConnection(
@@ -249,7 +251,7 @@ bool WebrtcTransport::ProcessTransportInfo(XmlElement* transport_info) {
}
webrtc::SdpParseError error;
- scoped_ptr<webrtc::SessionDescriptionInterface> session_description(
+ std::unique_ptr<webrtc::SessionDescriptionInterface> session_description(
webrtc::CreateSessionDescription(type, sdp, &error));
if (!session_description) {
LOG(ERROR) << "Failed to parse the session description: "
@@ -283,7 +285,7 @@ bool WebrtcTransport::ProcessTransportInfo(XmlElement* transport_info) {
}
webrtc::SdpParseError error;
- scoped_ptr<webrtc::IceCandidateInterface> candidate(
+ std::unique_ptr<webrtc::IceCandidateInterface> candidate(
webrtc::CreateIceCandidate(sdp_mid, sdp_mlineindex, candidate_str,
&error));
if (!candidate) {
@@ -307,7 +309,7 @@ bool WebrtcTransport::ProcessTransportInfo(XmlElement* transport_info) {
}
void WebrtcTransport::OnLocalSessionDescriptionCreated(
- scoped_ptr<webrtc::SessionDescriptionInterface> description,
+ std::unique_ptr<webrtc::SessionDescriptionInterface> description,
const std::string& error) {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -329,7 +331,7 @@ void WebrtcTransport::OnLocalSessionDescriptionCreated(
description_sdp = NormalizeSessionDescription(description_sdp);
// Format and send the session description to the peer.
- scoped_ptr<XmlElement> transport_info(
+ std::unique_ptr<XmlElement> transport_info(
new XmlElement(QName(kTransportNamespace, "transport"), true));
XmlElement* offer_tag =
new XmlElement(QName(kTransportNamespace, "session-description"));
@@ -460,7 +462,7 @@ void WebrtcTransport::OnIceCandidate(
const webrtc::IceCandidateInterface* candidate) {
DCHECK(thread_checker_.CalledOnValidThread());
- scoped_ptr<XmlElement> candidate_element(
+ std::unique_ptr<XmlElement> candidate_element(
new XmlElement(QName(kTransportNamespace, "candidate")));
std::string candidate_str;
if (!candidate->ToString(&candidate_str)) {
« no previous file with comments | « remoting/protocol/webrtc_transport.h ('k') | remoting/protocol/webrtc_transport_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698