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

Side by Side Diff: net/test/embedded_test_server/http_connection.cc

Issue 1545233002: Convert Pass()→std::move() in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/test/embedded_test_server/http_connection.h" 5 #include "net/test/embedded_test_server/http_connection.h"
6 6
7 #include <utility>
8
7 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
8 #include "net/socket/stream_socket.h" 10 #include "net/socket/stream_socket.h"
9 11
10 namespace net { 12 namespace net {
11 namespace test_server { 13 namespace test_server {
12 14
13 HttpConnection::HttpConnection(scoped_ptr<StreamSocket> socket, 15 HttpConnection::HttpConnection(scoped_ptr<StreamSocket> socket,
14 const HandleRequestCallback& callback) 16 const HandleRequestCallback& callback)
15 : socket_(socket.Pass()), 17 : socket_(std::move(socket)),
16 callback_(callback), 18 callback_(callback),
17 read_buf_(new IOBufferWithSize(4096)), 19 read_buf_(new IOBufferWithSize(4096)),
18 weak_factory_(this) {} 20 weak_factory_(this) {}
19 21
20 HttpConnection::~HttpConnection() { 22 HttpConnection::~HttpConnection() {
21 weak_factory_.InvalidateWeakPtrs(); 23 weak_factory_.InvalidateWeakPtrs();
22 } 24 }
23 25
24 void HttpConnection::SendResponseBytes(const std::string& response_string, 26 void HttpConnection::SendResponseBytes(const std::string& response_string,
25 const SendCompleteCallback& callback) { 27 const SendCompleteCallback& callback) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 buf->DidConsume(rv); 77 buf->DidConsume(rv);
76 SendInternal(callback, buf); 78 SendInternal(callback, buf);
77 } 79 }
78 80
79 base::WeakPtr<HttpConnection> HttpConnection::GetWeakPtr() { 81 base::WeakPtr<HttpConnection> HttpConnection::GetWeakPtr() {
80 return weak_factory_.GetWeakPtr(); 82 return weak_factory_.GetWeakPtr();
81 } 83 }
82 84
83 } // namespace test_server 85 } // namespace test_server
84 } // namespace net 86 } // namespace net
OLDNEW
« no previous file with comments | « net/test/embedded_test_server/embedded_test_server_unittest.cc ('k') | net/test/embedded_test_server/http_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698