From 322c4a0b3a82caf8cdd4bf2c128c2eac72ed3058 Mon Sep 17 00:00:00 2001 From: kwiberg Date: Sat, 30 Apr 2016 02:40:22 -0700 Subject: [PATCH] Replace scoped_ptr with unique_ptr in webrtc/libjingle/ But keep #including scoped_ptr.h in .h files, so as not to break WebRTC users who expect those .h files to give them rtc::scoped_ptr. BUG=webrtc:5520 Review-Url: https://codereview.webrtc.org/1935893002 Cr-Commit-Position: refs/heads/master@{#12577} --- webrtc/libjingle/xmllite/xmlbuilder.h | 5 ++-- webrtc/libjingle/xmllite/xmlnsstack.h | 5 ++-- webrtc/libjingle/xmpp/chatroommoduleimpl.cc | 7 +++--- webrtc/libjingle/xmpp/discoitemsquerytask.cc | 1 - webrtc/libjingle/xmpp/hangoutpubsubclient.h | 17 ++++++------- .../xmpp/hangoutpubsubclient_unittest.cc | 7 +++--- webrtc/libjingle/xmpp/iqtask.h | 3 ++- webrtc/libjingle/xmpp/jingleinfotask.cc | 4 +++- webrtc/libjingle/xmpp/mucroomconfigtask.cc | 1 - webrtc/libjingle/xmpp/mucroomlookuptask.cc | 1 - webrtc/libjingle/xmpp/pingtask.cc | 5 ++-- webrtc/libjingle/xmpp/pubsub_task.cc | 3 ++- .../libjingle/xmpp/pubsubclient_unittest.cc | 7 +++--- webrtc/libjingle/xmpp/pubsubstateclient.h | 5 ++-- webrtc/libjingle/xmpp/pubsubtasks_unittest.cc | 5 ++-- .../libjingle/xmpp/rostermodule_unittest.cc | 24 +++++++++---------- webrtc/libjingle/xmpp/rostermoduleimpl.h | 12 ++++++---- webrtc/libjingle/xmpp/xmppclient.cc | 7 +++--- webrtc/libjingle/xmpp/xmppclient.h | 4 +++- webrtc/libjingle/xmpp/xmppengine_unittest.cc | 6 +++-- webrtc/libjingle/xmpp/xmppengineimpl.h | 14 ++++++----- webrtc/libjingle/xmpp/xmpplogintask.h | 7 +++--- .../libjingle/xmpp/xmpplogintask_unittest.cc | 6 +++-- webrtc/libjingle/xmpp/xmpptask.h | 4 +++- 24 files changed, 91 insertions(+), 69 deletions(-) diff --git a/webrtc/libjingle/xmllite/xmlbuilder.h b/webrtc/libjingle/xmllite/xmlbuilder.h index ea452dbf0b..abb3433fa6 100644 --- a/webrtc/libjingle/xmllite/xmlbuilder.h +++ b/webrtc/libjingle/xmllite/xmlbuilder.h @@ -11,6 +11,7 @@ #ifndef _xmlbuilder_h_ #define _xmlbuilder_h_ +#include #include #include #include "webrtc/libjingle/xmllite/xmlparser.h" @@ -48,8 +49,8 @@ public: private: XmlElement * pelCurrent_; - rtc::scoped_ptr pelRoot_; - rtc::scoped_ptr > pvParents_; + std::unique_ptr pelRoot_; + std::unique_ptr > pvParents_; }; } diff --git a/webrtc/libjingle/xmllite/xmlnsstack.h b/webrtc/libjingle/xmllite/xmlnsstack.h index 174f8aefc0..07a9883de5 100644 --- a/webrtc/libjingle/xmllite/xmlnsstack.h +++ b/webrtc/libjingle/xmllite/xmlnsstack.h @@ -11,6 +11,7 @@ #ifndef WEBRTC_LIBJINGLE_XMLLITE_XMLNSSTACK_H_ #define WEBRTC_LIBJINGLE_XMLLITE_XMLNSSTACK_H_ +#include #include #include #include "webrtc/libjingle/xmllite/qname.h" @@ -37,8 +38,8 @@ public: private: - rtc::scoped_ptr > pxmlnsStack_; - rtc::scoped_ptr > pxmlnsDepthStack_; + std::unique_ptr > pxmlnsStack_; + std::unique_ptr > pxmlnsDepthStack_; }; } diff --git a/webrtc/libjingle/xmpp/chatroommoduleimpl.cc b/webrtc/libjingle/xmpp/chatroommoduleimpl.cc index 52fba4cbae..4feb5bc9b8 100644 --- a/webrtc/libjingle/xmpp/chatroommoduleimpl.cc +++ b/webrtc/libjingle/xmpp/chatroommoduleimpl.cc @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -105,7 +106,7 @@ public: const XmppPresence* presence() const; private: - rtc::scoped_ptr presence_; + std::unique_ptr presence_; }; class XmppChatroomMemberEnumeratorImpl : @@ -430,7 +431,7 @@ void XmppChatroomModuleImpl::FireEnteredStatus(const XmlElement* presence, XmppChatroomEnteredStatus status) { if (chatroom_handler_) { - rtc::scoped_ptr xmpp_presence(XmppPresence::Create()); + std::unique_ptr xmpp_presence(XmppPresence::Create()); xmpp_presence->set_raw_xml(presence); chatroom_handler_->ChatroomEnteredStatus(this, xmpp_presence.get(), status); } @@ -472,7 +473,7 @@ XmppReturnStatus XmppChatroomModuleImpl::ServerChangedOtherPresence(const XmlElement& presence_element) { XmppReturnStatus xmpp_status = XMPP_RETURN_OK; - rtc::scoped_ptr presence(XmppPresence::Create()); + std::unique_ptr presence(XmppPresence::Create()); IFR(presence->set_raw_xml(&presence_element)); JidMemberMap::iterator pos = chatroom_jid_members_.find(presence->jid()); diff --git a/webrtc/libjingle/xmpp/discoitemsquerytask.cc b/webrtc/libjingle/xmpp/discoitemsquerytask.cc index 765ee14397..10f6e1d745 100644 --- a/webrtc/libjingle/xmpp/discoitemsquerytask.cc +++ b/webrtc/libjingle/xmpp/discoitemsquerytask.cc @@ -11,7 +11,6 @@ #include "webrtc/libjingle/xmpp/constants.h" #include "webrtc/libjingle/xmpp/discoitemsquerytask.h" #include "webrtc/libjingle/xmpp/xmpptask.h" -#include "webrtc/base/scoped_ptr.h" namespace buzz { diff --git a/webrtc/libjingle/xmpp/hangoutpubsubclient.h b/webrtc/libjingle/xmpp/hangoutpubsubclient.h index 2586768e2b..8633424adc 100644 --- a/webrtc/libjingle/xmpp/hangoutpubsubclient.h +++ b/webrtc/libjingle/xmpp/hangoutpubsubclient.h @@ -12,6 +12,7 @@ #define WEBRTC_LIBJINGLE_XMPP_HANGOUTPUBSUBCLIENT_H_ #include +#include #include #include @@ -163,14 +164,14 @@ class HangoutPubSubClient : public sigslot::has_slots<> { const XmlElement* stanza); Jid mucjid_; std::string nick_; - rtc::scoped_ptr media_client_; - rtc::scoped_ptr presenter_client_; - rtc::scoped_ptr > presenter_state_client_; - rtc::scoped_ptr > audio_mute_state_client_; - rtc::scoped_ptr > video_mute_state_client_; - rtc::scoped_ptr > video_pause_state_client_; - rtc::scoped_ptr > recording_state_client_; - rtc::scoped_ptr > media_block_state_client_; + std::unique_ptr media_client_; + std::unique_ptr presenter_client_; + std::unique_ptr > presenter_state_client_; + std::unique_ptr > audio_mute_state_client_; + std::unique_ptr > video_mute_state_client_; + std::unique_ptr > video_pause_state_client_; + std::unique_ptr > recording_state_client_; + std::unique_ptr > media_block_state_client_; }; } // namespace buzz diff --git a/webrtc/libjingle/xmpp/hangoutpubsubclient_unittest.cc b/webrtc/libjingle/xmpp/hangoutpubsubclient_unittest.cc index 7c6ea58f2d..dd706b6a9a 100644 --- a/webrtc/libjingle/xmpp/hangoutpubsubclient_unittest.cc +++ b/webrtc/libjingle/xmpp/hangoutpubsubclient_unittest.cc @@ -8,6 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include #include #include "webrtc/libjingle/xmllite/qname.h" @@ -228,11 +229,11 @@ class HangoutPubSubClientTest : public testing::Test { listener.get(), &TestHangoutPubSubListener::OnMediaBlockError); } - rtc::scoped_ptr runner; + std::unique_ptr runner; // xmpp_client deleted by deleting runner. buzz::FakeXmppClient* xmpp_client; - rtc::scoped_ptr client; - rtc::scoped_ptr listener; + std::unique_ptr client; + std::unique_ptr listener; buzz::Jid pubsubjid; std::string nick; }; diff --git a/webrtc/libjingle/xmpp/iqtask.h b/webrtc/libjingle/xmpp/iqtask.h index 1d50c38394..0db00711e8 100644 --- a/webrtc/libjingle/xmpp/iqtask.h +++ b/webrtc/libjingle/xmpp/iqtask.h @@ -11,6 +11,7 @@ #ifndef WEBRTC_LIBJINGLE_XMPP_IQTASK_H_ #define WEBRTC_LIBJINGLE_XMPP_IQTASK_H_ +#include #include #include "webrtc/libjingle/xmpp/xmppengine.h" @@ -40,7 +41,7 @@ class IqTask : public XmppTask { virtual int OnTimeout(); Jid to_; - rtc::scoped_ptr stanza_; + std::unique_ptr stanza_; }; } // namespace buzz diff --git a/webrtc/libjingle/xmpp/jingleinfotask.cc b/webrtc/libjingle/xmpp/jingleinfotask.cc index a5a07121bd..5599edc0eb 100644 --- a/webrtc/libjingle/xmpp/jingleinfotask.cc +++ b/webrtc/libjingle/xmpp/jingleinfotask.cc @@ -10,6 +10,8 @@ #include "webrtc/libjingle/xmpp/jingleinfotask.h" +#include + #include "webrtc/libjingle/xmpp/constants.h" #include "webrtc/libjingle/xmpp/xmppclient.h" #include "webrtc/libjingle/xmpp/xmpptask.h" @@ -24,7 +26,7 @@ class JingleInfoTask::JingleInfoGetTask : public XmppTask { done_(false) {} virtual int ProcessStart() { - rtc::scoped_ptr get( + std::unique_ptr get( MakeIq(STR_GET, Jid(), task_id())); get->AddElement(new XmlElement(QN_JINGLE_INFO_QUERY, true)); if (SendStanza(get.get()) != XMPP_RETURN_OK) { diff --git a/webrtc/libjingle/xmpp/mucroomconfigtask.cc b/webrtc/libjingle/xmpp/mucroomconfigtask.cc index 08b10650a9..5938a2ca72 100644 --- a/webrtc/libjingle/xmpp/mucroomconfigtask.cc +++ b/webrtc/libjingle/xmpp/mucroomconfigtask.cc @@ -14,7 +14,6 @@ #include "webrtc/libjingle/xmpp/mucroomconfigtask.h" #include "webrtc/libjingle/xmpp/constants.h" -#include "webrtc/base/scoped_ptr.h" namespace buzz { diff --git a/webrtc/libjingle/xmpp/mucroomlookuptask.cc b/webrtc/libjingle/xmpp/mucroomlookuptask.cc index 8c0a4d7856..a52491c918 100644 --- a/webrtc/libjingle/xmpp/mucroomlookuptask.cc +++ b/webrtc/libjingle/xmpp/mucroomlookuptask.cc @@ -12,7 +12,6 @@ #include "webrtc/libjingle/xmpp/constants.h" #include "webrtc/base/logging.h" -#include "webrtc/base/scoped_ptr.h" namespace buzz { diff --git a/webrtc/libjingle/xmpp/pingtask.cc b/webrtc/libjingle/xmpp/pingtask.cc index 479dc23ff5..3df7b8570a 100644 --- a/webrtc/libjingle/xmpp/pingtask.cc +++ b/webrtc/libjingle/xmpp/pingtask.cc @@ -10,9 +10,10 @@ #include "webrtc/libjingle/xmpp/pingtask.h" +#include + #include "webrtc/libjingle/xmpp/constants.h" #include "webrtc/base/logging.h" -#include "webrtc/base/scoped_ptr.h" namespace buzz { @@ -66,7 +67,7 @@ int PingTask::ProcessStart() { // Send a ping if it's time. if (now >= next_ping_time_) { - rtc::scoped_ptr stanza( + std::unique_ptr stanza( MakeIq(buzz::STR_GET, Jid(STR_EMPTY), task_id())); stanza->AddElement(new buzz::XmlElement(QN_PING)); SendStanza(stanza.get()); diff --git a/webrtc/libjingle/xmpp/pubsub_task.cc b/webrtc/libjingle/xmpp/pubsub_task.cc index f30c051814..812cb95832 100644 --- a/webrtc/libjingle/xmpp/pubsub_task.cc +++ b/webrtc/libjingle/xmpp/pubsub_task.cc @@ -11,6 +11,7 @@ #include "webrtc/libjingle/xmpp/pubsub_task.h" #include +#include #include #include "webrtc/libjingle/xmpp/constants.h" @@ -82,7 +83,7 @@ int PubsubTask::ProcessResponse() { bool PubsubTask::SubscribeToNode(const std::string& pubsub_node, NodeHandler handler) { subscribed_nodes_[pubsub_node] = handler; - rtc::scoped_ptr get_iq_request( + std::unique_ptr get_iq_request( MakeIq(buzz::STR_GET, pubsub_node_jid_, task_id())); if (!get_iq_request) { return false; diff --git a/webrtc/libjingle/xmpp/pubsubclient_unittest.cc b/webrtc/libjingle/xmpp/pubsubclient_unittest.cc index 3815ef8a50..ab4c853e56 100644 --- a/webrtc/libjingle/xmpp/pubsubclient_unittest.cc +++ b/webrtc/libjingle/xmpp/pubsubclient_unittest.cc @@ -8,6 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include #include #include "webrtc/libjingle/xmllite/qname.h" @@ -103,11 +104,11 @@ class PubSubClientTest : public testing::Test { listener.get(), &TestPubSubItemsListener::OnRetractError); } - rtc::scoped_ptr runner; + std::unique_ptr runner; // xmpp_client deleted by deleting runner. buzz::FakeXmppClient* xmpp_client; - rtc::scoped_ptr client; - rtc::scoped_ptr listener; + std::unique_ptr client; + std::unique_ptr listener; buzz::Jid pubsubjid; std::string node; std::string itemid; diff --git a/webrtc/libjingle/xmpp/pubsubstateclient.h b/webrtc/libjingle/xmpp/pubsubstateclient.h index 13bfe1971e..e78ddb5aff 100644 --- a/webrtc/libjingle/xmpp/pubsubstateclient.h +++ b/webrtc/libjingle/xmpp/pubsubstateclient.h @@ -12,6 +12,7 @@ #define WEBRTC_LIBJINGLE_XMPP_PUBSUBSTATECLIENT_H_ #include +#include #include #include @@ -257,8 +258,8 @@ class PubSubStateClient : public sigslot::has_slots<> { PubSubClient* client_; const QName state_name_; C default_state_; - rtc::scoped_ptr key_serializer_; - rtc::scoped_ptr > state_serializer_; + std::unique_ptr key_serializer_; + std::unique_ptr > state_serializer_; // key => state std::map state_by_key_; // itemid => StateItemInfo diff --git a/webrtc/libjingle/xmpp/pubsubtasks_unittest.cc b/webrtc/libjingle/xmpp/pubsubtasks_unittest.cc index 8062e58e18..79e656bb0b 100644 --- a/webrtc/libjingle/xmpp/pubsubtasks_unittest.cc +++ b/webrtc/libjingle/xmpp/pubsubtasks_unittest.cc @@ -8,6 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include #include #include "webrtc/libjingle/xmllite/qname.h" @@ -80,10 +81,10 @@ class PubSubTasksTest : public testing::Test { listener.reset(new TestPubSubTasksListener()); } - rtc::scoped_ptr runner; + std::unique_ptr runner; // Client deleted by deleting runner. buzz::FakeXmppClient* client; - rtc::scoped_ptr listener; + std::unique_ptr listener; buzz::Jid pubsubjid; std::string node; std::string itemid; diff --git a/webrtc/libjingle/xmpp/rostermodule_unittest.cc b/webrtc/libjingle/xmpp/rostermodule_unittest.cc index 1ae6c226a5..18f2025357 100644 --- a/webrtc/libjingle/xmpp/rostermodule_unittest.cc +++ b/webrtc/libjingle/xmpp/rostermodule_unittest.cc @@ -9,6 +9,7 @@ */ #include +#include #include #include @@ -18,7 +19,6 @@ #include "webrtc/libjingle/xmpp/util_unittest.h" #include "webrtc/libjingle/xmpp/xmppengine.h" #include "webrtc/base/gunit.h" -#include "webrtc/base/scoped_ptr.h" #define TEST_OK(x) EXPECT_EQ((x),XMPP_RETURN_OK) #define TEST_BADARGUMENT(x) EXPECT_EQ((x),XMPP_RETURN_BADARGUMENT) @@ -250,7 +250,7 @@ TEST_F(RosterModuleTest, TestPresence) { status->AddAttr(QN_STATUS, STR_PSTN_CONFERENCE_STATUS_CONNECTING); XmlElement presence_xml(QN_PRESENCE); presence_xml.AddElement(status); - rtc::scoped_ptr presence(XmppPresence::Create()); + std::unique_ptr presence(XmppPresence::Create()); presence->set_raw_xml(&presence_xml); EXPECT_EQ(presence->connection_status(), XMPP_CONNECTION_STATUS_CONNECTING); } @@ -258,11 +258,11 @@ TEST_F(RosterModuleTest, TestPresence) { TEST_F(RosterModuleTest, TestOutgoingPresence) { std::stringstream dump; - rtc::scoped_ptr engine(XmppEngine::Create()); + std::unique_ptr engine(XmppEngine::Create()); XmppTestHandler handler(engine.get()); XmppTestRosterHandler roster_handler; - rtc::scoped_ptr roster(XmppRosterModule::Create()); + std::unique_ptr roster(XmppRosterModule::Create()); roster->set_roster_handler(&roster_handler); // Configure the roster module @@ -364,7 +364,7 @@ TEST_F(RosterModuleTest, TestOutgoingPresence) { EXPECT_EQ(handler.SessionActivity(), ""); // Construct a directed presence - rtc::scoped_ptr directed_presence(XmppPresence::Create()); + std::unique_ptr directed_presence(XmppPresence::Create()); TEST_OK(directed_presence->set_available(XMPP_PRESENCE_AVAILABLE)); TEST_OK(directed_presence->set_priority(120)); TEST_OK(directed_presence->set_status("*very* available")); @@ -381,11 +381,11 @@ TEST_F(RosterModuleTest, TestOutgoingPresence) { } TEST_F(RosterModuleTest, TestIncomingPresence) { - rtc::scoped_ptr engine(XmppEngine::Create()); + std::unique_ptr engine(XmppEngine::Create()); XmppTestHandler handler(engine.get()); XmppTestRosterHandler roster_handler; - rtc::scoped_ptr roster(XmppRosterModule::Create()); + std::unique_ptr roster(XmppRosterModule::Create()); roster->set_roster_handler(&roster_handler); // Configure the roster module @@ -513,11 +513,11 @@ TEST_F(RosterModuleTest, TestIncomingPresence) { } TEST_F(RosterModuleTest, TestPresenceSubscription) { - rtc::scoped_ptr engine(XmppEngine::Create()); + std::unique_ptr engine(XmppEngine::Create()); XmppTestHandler handler(engine.get()); XmppTestRosterHandler roster_handler; - rtc::scoped_ptr roster(XmppRosterModule::Create()); + std::unique_ptr roster(XmppRosterModule::Create()); roster->set_roster_handler(&roster_handler); // Configure the roster module @@ -576,11 +576,11 @@ TEST_F(RosterModuleTest, TestPresenceSubscription) { } TEST_F(RosterModuleTest, TestRosterReceive) { - rtc::scoped_ptr engine(XmppEngine::Create()); + std::unique_ptr engine(XmppEngine::Create()); XmppTestHandler handler(engine.get()); XmppTestRosterHandler roster_handler; - rtc::scoped_ptr roster(XmppRosterModule::Create()); + std::unique_ptr roster(XmppRosterModule::Create()); roster->set_roster_handler(&roster_handler); // Configure the roster module @@ -696,7 +696,7 @@ TEST_F(RosterModuleTest, TestRosterReceive) { EXPECT_EQ(handler.SessionActivity(), ""); // Request that someone be added - rtc::scoped_ptr contact(XmppRosterContact::Create()); + std::unique_ptr contact(XmppRosterContact::Create()); TEST_OK(contact->set_jid(Jid("brandt@example.net"))); TEST_OK(contact->set_name("Brandt")); TEST_OK(contact->AddGroup("Business Partners")); diff --git a/webrtc/libjingle/xmpp/rostermoduleimpl.h b/webrtc/libjingle/xmpp/rostermoduleimpl.h index 6e3bd91c8a..772692bd65 100644 --- a/webrtc/libjingle/xmpp/rostermoduleimpl.h +++ b/webrtc/libjingle/xmpp/rostermoduleimpl.h @@ -11,6 +11,8 @@ #ifndef WEBRTC_LIBJINGLE_XMPP_XMPPTHREAD_H_ #define WEBRTC_LIBJINGLE_XMPP_XMPPTHREAD_H_ +#include + #include "webrtc/libjingle/xmpp/moduleimpl.h" #include "webrtc/libjingle/xmpp/rostermodule.h" @@ -86,7 +88,7 @@ private: // Store everything in the XML element. If this becomes a perf issue we can // cache the data. - rtc::scoped_ptr raw_xml_; + std::unique_ptr raw_xml_; }; //! A contact as given by the server @@ -151,7 +153,7 @@ private: int group_count_; int group_index_returned_; XmlElement * group_returned_; - rtc::scoped_ptr raw_xml_; + std::unique_ptr raw_xml_; }; //! An XmppModule for handle roster and presence functionality @@ -273,11 +275,11 @@ private: typedef std::vector PresenceVector; typedef std::map JidPresenceVectorMap; - rtc::scoped_ptr incoming_presence_map_; - rtc::scoped_ptr incoming_presence_vector_; + std::unique_ptr incoming_presence_map_; + std::unique_ptr incoming_presence_vector_; typedef std::vector ContactVector; - rtc::scoped_ptr contacts_; + std::unique_ptr contacts_; }; } diff --git a/webrtc/libjingle/xmpp/xmppclient.cc b/webrtc/libjingle/xmpp/xmppclient.cc index f7e88c3927..a87659824b 100644 --- a/webrtc/libjingle/xmpp/xmppclient.cc +++ b/webrtc/libjingle/xmpp/xmppclient.cc @@ -15,7 +15,6 @@ #include "webrtc/libjingle/xmpp/prexmppauth.h" #include "webrtc/libjingle/xmpp/saslplainmechanism.h" #include "webrtc/base/logging.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/base/sigslot.h" #include "webrtc/base/stringutils.h" #include "xmpptask.h" @@ -48,9 +47,9 @@ public: XmppClient* const client_; // the two main objects - rtc::scoped_ptr socket_; - rtc::scoped_ptr engine_; - rtc::scoped_ptr pre_auth_; + std::unique_ptr socket_; + std::unique_ptr engine_; + std::unique_ptr pre_auth_; rtc::CryptString pass_; std::string auth_mechanism_; std::string auth_token_; diff --git a/webrtc/libjingle/xmpp/xmppclient.h b/webrtc/libjingle/xmpp/xmppclient.h index 84ca6c1418..dba591cb44 100644 --- a/webrtc/libjingle/xmpp/xmppclient.h +++ b/webrtc/libjingle/xmpp/xmppclient.h @@ -11,7 +11,9 @@ #ifndef WEBRTC_LIBJINGLE_XMPP_XMPPCLIENT_H_ #define WEBRTC_LIBJINGLE_XMPP_XMPPCLIENT_H_ +#include #include + #include "webrtc/libjingle/xmpp/asyncsocket.h" #include "webrtc/libjingle/xmpp/xmppclientsettings.h" #include "webrtc/libjingle/xmpp/xmppengine.h" @@ -136,7 +138,7 @@ public: class Private; friend class Private; - rtc::scoped_ptr d_; + std::unique_ptr d_; bool delivering_signal_; bool valid_; diff --git a/webrtc/libjingle/xmpp/xmppengine_unittest.cc b/webrtc/libjingle/xmpp/xmppengine_unittest.cc index 7af151ba48..d5afead660 100644 --- a/webrtc/libjingle/xmpp/xmppengine_unittest.cc +++ b/webrtc/libjingle/xmpp/xmppengine_unittest.cc @@ -9,8 +9,10 @@ */ #include +#include #include #include + #include "webrtc/libjingle/xmllite/xmlelement.h" #include "webrtc/libjingle/xmpp/constants.h" #include "webrtc/libjingle/xmpp/plainsaslhandler.h" @@ -77,8 +79,8 @@ class XmppEngineTest : public testing::Test { void RunLogin(); private: - rtc::scoped_ptr engine_; - rtc::scoped_ptr handler_; + std::unique_ptr engine_; + std::unique_ptr handler_; }; void XmppEngineTest::RunLogin() { diff --git a/webrtc/libjingle/xmpp/xmppengineimpl.h b/webrtc/libjingle/xmpp/xmppengineimpl.h index c322596c46..e1f3061f90 100644 --- a/webrtc/libjingle/xmpp/xmppengineimpl.h +++ b/webrtc/libjingle/xmpp/xmppengineimpl.h @@ -11,8 +11,10 @@ #ifndef WEBRTC_LIBJINGLE_XMPP_XMPPENGINEIMPL_H_ #define WEBRTC_LIBJINGLE_XMPP_XMPPENGINEIMPL_H_ +#include #include #include + #include "webrtc/libjingle/xmpp/xmppengine.h" #include "webrtc/libjingle/xmpp/xmppstanzaparser.h" @@ -233,7 +235,7 @@ class XmppEngineImpl : public XmppEngine { TlsOptions tls_option_; std::string tls_server_hostname_; std::string tls_server_domain_; - rtc::scoped_ptr login_task_; + std::unique_ptr login_task_; std::string lang_; int next_id_; @@ -242,7 +244,7 @@ class XmppEngineImpl : public XmppEngine { bool encrypted_; Error error_code_; int subcode_; - rtc::scoped_ptr stream_error_; + std::unique_ptr stream_error_; bool raised_reset_; XmppOutputHandler* output_handler_; XmppSessionHandler* session_handler_; @@ -250,14 +252,14 @@ class XmppEngineImpl : public XmppEngine { XmlnsStack xmlns_stack_; typedef std::vector StanzaHandlerVector; - rtc::scoped_ptr stanza_handlers_[HL_COUNT]; + std::unique_ptr stanza_handlers_[HL_COUNT]; typedef std::vector IqEntryVector; - rtc::scoped_ptr iq_entries_; + std::unique_ptr iq_entries_; - rtc::scoped_ptr sasl_handler_; + std::unique_ptr sasl_handler_; - rtc::scoped_ptr output_; + std::unique_ptr output_; }; } // namespace buzz diff --git a/webrtc/libjingle/xmpp/xmpplogintask.h b/webrtc/libjingle/xmpp/xmpplogintask.h index f69a648394..d47388dd7a 100644 --- a/webrtc/libjingle/xmpp/xmpplogintask.h +++ b/webrtc/libjingle/xmpp/xmpplogintask.h @@ -11,6 +11,7 @@ #ifndef WEBRTC_LIBJINGLE_XMPP_LOGINTASK_H_ #define WEBRTC_LIBJINGLE_XMPP_LOGINTASK_H_ +#include #include #include @@ -70,12 +71,12 @@ private: const XmlElement * pelStanza_; bool isStart_; std::string iqId_; - rtc::scoped_ptr pelFeatures_; + std::unique_ptr pelFeatures_; Jid fullJid_; std::string streamId_; - rtc::scoped_ptr > pvecQueuedStanzas_; + std::unique_ptr > pvecQueuedStanzas_; - rtc::scoped_ptr sasl_mech_; + std::unique_ptr sasl_mech_; #if !defined(NDEBUG) static const rtc::ConstantLabel LOGINTASK_STATES[]; diff --git a/webrtc/libjingle/xmpp/xmpplogintask_unittest.cc b/webrtc/libjingle/xmpp/xmpplogintask_unittest.cc index 221cbdeaf5..f3060bd559 100644 --- a/webrtc/libjingle/xmpp/xmpplogintask_unittest.cc +++ b/webrtc/libjingle/xmpp/xmpplogintask_unittest.cc @@ -9,8 +9,10 @@ */ #include +#include #include #include + #include "webrtc/libjingle/xmllite/xmlelement.h" #include "webrtc/libjingle/xmpp/constants.h" #include "webrtc/libjingle/xmpp/plainsaslhandler.h" @@ -67,8 +69,8 @@ class XmppLoginTaskTest : public testing::Test { void SetTlsOptions(buzz::TlsOptions option); private: - rtc::scoped_ptr engine_; - rtc::scoped_ptr handler_; + std::unique_ptr engine_; + std::unique_ptr handler_; }; void XmppLoginTaskTest::SetTlsOptions(buzz::TlsOptions option) { diff --git a/webrtc/libjingle/xmpp/xmpptask.h b/webrtc/libjingle/xmpp/xmpptask.h index 36ffe1b098..3f3a39c791 100644 --- a/webrtc/libjingle/xmpp/xmpptask.h +++ b/webrtc/libjingle/xmpp/xmpptask.h @@ -12,7 +12,9 @@ #define WEBRTC_LIBJINGLE_XMPP_XMPPTASK_H_ #include +#include #include + #include "webrtc/libjingle/xmpp/xmppengine.h" #include "webrtc/base/constructormagic.h" #include "webrtc/base/sigslot.h" @@ -160,7 +162,7 @@ private: bool stopped_; std::deque stanza_queue_; - rtc::scoped_ptr next_stanza_; + std::unique_ptr next_stanza_; std::string id_; #if !defined(NDEBUG)