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

Side by Side Diff: net/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
« no previous file with comments | « net/server/http_connection.h ('k') | net/server/http_server.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/server/http_connection.h" 5 #include "net/server/http_connection.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "net/server/web_socket.h" 10 #include "net/server/web_socket.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 if (IsEmpty()) { 143 if (IsEmpty()) {
144 DCHECK_EQ(0, total_size_); 144 DCHECK_EQ(0, total_size_);
145 return 0; 145 return 0;
146 } 146 }
147 DCHECK_GE(data_, pending_data_.front().data()); 147 DCHECK_GE(data_, pending_data_.front().data());
148 int consumed = static_cast<int>(data_ - pending_data_.front().data()); 148 int consumed = static_cast<int>(data_ - pending_data_.front().data());
149 DCHECK_GT(static_cast<int>(pending_data_.front().size()), consumed); 149 DCHECK_GT(static_cast<int>(pending_data_.front().size()), consumed);
150 return pending_data_.front().size() - consumed; 150 return pending_data_.front().size() - consumed;
151 } 151 }
152 152
153 HttpConnection::HttpConnection(int id, scoped_ptr<StreamSocket> socket) 153 HttpConnection::HttpConnection(int id, std::unique_ptr<StreamSocket> socket)
154 : id_(id), 154 : id_(id),
155 socket_(std::move(socket)), 155 socket_(std::move(socket)),
156 read_buf_(new ReadIOBuffer()), 156 read_buf_(new ReadIOBuffer()),
157 write_buf_(new QueuedWriteIOBuffer()) {} 157 write_buf_(new QueuedWriteIOBuffer()) {}
158 158
159 HttpConnection::~HttpConnection() { 159 HttpConnection::~HttpConnection() {
160 } 160 }
161 161
162 void HttpConnection::SetWebSocket(scoped_ptr<WebSocket> web_socket) { 162 void HttpConnection::SetWebSocket(std::unique_ptr<WebSocket> web_socket) {
163 DCHECK(!web_socket_); 163 DCHECK(!web_socket_);
164 web_socket_ = std::move(web_socket); 164 web_socket_ = std::move(web_socket);
165 } 165 }
166 166
167 } // namespace net 167 } // namespace net
OLDNEW
« no previous file with comments | « net/server/http_connection.h ('k') | net/server/http_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698