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

Side by Side Diff: chrome/test/chromedriver/net/test_http_server.cc

Issue 1551503002: Convert Pass()→std::move() in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/chromedriver/net/test_http_server.h" 5 #include "chrome/test/chromedriver/net/test_http_server.h"
6 6
7 #include <utility>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/location.h" 10 #include "base/location.h"
9 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
10 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
11 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
12 #include "base/time/time.h" 14 #include "base/time/time.h"
13 #include "net/base/ip_endpoint.h" 15 #include "net/base/ip_endpoint.h"
14 #include "net/base/net_errors.h" 16 #include "net/base/net_errors.h"
15 #include "net/server/http_server_request_info.h" 17 #include "net/server/http_server_request_info.h"
16 #include "net/socket/tcp_server_socket.h" 18 #include "net/socket/tcp_server_socket.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 connections_.erase(connection_id); 125 connections_.erase(connection_id);
124 if (connections_.empty()) 126 if (connections_.empty())
125 all_closed_event_.Signal(); 127 all_closed_event_.Signal();
126 } 128 }
127 129
128 void TestHttpServer::StartOnServerThread(bool* success, 130 void TestHttpServer::StartOnServerThread(bool* success,
129 base::WaitableEvent* event) { 131 base::WaitableEvent* event) {
130 scoped_ptr<net::ServerSocket> server_socket( 132 scoped_ptr<net::ServerSocket> server_socket(
131 new net::TCPServerSocket(NULL, net::NetLog::Source())); 133 new net::TCPServerSocket(NULL, net::NetLog::Source()));
132 server_socket->ListenWithAddressAndPort("127.0.0.1", 0, 1); 134 server_socket->ListenWithAddressAndPort("127.0.0.1", 0, 1);
133 server_.reset(new net::HttpServer(server_socket.Pass(), this)); 135 server_.reset(new net::HttpServer(std::move(server_socket), this));
134 136
135 net::IPEndPoint address; 137 net::IPEndPoint address;
136 int error = server_->GetLocalAddress(&address); 138 int error = server_->GetLocalAddress(&address);
137 EXPECT_EQ(net::OK, error); 139 EXPECT_EQ(net::OK, error);
138 if (error == net::OK) { 140 if (error == net::OK) {
139 base::AutoLock lock(url_lock_); 141 base::AutoLock lock(url_lock_);
140 web_socket_url_ = GURL(base::StringPrintf("ws://127.0.0.1:%d", 142 web_socket_url_ = GURL(base::StringPrintf("ws://127.0.0.1:%d",
141 address.port())); 143 address.port()));
142 } else { 144 } else {
143 server_.reset(NULL); 145 server_.reset(NULL);
144 } 146 }
145 *success = server_.get(); 147 *success = server_.get();
146 event->Signal(); 148 event->Signal();
147 } 149 }
148 150
149 void TestHttpServer::StopOnServerThread(base::WaitableEvent* event) { 151 void TestHttpServer::StopOnServerThread(base::WaitableEvent* event) {
150 server_.reset(NULL); 152 server_.reset(NULL);
151 event->Signal(); 153 event->Signal();
152 } 154 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698