summaryrefslogtreecommitdiffstats
path: root/remoting/protocol
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-01 04:16:27 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-01 04:16:27 +0000
commitad8e04ac88be37d5ccb6c2cf61f52b224dca493c (patch)
tree9bcb878643bdd9e5af6749fff469b2552e569907 /remoting/protocol
parent5af8043eb24ad60251d8a4e33192e3e6f59246a3 (diff)
downloadchromium_src-ad8e04ac88be37d5ccb6c2cf61f52b224dca493c.zip
chromium_src-ad8e04ac88be37d5ccb6c2cf61f52b224dca493c.tar.gz
chromium_src-ad8e04ac88be37d5ccb6c2cf61f52b224dca493c.tar.bz2
Convert implicit scoped_refptr constructor calls to explicit ones, part 1
This CL was created automatically by this clang rewriter: http://codereview.appspot.com/2776043/ . I manually fixed a few rough spots of the rewriter output (doh1-3) and fixed all presubmit errors. BUG=28083 TEST=None Review URL: http://codereview.chromium.org/4192012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64573 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol')
-rw-r--r--remoting/protocol/host_message_dispatcher.cc4
-rw-r--r--remoting/protocol/jingle_chromotocol_connection_unittest.cc27
-rw-r--r--remoting/protocol/jingle_chromotocol_server.cc4
-rw-r--r--remoting/protocol/message_decoder_unittest.cc2
-rw-r--r--remoting/protocol/protocol_test_client.cc4
-rw-r--r--remoting/protocol/util.cc2
6 files changed, 22 insertions, 21 deletions
diff --git a/remoting/protocol/host_message_dispatcher.cc b/remoting/protocol/host_message_dispatcher.cc
index 818934f..768789e 100644
--- a/remoting/protocol/host_message_dispatcher.cc
+++ b/remoting/protocol/host_message_dispatcher.cc
@@ -46,8 +46,8 @@ bool HostMessageDispatcher::Initialize(
void HostMessageDispatcher::OnControlMessageReceived(
ClientControlMessage* message) {
- scoped_refptr<RefCountedMessage<ClientControlMessage> > ref_msg =
- new RefCountedMessage<ClientControlMessage>(message);
+ scoped_refptr<RefCountedMessage<ClientControlMessage> > ref_msg(
+ new RefCountedMessage<ClientControlMessage>(message));
if (message->has_suggest_screen_resolution_request()) {
control_message_handler_->OnSuggestScreenResolutionRequest(
message->suggest_screen_resolution_request(),
diff --git a/remoting/protocol/jingle_chromotocol_connection_unittest.cc b/remoting/protocol/jingle_chromotocol_connection_unittest.cc
index d8f12cd..2d0cb8e 100644
--- a/remoting/protocol/jingle_chromotocol_connection_unittest.cc
+++ b/remoting/protocol/jingle_chromotocol_connection_unittest.cc
@@ -118,10 +118,11 @@ class JingleChromotocolConnectionTest : public testing::Test {
&MockServerCallback::OnIncomingConnection));
client_server_ = new JingleChromotocolServer(&thread_);
client_server_->set_allow_local_ips(true);
- client_server_->Init(SessionManagerPair::kClientJid,
- session_manager_pair_->client_session_manager(),
- NewCallback(&client_server_callback_,
- &MockServerCallback::OnIncomingConnection));
+ client_server_->Init(
+ SessionManagerPair::kClientJid,
+ session_manager_pair_->client_session_manager(),
+ NewCallback(&client_server_callback_,
+ &MockServerCallback::OnIncomingConnection));
}
bool InitiateConnection() {
@@ -422,7 +423,7 @@ class UDPChannelTester : public ChannelTesterBase {
return;
}
- scoped_refptr<net::IOBuffer> packet = new net::IOBuffer(kMessageSize);
+ scoped_refptr<net::IOBuffer> packet(new net::IOBuffer(kMessageSize));
memset(packet->data(), 123, kMessageSize);
sent_packets_[packets_sent_] = packet;
// Put index of this packet in the beginning of the packet body.
@@ -551,9 +552,9 @@ TEST_F(JingleChromotocolConnectionTest, Connect) {
TEST_F(JingleChromotocolConnectionTest, TestControlChannel) {
CreateServerPair();
ASSERT_TRUE(InitiateConnection());
- scoped_refptr<TCPChannelTester> tester =
+ scoped_refptr<TCPChannelTester> tester(
new TCPChannelTester(thread_.message_loop(), host_connection_,
- client_connection_);
+ client_connection_));
tester->Start(ChannelTesterBase::CONTROL);
ASSERT_TRUE(tester->WaitFinished());
tester->CheckResults();
@@ -567,9 +568,9 @@ TEST_F(JingleChromotocolConnectionTest, TestControlChannel) {
TEST_F(JingleChromotocolConnectionTest, TestVideoChannel) {
CreateServerPair();
ASSERT_TRUE(InitiateConnection());
- scoped_refptr<TCPChannelTester> tester =
+ scoped_refptr<TCPChannelTester> tester(
new TCPChannelTester(thread_.message_loop(), host_connection_,
- client_connection_);
+ client_connection_));
tester->Start(ChannelTesterBase::VIDEO);
ASSERT_TRUE(tester->WaitFinished());
tester->CheckResults();
@@ -582,9 +583,9 @@ TEST_F(JingleChromotocolConnectionTest, TestVideoChannel) {
TEST_F(JingleChromotocolConnectionTest, TestEventChannel) {
CreateServerPair();
ASSERT_TRUE(InitiateConnection());
- scoped_refptr<TCPChannelTester> tester =
+ scoped_refptr<TCPChannelTester> tester(
new TCPChannelTester(thread_.message_loop(), host_connection_,
- client_connection_);
+ client_connection_));
tester->Start(ChannelTesterBase::EVENT);
ASSERT_TRUE(tester->WaitFinished());
tester->CheckResults();
@@ -597,9 +598,9 @@ TEST_F(JingleChromotocolConnectionTest, TestEventChannel) {
TEST_F(JingleChromotocolConnectionTest, TestVideoRtpChannel) {
CreateServerPair();
ASSERT_TRUE(InitiateConnection());
- scoped_refptr<UDPChannelTester> tester =
+ scoped_refptr<UDPChannelTester> tester(
new UDPChannelTester(thread_.message_loop(), host_connection_,
- client_connection_);
+ client_connection_));
tester->Start(ChannelTesterBase::VIDEO_RTP);
ASSERT_TRUE(tester->WaitFinished());
tester->CheckResults();
diff --git a/remoting/protocol/jingle_chromotocol_server.cc b/remoting/protocol/jingle_chromotocol_server.cc
index 796c63b..2300243 100644
--- a/remoting/protocol/jingle_chromotocol_server.cc
+++ b/remoting/protocol/jingle_chromotocol_server.cc
@@ -223,8 +223,8 @@ scoped_refptr<ChromotocolConnection> JingleChromotocolServer::Connect(
CandidateChromotocolConfig* chromotocol_config,
ChromotocolConnection::StateChangeCallback* state_change_callback) {
// Can be called from any thread.
- scoped_refptr<JingleChromotocolConnection> connection =
- new JingleChromotocolConnection(this);
+ scoped_refptr<JingleChromotocolConnection> connection(
+ new JingleChromotocolConnection(this));
connection->set_candidate_config(chromotocol_config);
message_loop()->PostTask(
FROM_HERE, NewRunnableMethod(this, &JingleChromotocolServer::DoConnect,
diff --git a/remoting/protocol/message_decoder_unittest.cc b/remoting/protocol/message_decoder_unittest.cc
index c2772c8..a2d4b20 100644
--- a/remoting/protocol/message_decoder_unittest.cc
+++ b/remoting/protocol/message_decoder_unittest.cc
@@ -83,7 +83,7 @@ void SimulateReadSequence(const int read_sequence[], int sequence_size) {
int read = std::min(size - i, read_sequence[i % sequence_size]);
// And then prepare an IOBuffer for feeding it.
- scoped_refptr<net::IOBuffer> buffer = new net::IOBuffer(read);
+ scoped_refptr<net::IOBuffer> buffer(new net::IOBuffer(read));
memcpy(buffer->data(), test_data + i, read);
decoder.ParseMessages(buffer, read, &message_list);
i += read;
diff --git a/remoting/protocol/protocol_test_client.cc b/remoting/protocol/protocol_test_client.cc
index 8113db7..d61c0b5 100644
--- a/remoting/protocol/protocol_test_client.cc
+++ b/remoting/protocol/protocol_test_client.cc
@@ -125,7 +125,7 @@ void ProtocolTestConnection::Write(const std::string& str) {
if (str.empty())
return;
- scoped_refptr<net::IOBuffer> buf = new net::IOBuffer(str.length());
+ scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(str.length()));
memcpy(buf->data(), str.c_str(), str.length());
message_loop_->PostTask(
FROM_HERE, NewRunnableMethod(
@@ -362,7 +362,7 @@ int main(int argc, char** argv) {
usage(argv[0]);
std::string auth_token(cmd_line->GetSwitchValueASCII("auth_token"));
- scoped_refptr<ProtocolTestClient> client = new ProtocolTestClient();
+ scoped_refptr<ProtocolTestClient> client(new ProtocolTestClient());
client->Run(username, auth_token, host_jid);
diff --git a/remoting/protocol/util.cc b/remoting/protocol/util.cc
index 5a23c93..a12040b 100644
--- a/remoting/protocol/util.cc
+++ b/remoting/protocol/util.cc
@@ -18,7 +18,7 @@ scoped_refptr<net::IOBufferWithSize> SerializeAndFrameMessage(
// int32 of the serialized message size for framing.
const int kExtraBytes = sizeof(int32);
int size = msg.ByteSize() + kExtraBytes;
- scoped_refptr<net::IOBufferWithSize> buffer = new net::IOBufferWithSize(size);
+ scoped_refptr<net::IOBufferWithSize> buffer(new net::IOBufferWithSize(size));
talk_base::SetBE32(buffer->data(), msg.GetCachedSize());
msg.SerializeWithCachedSizesToArray(
reinterpret_cast<uint8*>(buffer->data()) + kExtraBytes);