aboutsummaryrefslogtreecommitdiff
path: root/talk/app
diff options
context:
space:
mode:
authorkwiberg <kwiberg@webrtc.org>2015-12-17 03:04:15 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-17 11:04:24 +0000
commit0eb15ed7b806125774bd13fb214aeb403e2c6857 (patch)
treecfceaf6b8fa1fac35bbc17171994f49543f22abe /talk/app
parente376f0f2dfcbe46274dd79807a56715aea956fbd (diff)
downloadwebrtc-0eb15ed7b806125774bd13fb214aeb403e2c6857.tar.gz
Don't call the Pass methods of rtc::Buffer, rtc::scoped_ptr, and rtc::ScopedVector
We can now use std::move instead! This CL leaves the Pass methods in place; a follow-up CL will add deprecation annotations to them. Review URL: https://codereview.webrtc.org/1460043002 Cr-Commit-Position: refs/heads/master@{#11064}
Diffstat (limited to 'talk/app')
-rw-r--r--talk/app/webrtc/dtlsidentitystore.cc16
-rw-r--r--talk/app/webrtc/dtlsidentitystore.h3
-rw-r--r--talk/app/webrtc/java/jni/peerconnection_jni.cc3
-rw-r--r--talk/app/webrtc/peerconnection.cc11
-rw-r--r--talk/app/webrtc/peerconnection_unittest.cc13
-rw-r--r--talk/app/webrtc/peerconnectionfactory.cc10
-rw-r--r--talk/app/webrtc/peerconnectionfactory_unittest.cc62
-rw-r--r--talk/app/webrtc/peerconnectionfactoryproxy.h8
-rw-r--r--talk/app/webrtc/peerconnectioninterface.h3
-rw-r--r--talk/app/webrtc/peerconnectioninterface_unittest.cc10
-rw-r--r--talk/app/webrtc/statscollector_unittest.cc3
-rw-r--r--talk/app/webrtc/test/fakedtlsidentitystore.h3
-rw-r--r--talk/app/webrtc/test/peerconnectiontestwrapper.cc4
-rw-r--r--talk/app/webrtc/webrtcsession.cc2
-rw-r--r--talk/app/webrtc/webrtcsession_unittest.cc13
-rw-r--r--talk/app/webrtc/webrtcsessiondescriptionfactory.cc10
16 files changed, 87 insertions, 87 deletions
diff --git a/talk/app/webrtc/dtlsidentitystore.cc b/talk/app/webrtc/dtlsidentitystore.cc
index 27587796bc..390ec0d0b7 100644
--- a/talk/app/webrtc/dtlsidentitystore.cc
+++ b/talk/app/webrtc/dtlsidentitystore.cc
@@ -27,6 +27,8 @@
#include "talk/app/webrtc/dtlsidentitystore.h"
+#include <utility>
+
#include "talk/app/webrtc/webrtcsessiondescriptionfactory.h"
#include "webrtc/base/logging.h"
@@ -72,7 +74,7 @@ class DtlsIdentityStoreImpl::WorkerTask : public sigslot::has_slots<>,
// Posting to |this| avoids touching |store_| on threads other than
// |signaling_thread_| and thus avoids having to use locks.
IdentityResultMessageData* msg = new IdentityResultMessageData(
- new IdentityResult(key_type_, identity.Pass()));
+ new IdentityResult(key_type_, std::move(identity)));
signaling_thread_->Post(this, MSG_GENERATE_IDENTITY_RESULT, msg);
}
@@ -93,7 +95,7 @@ class DtlsIdentityStoreImpl::WorkerTask : public sigslot::has_slots<>,
static_cast<IdentityResultMessageData*>(msg->pdata));
if (store_) {
store_->OnIdentityGenerated(pdata->data()->key_type_,
- pdata->data()->identity_.Pass());
+ std::move(pdata->data()->identity_));
}
}
break;
@@ -152,7 +154,7 @@ void DtlsIdentityStoreImpl::OnMessage(rtc::Message* msg) {
rtc::scoped_ptr<IdentityResultMessageData> pdata(
static_cast<IdentityResultMessageData*>(msg->pdata));
OnIdentityGenerated(pdata->data()->key_type_,
- pdata->data()->identity_.Pass());
+ std::move(pdata->data()->identity_));
break;
}
}
@@ -178,9 +180,9 @@ void DtlsIdentityStoreImpl::GenerateIdentity(
// Return identity async - post even though we are on |signaling_thread_|.
LOG(LS_VERBOSE) << "Using a free DTLS identity.";
++request_info_[key_type].gen_in_progress_counts_;
- IdentityResultMessageData* msg = new IdentityResultMessageData(
- new IdentityResult(key_type,
- request_info_[key_type].free_identity_.Pass()));
+ IdentityResultMessageData* msg =
+ new IdentityResultMessageData(new IdentityResult(
+ key_type, std::move(request_info_[key_type].free_identity_)));
signaling_thread_->Post(this, MSG_GENERATE_IDENTITY_RESULT, msg);
return;
}
@@ -228,7 +230,7 @@ void DtlsIdentityStoreImpl::OnIdentityGenerated(
// Return the result to the observer.
if (identity.get()) {
LOG(LS_VERBOSE) << "A DTLS identity is returned to an observer.";
- observer->OnSuccess(identity.Pass());
+ observer->OnSuccess(std::move(identity));
} else {
LOG(LS_WARNING) << "Failed to generate DTLS identity.";
observer->OnFailure(0);
diff --git a/talk/app/webrtc/dtlsidentitystore.h b/talk/app/webrtc/dtlsidentitystore.h
index a0eef98e1b..2a5309d34b 100644
--- a/talk/app/webrtc/dtlsidentitystore.h
+++ b/talk/app/webrtc/dtlsidentitystore.h
@@ -30,6 +30,7 @@
#include <queue>
#include <string>
+#include <utility>
#include "webrtc/base/messagehandler.h"
#include "webrtc/base/messagequeue.h"
@@ -129,7 +130,7 @@ class DtlsIdentityStoreImpl : public DtlsIdentityStoreInterface,
struct IdentityResult {
IdentityResult(rtc::KeyType key_type,
rtc::scoped_ptr<rtc::SSLIdentity> identity)
- : key_type_(key_type), identity_(identity.Pass()) {}
+ : key_type_(key_type), identity_(std::move(identity)) {}
rtc::KeyType key_type_;
rtc::scoped_ptr<rtc::SSLIdentity> identity_;
diff --git a/talk/app/webrtc/java/jni/peerconnection_jni.cc b/talk/app/webrtc/java/jni/peerconnection_jni.cc
index f44498443b..5b871d3cc8 100644
--- a/talk/app/webrtc/java/jni/peerconnection_jni.cc
+++ b/talk/app/webrtc/java/jni/peerconnection_jni.cc
@@ -57,6 +57,7 @@
#define JNIEXPORT __attribute__((visibility("default")))
#include <limits>
+#include <utility>
#include "talk/app/webrtc/java/jni/classreferenceholder.h"
#include "talk/app/webrtc/java/jni/jni_helpers.h"
@@ -1631,7 +1632,7 @@ JOW(jlong, PeerConnectionFactory_nativeCreatePeerConnection)(
rtc::SSLIdentity::Generate(webrtc::kIdentityName, rtc::KT_ECDSA));
if (ssl_identity.get()) {
rtc_config.certificates.push_back(
- rtc::RTCCertificate::Create(ssl_identity.Pass()));
+ rtc::RTCCertificate::Create(std::move(ssl_identity)));
LOG(LS_INFO) << "ECDSA certificate created.";
} else {
// Failing to create certificate should not abort peer connection
diff --git a/talk/app/webrtc/peerconnection.cc b/talk/app/webrtc/peerconnection.cc
index 3a38248b7b..85e03f99b8 100644
--- a/talk/app/webrtc/peerconnection.cc
+++ b/talk/app/webrtc/peerconnection.cc
@@ -28,8 +28,9 @@
#include "talk/app/webrtc/peerconnection.h"
#include <algorithm>
-#include <vector>
#include <cctype> // for isdigit
+#include <utility>
+#include <vector>
#include "talk/app/webrtc/audiotrack.h"
#include "talk/app/webrtc/dtmfsender.h"
@@ -632,8 +633,8 @@ bool PeerConnection::Initialize(
}
rtc::scoped_ptr<cricket::PortAllocator> allocator(
allocator_factory->CreatePortAllocator(stun_config, turn_config));
- return Initialize(configuration, constraints, allocator.Pass(),
- dtls_identity_store.Pass(), observer);
+ return Initialize(configuration, constraints, std::move(allocator),
+ std::move(dtls_identity_store), observer);
}
bool PeerConnection::Initialize(
@@ -649,7 +650,7 @@ bool PeerConnection::Initialize(
}
observer_ = observer;
- port_allocator_ = allocator.Pass();
+ port_allocator_ = std::move(allocator);
std::vector<PortAllocatorFactoryInterface::StunConfiguration> stun_config;
std::vector<PortAllocatorFactoryInterface::TurnConfiguration> turn_config;
@@ -701,7 +702,7 @@ bool PeerConnection::Initialize(
// Initialize the WebRtcSession. It creates transport channels etc.
if (!session_->Initialize(factory_->options(), constraints,
- dtls_identity_store.Pass(), configuration)) {
+ std::move(dtls_identity_store), configuration)) {
return false;
}
diff --git a/talk/app/webrtc/peerconnection_unittest.cc b/talk/app/webrtc/peerconnection_unittest.cc
index 55e4da86fb..49f450025a 100644
--- a/talk/app/webrtc/peerconnection_unittest.cc
+++ b/talk/app/webrtc/peerconnection_unittest.cc
@@ -30,6 +30,7 @@
#include <algorithm>
#include <list>
#include <map>
+#include <utility>
#include <vector>
#include "talk/app/webrtc/dtmfsender.h"
@@ -151,7 +152,7 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver,
const PeerConnectionFactory::Options* options,
rtc::scoped_ptr<webrtc::DtlsIdentityStoreInterface> dtls_identity_store) {
PeerConnectionTestClient* client(new PeerConnectionTestClient(id));
- if (!client->Init(constraints, options, dtls_identity_store.Pass())) {
+ if (!client->Init(constraints, options, std::move(dtls_identity_store))) {
delete client;
return nullptr;
}
@@ -167,7 +168,7 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver,
: nullptr);
return CreateClientWithDtlsIdentityStore(id, constraints, options,
- dtls_identity_store.Pass());
+ std::move(dtls_identity_store));
}
~PeerConnectionTestClient() {
@@ -761,7 +762,7 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver,
peer_connection_factory_->SetOptions(*options);
}
peer_connection_ = CreatePeerConnection(
- allocator_factory_.get(), constraints, dtls_identity_store.Pass());
+ allocator_factory_.get(), constraints, std::move(dtls_identity_store));
return peer_connection_.get() != nullptr;
}
@@ -776,7 +777,8 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver,
ice_servers.push_back(ice_server);
return peer_connection_factory_->CreatePeerConnection(
- ice_servers, constraints, factory, dtls_identity_store.Pass(), this);
+ ice_servers, constraints, factory, std::move(dtls_identity_store),
+ this);
}
void HandleIncomingOffer(const std::string& msg) {
@@ -1129,7 +1131,8 @@ class P2PTestConductor : public testing::Test {
// Make sure the new client is using a different certificate.
return PeerConnectionTestClient::CreateClientWithDtlsIdentityStore(
- "New Peer: ", &setup_constraints, nullptr, dtls_identity_store.Pass());
+ "New Peer: ", &setup_constraints, nullptr,
+ std::move(dtls_identity_store));
}
void SendRtpData(webrtc::DataChannelInterface* dc, const std::string& data) {
diff --git a/talk/app/webrtc/peerconnectionfactory.cc b/talk/app/webrtc/peerconnectionfactory.cc
index d01f542826..6d36c8bc2f 100644
--- a/talk/app/webrtc/peerconnectionfactory.cc
+++ b/talk/app/webrtc/peerconnectionfactory.cc
@@ -27,6 +27,8 @@
#include "talk/app/webrtc/peerconnectionfactory.h"
+#include <utility>
+
#include "talk/app/webrtc/audiotrack.h"
#include "talk/app/webrtc/localaudiosource.h"
#include "talk/app/webrtc/mediastream.h"
@@ -274,12 +276,8 @@ PeerConnectionFactory::CreatePeerConnection(
rtc::scoped_refptr<PeerConnection> pc(
new rtc::RefCountedObject<PeerConnection>(this));
- if (!pc->Initialize(
- configuration,
- constraints,
- chosen_allocator_factory,
- dtls_identity_store.Pass(),
- observer)) {
+ if (!pc->Initialize(configuration, constraints, chosen_allocator_factory,
+ std::move(dtls_identity_store), observer)) {
return NULL;
}
return PeerConnectionProxy::Create(signaling_thread(), pc);
diff --git a/talk/app/webrtc/peerconnectionfactory_unittest.cc b/talk/app/webrtc/peerconnectionfactory_unittest.cc
index f1d5353abd..d0018d9897 100644
--- a/talk/app/webrtc/peerconnectionfactory_unittest.cc
+++ b/talk/app/webrtc/peerconnectionfactory_unittest.cc
@@ -26,6 +26,7 @@
*/
#include <string>
+#include <utility>
#include "talk/app/webrtc/fakeportallocatorfactory.h"
#include "talk/app/webrtc/mediastreaminterface.h"
@@ -158,9 +159,8 @@ TEST(PeerConnectionFactoryTestInternal, CreatePCUsingInternalModules) {
rtc::scoped_ptr<FakeDtlsIdentityStore> dtls_identity_store(
new FakeDtlsIdentityStore());
- rtc::scoped_refptr<PeerConnectionInterface> pc(
- factory->CreatePeerConnection(
- servers, nullptr, nullptr, dtls_identity_store.Pass(), &observer));
+ rtc::scoped_refptr<PeerConnectionInterface> pc(factory->CreatePeerConnection(
+ servers, nullptr, nullptr, std::move(dtls_identity_store), &observer));
EXPECT_TRUE(pc.get() != nullptr);
}
@@ -180,11 +180,9 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServers) {
config.servers.push_back(ice_server);
rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
new FakeDtlsIdentityStore());
- rtc::scoped_refptr<PeerConnectionInterface> pc(
- factory_->CreatePeerConnection(config, nullptr,
- allocator_factory_.get(),
- dtls_identity_store.Pass(),
- &observer_));
+ rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
+ config, nullptr, allocator_factory_.get(), std::move(dtls_identity_store),
+ &observer_));
EXPECT_TRUE(pc.get() != NULL);
StunConfigurations stun_configs;
webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1(
@@ -213,11 +211,9 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServersUrls) {
config.servers.push_back(ice_server);
rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
new FakeDtlsIdentityStore());
- rtc::scoped_refptr<PeerConnectionInterface> pc(
- factory_->CreatePeerConnection(config, nullptr,
- allocator_factory_.get(),
- dtls_identity_store.Pass(),
- &observer_));
+ rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
+ config, nullptr, allocator_factory_.get(), std::move(dtls_identity_store),
+ &observer_));
EXPECT_TRUE(pc.get() != NULL);
StunConfigurations stun_configs;
webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1(
@@ -251,11 +247,9 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServersOldSignature) {
ice_servers.push_back(ice_server);
rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
new FakeDtlsIdentityStore());
- rtc::scoped_refptr<PeerConnectionInterface> pc(
- factory_->CreatePeerConnection(ice_servers, nullptr,
- allocator_factory_.get(),
- dtls_identity_store.Pass(),
- &observer_));
+ rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
+ ice_servers, nullptr, allocator_factory_.get(),
+ std::move(dtls_identity_store), &observer_));
EXPECT_TRUE(pc.get() != NULL);
StunConfigurations stun_configs;
webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1(
@@ -283,11 +277,9 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingNoUsernameInUri) {
config.servers.push_back(ice_server);
rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
new FakeDtlsIdentityStore());
- rtc::scoped_refptr<PeerConnectionInterface> pc(
- factory_->CreatePeerConnection(config, nullptr,
- allocator_factory_.get(),
- dtls_identity_store.Pass(),
- &observer_));
+ rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
+ config, nullptr, allocator_factory_.get(), std::move(dtls_identity_store),
+ &observer_));
EXPECT_TRUE(pc.get() != NULL);
TurnConfigurations turn_configs;
webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn(
@@ -306,11 +298,9 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingTurnUrlWithTransportParam) {
config.servers.push_back(ice_server);
rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
new FakeDtlsIdentityStore());
- rtc::scoped_refptr<PeerConnectionInterface> pc(
- factory_->CreatePeerConnection(config, nullptr,
- allocator_factory_.get(),
- dtls_identity_store.Pass(),
- &observer_));
+ rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
+ config, nullptr, allocator_factory_.get(), std::move(dtls_identity_store),
+ &observer_));
EXPECT_TRUE(pc.get() != NULL);
TurnConfigurations turn_configs;
webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn(
@@ -333,11 +323,9 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingSecureTurnUrl) {
config.servers.push_back(ice_server);
rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
new FakeDtlsIdentityStore());
- rtc::scoped_refptr<PeerConnectionInterface> pc(
- factory_->CreatePeerConnection(config, nullptr,
- allocator_factory_.get(),
- dtls_identity_store.Pass(),
- &observer_));
+ rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
+ config, nullptr, allocator_factory_.get(), std::move(dtls_identity_store),
+ &observer_));
EXPECT_TRUE(pc.get() != NULL);
TurnConfigurations turn_configs;
webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1(
@@ -370,11 +358,9 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIPLiteralAddress) {
config.servers.push_back(ice_server);
rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
new FakeDtlsIdentityStore());
- rtc::scoped_refptr<PeerConnectionInterface> pc(
- factory_->CreatePeerConnection(config, nullptr,
- allocator_factory_.get(),
- dtls_identity_store.Pass(),
- &observer_));
+ rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
+ config, nullptr, allocator_factory_.get(), std::move(dtls_identity_store),
+ &observer_));
EXPECT_TRUE(pc.get() != NULL);
StunConfigurations stun_configs;
webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1(
diff --git a/talk/app/webrtc/peerconnectionfactoryproxy.h b/talk/app/webrtc/peerconnectionfactoryproxy.h
index 9013ea5038..db34ea72ce 100644
--- a/talk/app/webrtc/peerconnectionfactoryproxy.h
+++ b/talk/app/webrtc/peerconnectionfactoryproxy.h
@@ -29,6 +29,7 @@
#define TALK_APP_WEBRTC_PEERCONNECTIONFACTORYPROXY_H_
#include <string>
+#include <utility>
#include "talk/app/webrtc/peerconnectioninterface.h"
#include "talk/app/webrtc/proxy.h"
@@ -38,7 +39,7 @@ namespace webrtc {
BEGIN_PROXY_MAP(PeerConnectionFactory)
PROXY_METHOD1(void, SetOptions, const Options&)
- // Can't use PROXY_METHOD5 because scoped_ptr must be Pass()ed.
+ // Can't use PROXY_METHOD5 because scoped_ptr must be moved.
// TODO(tommi,hbos): Use of templates to support scoped_ptr?
rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection(
const PeerConnectionInterface::RTCConfiguration& a1,
@@ -84,7 +85,7 @@ BEGIN_PROXY_MAP(PeerConnectionFactory)
DtlsIdentityStoreInterface* a4,
PeerConnectionObserver* a5) {
rtc::scoped_ptr<DtlsIdentityStoreInterface> ptr_a4(a4);
- return c_->CreatePeerConnection(a1, a2, a3, ptr_a4.Pass(), a5);
+ return c_->CreatePeerConnection(a1, a2, a3, std::move(ptr_a4), a5);
}
rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection_ot2(
@@ -95,7 +96,8 @@ BEGIN_PROXY_MAP(PeerConnectionFactory)
PeerConnectionObserver* a5) {
rtc::scoped_ptr<cricket::PortAllocator> ptr_a3(a3);
rtc::scoped_ptr<DtlsIdentityStoreInterface> ptr_a4(a4);
- return c_->CreatePeerConnection(a1, a2, ptr_a3.Pass(), ptr_a4.Pass(), a5);
+ return c_->CreatePeerConnection(a1, a2, std::move(ptr_a3),
+ std::move(ptr_a4), a5);
}
END_PROXY()
diff --git a/talk/app/webrtc/peerconnectioninterface.h b/talk/app/webrtc/peerconnectioninterface.h
index 100d8cea07..799ca150e2 100644
--- a/talk/app/webrtc/peerconnectioninterface.h
+++ b/talk/app/webrtc/peerconnectioninterface.h
@@ -69,6 +69,7 @@
#define TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_
#include <string>
+#include <utility>
#include <vector>
#include "talk/app/webrtc/datachannelinterface.h"
@@ -604,7 +605,7 @@ class PeerConnectionFactoryInterface : public rtc::RefCountInterface {
PeerConnectionInterface::RTCConfiguration rtc_config;
rtc_config.servers = servers;
return CreatePeerConnection(rtc_config, constraints, allocator_factory,
- dtls_identity_store.Pass(), observer);
+ std::move(dtls_identity_store), observer);
}
virtual rtc::scoped_refptr<MediaStreamInterface>
diff --git a/talk/app/webrtc/peerconnectioninterface_unittest.cc b/talk/app/webrtc/peerconnectioninterface_unittest.cc
index 5e239313d6..930f538ebd 100644
--- a/talk/app/webrtc/peerconnectioninterface_unittest.cc
+++ b/talk/app/webrtc/peerconnectioninterface_unittest.cc
@@ -26,6 +26,7 @@
*/
#include <string>
+#include <utility>
#include "talk/app/webrtc/audiotrack.h"
#include "talk/app/webrtc/fakeportallocatorfactory.h"
@@ -562,10 +563,9 @@ class PeerConnectionInterfaceTest : public testing::Test {
nullptr) && dtls) {
dtls_identity_store.reset(new FakeDtlsIdentityStore());
}
- pc_ = pc_factory_->CreatePeerConnection(servers, constraints,
- port_allocator_factory_.get(),
- dtls_identity_store.Pass(),
- &observer_);
+ pc_ = pc_factory_->CreatePeerConnection(
+ servers, constraints, port_allocator_factory_.get(),
+ std::move(dtls_identity_store), &observer_);
ASSERT_TRUE(pc_.get() != NULL);
observer_.SetPeerConnectionInterface(pc_.get());
EXPECT_EQ(PeerConnectionInterface::kStable, observer_.state_);
@@ -582,7 +582,7 @@ class PeerConnectionInterfaceTest : public testing::Test {
scoped_refptr<PeerConnectionInterface> pc;
pc = pc_factory_->CreatePeerConnection(
servers, nullptr, port_allocator_factory_.get(),
- dtls_identity_store.Pass(), &observer_);
+ std::move(dtls_identity_store), &observer_);
ASSERT_EQ(nullptr, pc);
}
diff --git a/talk/app/webrtc/statscollector_unittest.cc b/talk/app/webrtc/statscollector_unittest.cc
index 89e1c154dd..e7ee91190e 100644
--- a/talk/app/webrtc/statscollector_unittest.cc
+++ b/talk/app/webrtc/statscollector_unittest.cc
@@ -696,8 +696,7 @@ class StatsCollectorTest : public testing::Test {
// Fake certificate to report
rtc::scoped_refptr<rtc::RTCCertificate> local_certificate(
rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::FakeSSLIdentity>(
- new rtc::FakeSSLIdentity(local_cert))
- .Pass()));
+ new rtc::FakeSSLIdentity(local_cert))));
// Configure MockWebRtcSession
EXPECT_CALL(session_,
diff --git a/talk/app/webrtc/test/fakedtlsidentitystore.h b/talk/app/webrtc/test/fakedtlsidentitystore.h
index 5e596ca91e..98074c742a 100644
--- a/talk/app/webrtc/test/fakedtlsidentitystore.h
+++ b/talk/app/webrtc/test/fakedtlsidentitystore.h
@@ -29,6 +29,7 @@
#define TALK_APP_WEBRTC_TEST_FAKEDTLSIDENTITYSERVICE_H_
#include <string>
+#include <utility>
#include "talk/app/webrtc/dtlsidentitystore.h"
#include "talk/app/webrtc/peerconnectioninterface.h"
@@ -141,7 +142,7 @@ class FakeDtlsIdentityStore : public webrtc::DtlsIdentityStoreInterface,
rtc::scoped_ptr<rtc::SSLIdentity> identity(
rtc::SSLIdentity::FromPEMStrings(pem_key, pem_cert));
- return rtc::RTCCertificate::Create(identity.Pass());
+ return rtc::RTCCertificate::Create(std::move(identity));
}
private:
diff --git a/talk/app/webrtc/test/peerconnectiontestwrapper.cc b/talk/app/webrtc/test/peerconnectiontestwrapper.cc
index 2eb24d9700..032044c36e 100644
--- a/talk/app/webrtc/test/peerconnectiontestwrapper.cc
+++ b/talk/app/webrtc/test/peerconnectiontestwrapper.cc
@@ -25,6 +25,8 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <utility>
+
#include "talk/app/webrtc/fakeportallocatorfactory.h"
#include "talk/app/webrtc/test/fakedtlsidentitystore.h"
#include "talk/app/webrtc/test/fakeperiodicvideocapturer.h"
@@ -97,7 +99,7 @@ bool PeerConnectionTestWrapper::CreatePc(
new FakeDtlsIdentityStore() : nullptr);
peer_connection_ = peer_connection_factory_->CreatePeerConnection(
ice_servers, constraints, allocator_factory_.get(),
- dtls_identity_store.Pass(), this);
+ std::move(dtls_identity_store), this);
return peer_connection_.get() != NULL;
}
diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc
index 5e946a291b..29a4f3394a 100644
--- a/talk/app/webrtc/webrtcsession.cc
+++ b/talk/app/webrtc/webrtcsession.cc
@@ -724,7 +724,7 @@ bool WebRtcSession::Initialize(
// Use the |dtls_identity_store| to generate a certificate.
RTC_DCHECK(dtls_identity_store);
webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory(
- signaling_thread(), channel_manager_, dtls_identity_store.Pass(),
+ signaling_thread(), channel_manager_, std::move(dtls_identity_store),
this, id()));
} else {
// Use the already generated certificate.
diff --git a/talk/app/webrtc/webrtcsession_unittest.cc b/talk/app/webrtc/webrtcsession_unittest.cc
index 6a38351cb5..5997c5328f 100644
--- a/talk/app/webrtc/webrtcsession_unittest.cc
+++ b/talk/app/webrtc/webrtcsession_unittest.cc
@@ -25,6 +25,7 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <utility>
#include <vector>
#include "talk/app/webrtc/audiotrack.h"
@@ -425,7 +426,7 @@ class WebRtcSessionTest
observer_.ice_gathering_state_);
EXPECT_TRUE(session_->Initialize(options_, constraints_.get(),
- dtls_identity_store.Pass(),
+ std::move(dtls_identity_store),
rtc_configuration));
session_->set_metrics_observer(metrics_observer_);
}
@@ -476,7 +477,7 @@ class WebRtcSessionTest
} else {
RTC_CHECK(false);
}
- Init(dtls_identity_store.Pass(), configuration);
+ Init(std::move(dtls_identity_store), configuration);
}
// Init with DTLS with a store that will fail to generate a certificate.
@@ -485,7 +486,7 @@ class WebRtcSessionTest
new FakeDtlsIdentityStore());
dtls_identity_store->set_should_fail(true);
PeerConnectionInterface::RTCConfiguration configuration;
- Init(dtls_identity_store.Pass(), configuration);
+ Init(std::move(dtls_identity_store), configuration);
}
void InitWithDtmfCodec() {
@@ -723,9 +724,9 @@ class WebRtcSessionTest
std::string identity_name = "WebRTC" +
rtc::ToString(rtc::CreateRandomId());
// Confirmed to work with KT_RSA and KT_ECDSA.
- tdesc_factory_->set_certificate(rtc::RTCCertificate::Create(
- rtc::scoped_ptr<rtc::SSLIdentity>(rtc::SSLIdentity::Generate(
- identity_name, rtc::KT_DEFAULT)).Pass()));
+ tdesc_factory_->set_certificate(
+ rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::SSLIdentity>(
+ rtc::SSLIdentity::Generate(identity_name, rtc::KT_DEFAULT))));
tdesc_factory_->set_secure(cricket::SEC_REQUIRED);
}
diff --git a/talk/app/webrtc/webrtcsessiondescriptionfactory.cc b/talk/app/webrtc/webrtcsessiondescriptionfactory.cc
index 25965af79d..bfdbb1ac0a 100644
--- a/talk/app/webrtc/webrtcsessiondescriptionfactory.cc
+++ b/talk/app/webrtc/webrtcsessiondescriptionfactory.cc
@@ -27,6 +27,8 @@
#include "talk/app/webrtc/webrtcsessiondescriptionfactory.h"
+#include <utility>
+
#include "talk/app/webrtc/dtlsidentitystore.h"
#include "talk/app/webrtc/jsep.h"
#include "talk/app/webrtc/jsepsessiondescription.h"
@@ -99,12 +101,12 @@ void WebRtcIdentityRequestObserver::OnSuccess(
der_private_key.length());
rtc::scoped_ptr<rtc::SSLIdentity> identity(
rtc::SSLIdentity::FromPEMStrings(pem_key, pem_cert));
- SignalCertificateReady(rtc::RTCCertificate::Create(identity.Pass()));
+ SignalCertificateReady(rtc::RTCCertificate::Create(std::move(identity)));
}
void WebRtcIdentityRequestObserver::OnSuccess(
rtc::scoped_ptr<rtc::SSLIdentity> identity) {
- SignalCertificateReady(rtc::RTCCertificate::Create(identity.Pass()));
+ SignalCertificateReady(rtc::RTCCertificate::Create(std::move(identity)));
}
// static
@@ -143,7 +145,7 @@ WebRtcSessionDescriptionFactory::WebRtcSessionDescriptionFactory(
// to just use a random number as session id and start version from
// |kInitSessionVersion|.
session_version_(kInitSessionVersion),
- dtls_identity_store_(dtls_identity_store.Pass()),
+ dtls_identity_store_(std::move(dtls_identity_store)),
identity_request_observer_(identity_request_observer),
session_(session),
session_id_(session_id),
@@ -177,7 +179,7 @@ WebRtcSessionDescriptionFactory::WebRtcSessionDescriptionFactory(
: WebRtcSessionDescriptionFactory(
signaling_thread,
channel_manager,
- dtls_identity_store.Pass(),
+ std::move(dtls_identity_store),
new rtc::RefCountedObject<WebRtcIdentityRequestObserver>(),
session,
session_id,