OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // A class that stores the common state between HttpBasicStream and | 5 // A class that stores the common state between HttpBasicStream and |
6 // WebSocketBasicHandshakeStream. | 6 // WebSocketBasicHandshakeStream. |
7 | 7 |
8 #ifndef NET_HTTP_HTTP_BASIC_STATE_H_ | 8 #ifndef NET_HTTP_HTTP_BASIC_STATE_H_ |
9 #define NET_HTTP_HTTP_BASIC_STATE_H_ | 9 #define NET_HTTP_HTTP_BASIC_STATE_H_ |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "net/base/completion_callback.h" | 16 #include "net/base/completion_callback.h" |
17 #include "net/base/net_export.h" | 17 #include "net/base/net_export.h" |
18 #include "net/base/request_priority.h" | 18 #include "net/base/request_priority.h" |
19 | 19 |
20 namespace net { | 20 namespace net { |
21 | 21 |
22 class BoundNetLog; | 22 class BoundNetLog; |
23 class ClientSocketHandle; | 23 class ClientSocketHandle; |
24 class GrowableIOBuffer; | 24 class GrowableIOBuffer; |
25 class HttpStreamParser; | 25 class HttpStreamParser; |
26 struct HttpRequestInfo; | 26 struct HttpRequestInfo; |
27 | 27 |
28 class NET_EXPORT_PRIVATE HttpBasicState { | 28 class NET_EXPORT_PRIVATE HttpBasicState { |
29 public: | 29 public: |
30 HttpBasicState(ClientSocketHandle* connection, bool using_proxy); | 30 HttpBasicState(std::unique_ptr<ClientSocketHandle> connection, |
| 31 bool using_proxy); |
31 ~HttpBasicState(); | 32 ~HttpBasicState(); |
32 | 33 |
33 // Initialize() must be called before using any of the other methods. | 34 // Initialize() must be called before using any of the other methods. |
34 int Initialize(const HttpRequestInfo* request_info, | 35 int Initialize(const HttpRequestInfo* request_info, |
35 RequestPriority priority, | 36 RequestPriority priority, |
36 const BoundNetLog& net_log, | 37 const BoundNetLog& net_log, |
37 const CompletionCallback& callback); | 38 const CompletionCallback& callback); |
38 | 39 |
39 HttpStreamParser* parser() const { return parser_.get(); } | 40 HttpStreamParser* parser() const { return parser_.get(); } |
40 | 41 |
(...skipping 22 matching lines...) Expand all Loading... |
63 const bool using_proxy_; | 64 const bool using_proxy_; |
64 | 65 |
65 const HttpRequestInfo* request_info_; | 66 const HttpRequestInfo* request_info_; |
66 | 67 |
67 DISALLOW_COPY_AND_ASSIGN(HttpBasicState); | 68 DISALLOW_COPY_AND_ASSIGN(HttpBasicState); |
68 }; | 69 }; |
69 | 70 |
70 } // namespace net | 71 } // namespace net |
71 | 72 |
72 #endif // NET_HTTP_HTTP_BASIC_STATE_H_ | 73 #endif // NET_HTTP_HTTP_BASIC_STATE_H_ |
OLD | NEW |