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

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

Issue 1893083002: Change scoped_ptr to std::unique_ptr in //net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-net-all: iwyu Created 4 years, 8 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> 7 #include <utility>
8 8
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/socket/stream_socket.h" 10 #include "net/socket/stream_socket.h"
11 11
12 namespace net { 12 namespace net {
13 namespace test_server { 13 namespace test_server {
14 14
15 HttpConnection::HttpConnection(scoped_ptr<StreamSocket> socket, 15 HttpConnection::HttpConnection(std::unique_ptr<StreamSocket> socket,
16 const HandleRequestCallback& callback) 16 const HandleRequestCallback& callback)
17 : socket_(std::move(socket)), 17 : socket_(std::move(socket)),
18 callback_(callback), 18 callback_(callback),
19 read_buf_(new IOBufferWithSize(4096)), 19 read_buf_(new IOBufferWithSize(4096)),
20 weak_factory_(this) {} 20 weak_factory_(this) {}
21 21
22 HttpConnection::~HttpConnection() { 22 HttpConnection::~HttpConnection() {
23 weak_factory_.InvalidateWeakPtrs(); 23 weak_factory_.InvalidateWeakPtrs();
24 } 24 }
25 25
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 buf->DidConsume(rv); 77 buf->DidConsume(rv);
78 SendInternal(callback, buf); 78 SendInternal(callback, buf);
79 } 79 }
80 80
81 base::WeakPtr<HttpConnection> HttpConnection::GetWeakPtr() { 81 base::WeakPtr<HttpConnection> HttpConnection::GetWeakPtr() {
82 return weak_factory_.GetWeakPtr(); 82 return weak_factory_.GetWeakPtr();
83 } 83 }
84 84
85 } // namespace test_server 85 } // namespace test_server
86 } // namespace net 86 } // namespace net
OLDNEW
« no previous file with comments | « net/test/embedded_test_server/http_connection.h ('k') | net/test/embedded_test_server/http_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698