OLD | NEW |
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 <queue> | 8 #include <queue> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // Removes consumed data and moves unconsumed data to the start of buffer. | 52 // Removes consumed data and moves unconsumed data to the start of buffer. |
53 void DidConsume(int bytes); | 53 void DidConsume(int bytes); |
54 | 54 |
55 // Limit of how much internal capacity can increase. | 55 // Limit of how much internal capacity can increase. |
56 int max_buffer_size() const { return max_buffer_size_; } | 56 int max_buffer_size() const { return max_buffer_size_; } |
57 void set_max_buffer_size(int max_buffer_size) { | 57 void set_max_buffer_size(int max_buffer_size) { |
58 max_buffer_size_ = max_buffer_size; | 58 max_buffer_size_ = max_buffer_size; |
59 } | 59 } |
60 | 60 |
61 private: | 61 private: |
62 virtual ~ReadIOBuffer(); | 62 ~ReadIOBuffer() override; |
63 | 63 |
64 scoped_refptr<GrowableIOBuffer> base_; | 64 scoped_refptr<GrowableIOBuffer> base_; |
65 int max_buffer_size_; | 65 int max_buffer_size_; |
66 | 66 |
67 DISALLOW_COPY_AND_ASSIGN(ReadIOBuffer); | 67 DISALLOW_COPY_AND_ASSIGN(ReadIOBuffer); |
68 }; | 68 }; |
69 | 69 |
70 // IOBuffer of pending data to write which has a queue of pending data. Each | 70 // IOBuffer of pending data to write which has a queue of pending data. Each |
71 // pending data is stored in std::string. data() is the data of first | 71 // pending data is stored in std::string. data() is the data of first |
72 // std::string stored. | 72 // std::string stored. |
(...skipping 21 matching lines...) Expand all Loading... |
94 // Total size of all pending data. | 94 // Total size of all pending data. |
95 int total_size() const { return total_size_; } | 95 int total_size() const { return total_size_; } |
96 | 96 |
97 // Limit of how much data can be pending. | 97 // Limit of how much data can be pending. |
98 int max_buffer_size() const { return max_buffer_size_; } | 98 int max_buffer_size() const { return max_buffer_size_; } |
99 void set_max_buffer_size(int max_buffer_size) { | 99 void set_max_buffer_size(int max_buffer_size) { |
100 max_buffer_size_ = max_buffer_size; | 100 max_buffer_size_ = max_buffer_size; |
101 } | 101 } |
102 | 102 |
103 private: | 103 private: |
104 virtual ~QueuedWriteIOBuffer(); | 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, scoped_ptr<StreamSocket> socket); |
114 ~HttpConnection(); | 114 ~HttpConnection(); |
(...skipping 13 matching lines...) Expand all Loading... |
128 const scoped_refptr<QueuedWriteIOBuffer> write_buf_; | 128 const scoped_refptr<QueuedWriteIOBuffer> write_buf_; |
129 | 129 |
130 scoped_ptr<WebSocket> web_socket_; | 130 scoped_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_ |
OLD | NEW |