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

Side by Side Diff: net/server/http_connection.h

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/sdch/sdch_owner_unittest.cc ('k') | net/server/http_connection.cc » ('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 #ifndef NET_SERVER_HTTP_CONNECTION_H_ 5 #ifndef NET_SERVER_HTTP_CONNECTION_H_
6 #define NET_SERVER_HTTP_CONNECTION_H_ 6 #define NET_SERVER_HTTP_CONNECTION_H_
7 7
8 #include <memory>
8 #include <queue> 9 #include <queue>
9 #include <string> 10 #include <string>
10 11
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "net/base/io_buffer.h" 14 #include "net/base/io_buffer.h"
15 15
16 namespace net { 16 namespace net {
17 17
18 class StreamSocket; 18 class StreamSocket;
19 class WebSocket; 19 class WebSocket;
20 20
21 // A container which has all information of an http connection. It includes 21 // A container which has all information of an http connection. It includes
22 // id, underlying socket, and pending read/write data. 22 // id, underlying socket, and pending read/write data.
23 class HttpConnection { 23 class HttpConnection {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 private: 103 private:
104 ~QueuedWriteIOBuffer() override; 104 ~QueuedWriteIOBuffer() override;
105 105
106 std::queue<std::string> pending_data_; 106 std::queue<std::string> pending_data_;
107 int total_size_; 107 int total_size_;
108 int max_buffer_size_; 108 int max_buffer_size_;
109 109
110 DISALLOW_COPY_AND_ASSIGN(QueuedWriteIOBuffer); 110 DISALLOW_COPY_AND_ASSIGN(QueuedWriteIOBuffer);
111 }; 111 };
112 112
113 HttpConnection(int id, scoped_ptr<StreamSocket> socket); 113 HttpConnection(int id, std::unique_ptr<StreamSocket> socket);
114 ~HttpConnection(); 114 ~HttpConnection();
115 115
116 int id() const { return id_; } 116 int id() const { return id_; }
117 StreamSocket* socket() const { return socket_.get(); } 117 StreamSocket* socket() const { return socket_.get(); }
118 ReadIOBuffer* read_buf() const { return read_buf_.get(); } 118 ReadIOBuffer* read_buf() const { return read_buf_.get(); }
119 QueuedWriteIOBuffer* write_buf() const { return write_buf_.get(); } 119 QueuedWriteIOBuffer* write_buf() const { return write_buf_.get(); }
120 120
121 WebSocket* web_socket() const { return web_socket_.get(); } 121 WebSocket* web_socket() const { return web_socket_.get(); }
122 void SetWebSocket(scoped_ptr<WebSocket> web_socket); 122 void SetWebSocket(std::unique_ptr<WebSocket> web_socket);
123 123
124 private: 124 private:
125 const int id_; 125 const int id_;
126 const scoped_ptr<StreamSocket> socket_; 126 const std::unique_ptr<StreamSocket> socket_;
127 const scoped_refptr<ReadIOBuffer> read_buf_; 127 const scoped_refptr<ReadIOBuffer> read_buf_;
128 const scoped_refptr<QueuedWriteIOBuffer> write_buf_; 128 const scoped_refptr<QueuedWriteIOBuffer> write_buf_;
129 129
130 scoped_ptr<WebSocket> web_socket_; 130 std::unique_ptr<WebSocket> web_socket_;
131 131
132 DISALLOW_COPY_AND_ASSIGN(HttpConnection); 132 DISALLOW_COPY_AND_ASSIGN(HttpConnection);
133 }; 133 };
134 134
135 } // namespace net 135 } // namespace net
136 136
137 #endif // NET_SERVER_HTTP_CONNECTION_H_ 137 #endif // NET_SERVER_HTTP_CONNECTION_H_
OLDNEW
« no previous file with comments | « net/sdch/sdch_owner_unittest.cc ('k') | net/server/http_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698