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_SOCKET_STREAM_SOCKET_STREAM_H_ | 5 #ifndef NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
6 #define NET_SOCKET_STREAM_SOCKET_STREAM_H_ | 6 #define NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 public: | 205 public: |
206 RequestHeaders() : IOBuffer() {} | 206 RequestHeaders() : IOBuffer() {} |
207 | 207 |
208 void SetDataOffset(size_t offset) { | 208 void SetDataOffset(size_t offset) { |
209 data_ = const_cast<char*>(headers_.data()) + offset; | 209 data_ = const_cast<char*>(headers_.data()) + offset; |
210 } | 210 } |
211 | 211 |
212 std::string headers_; | 212 std::string headers_; |
213 | 213 |
214 private: | 214 private: |
215 virtual ~RequestHeaders(); | 215 ~RequestHeaders() override; |
216 }; | 216 }; |
217 | 217 |
218 class ResponseHeaders : public IOBuffer { | 218 class ResponseHeaders : public IOBuffer { |
219 public: | 219 public: |
220 ResponseHeaders(); | 220 ResponseHeaders(); |
221 | 221 |
222 void SetDataOffset(size_t offset) { data_ = headers_.get() + offset; } | 222 void SetDataOffset(size_t offset) { data_ = headers_.get() + offset; } |
223 char* headers() const { return headers_.get(); } | 223 char* headers() const { return headers_.get(); } |
224 void Reset() { headers_.reset(); } | 224 void Reset() { headers_.reset(); } |
225 void Realloc(size_t new_size); | 225 void Realloc(size_t new_size); |
226 | 226 |
227 private: | 227 private: |
228 virtual ~ResponseHeaders(); | 228 ~ResponseHeaders() override; |
229 | 229 |
230 scoped_ptr<char, base::FreeDeleter> headers_; | 230 scoped_ptr<char, base::FreeDeleter> headers_; |
231 }; | 231 }; |
232 | 232 |
233 enum State { | 233 enum State { |
234 STATE_NONE, | 234 STATE_NONE, |
235 STATE_BEFORE_CONNECT, | 235 STATE_BEFORE_CONNECT, |
236 STATE_BEFORE_CONNECT_COMPLETE, | 236 STATE_BEFORE_CONNECT_COMPLETE, |
237 STATE_RESOLVE_PROXY, | 237 STATE_RESOLVE_PROXY, |
238 STATE_RESOLVE_PROXY_COMPLETE, | 238 STATE_RESOLVE_PROXY_COMPLETE, |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 // Cookie store to use for this socket stream. | 396 // Cookie store to use for this socket stream. |
397 scoped_refptr<CookieStore> cookie_store_; | 397 scoped_refptr<CookieStore> cookie_store_; |
398 | 398 |
399 DISALLOW_COPY_AND_ASSIGN(SocketStream); | 399 DISALLOW_COPY_AND_ASSIGN(SocketStream); |
400 }; | 400 }; |
401 | 401 |
402 } // namespace net | 402 } // namespace net |
403 | 403 |
404 #endif // NET_SOCKET_STREAM_SOCKET_STREAM_H_ | 404 #endif // NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
OLD | NEW |