Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_HTTP_HTTP_TRANSACTION_H_ | 5 #ifndef NET_HTTP_HTTP_TRANSACTION_H_ |
| 6 #define NET_HTTP_HTTP_TRANSACTION_H_ | 6 #define NET_HTTP_HTTP_TRANSACTION_H_ |
| 7 | 7 |
| 8 #include "net/base/completion_callback.h" | 8 #include "net/base/completion_callback.h" |
| 9 #include "net/base/load_states.h" | 9 #include "net/base/load_states.h" |
| 10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
| 11 #include "net/base/request_priority.h" | 11 #include "net/base/request_priority.h" |
| 12 #include "net/base/upload_progress.h" | 12 #include "net/base/upload_progress.h" |
| 13 #include "net/websockets/websocket_handshake_stream_base.h" | 13 #include "net/websockets/websocket_handshake_stream_base.h" |
| 14 | 14 |
| 15 namespace net { | 15 namespace net { |
| 16 | 16 |
| 17 class AuthCredentials; | 17 class AuthCredentials; |
| 18 class BoundNetLog; | 18 class BoundNetLog; |
| 19 class HttpRequestHeaders; | 19 class HttpRequestHeaders; |
| 20 struct HttpRequestInfo; | 20 struct HttpRequestInfo; |
| 21 class HttpResponseInfo; | 21 class HttpResponseInfo; |
| 22 class IOBuffer; | 22 class IOBuffer; |
| 23 struct LoadTimingInfo; | 23 struct LoadTimingInfo; |
| 24 class X509Certificate; | 24 class X509Certificate; |
| 25 class SSLHostInfo; | |
| 25 | 26 |
| 26 // Represents a single HTTP transaction (i.e., a single request/response pair). | 27 // Represents a single HTTP transaction (i.e., a single request/response pair). |
| 27 // HTTP redirects are not followed and authentication challenges are not | 28 // HTTP redirects are not followed and authentication challenges are not |
| 28 // answered. Cookies are assumed to be managed by the caller. | 29 // answered. Cookies are assumed to be managed by the caller. |
| 29 class NET_EXPORT_PRIVATE HttpTransaction { | 30 class NET_EXPORT_PRIVATE HttpTransaction { |
| 30 public: | 31 public: |
| 31 // If |*defer| is set to true, the transaction will wait until | 32 // If |*defer| is set to true, the transaction will wait until |
| 32 // ResumeNetworkStart is called before establishing a connection. | 33 // ResumeNetworkStart is called before establishing a connection. |
| 33 typedef base::Callback<void(bool* defer)> BeforeNetworkStartCallback; | 34 typedef base::Callback<void(bool* defer)> BeforeNetworkStartCallback; |
| 34 | 35 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 // info is not available. | 127 // info is not available. |
| 127 virtual const HttpResponseInfo* GetResponseInfo() const = 0; | 128 virtual const HttpResponseInfo* GetResponseInfo() const = 0; |
| 128 | 129 |
| 129 // Returns the load state for this transaction. | 130 // Returns the load state for this transaction. |
| 130 virtual LoadState GetLoadState() const = 0; | 131 virtual LoadState GetLoadState() const = 0; |
| 131 | 132 |
| 132 // Returns the upload progress in bytes. If there is no upload data, | 133 // Returns the upload progress in bytes. If there is no upload data, |
| 133 // zero will be returned. This does not include the request headers. | 134 // zero will be returned. This does not include the request headers. |
| 134 virtual UploadProgress GetUploadProgress() const = 0; | 135 virtual UploadProgress GetUploadProgress() const = 0; |
| 135 | 136 |
| 137 // SetSSLHostInfo sets a object which reads and writes public information | |
| 138 // about an SSL server. | |
| 139 virtual void SetSSLHostInfo(SSLHostInfo*) {}; | |
|
rvargas (doing something else)
2014/01/23 01:18:32
It seems better to maintain the pattern of the res
ramant (doing other things)
2014/01/23 18:50:03
Done.
| |
| 140 | |
| 136 // Populates all of load timing, except for request start times and receive | 141 // Populates all of load timing, except for request start times and receive |
| 137 // headers time. | 142 // headers time. |
| 138 // |load_timing_info| must have all null times when called. Returns false and | 143 // |load_timing_info| must have all null times when called. Returns false and |
| 139 // does not modify |load_timing_info| if there's no timing information to | 144 // does not modify |load_timing_info| if there's no timing information to |
| 140 // provide. | 145 // provide. |
| 141 virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const = 0; | 146 virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const = 0; |
| 142 | 147 |
| 143 // Called when the priority of the parent job changes. | 148 // Called when the priority of the parent job changes. |
| 144 virtual void SetPriority(RequestPriority priority) = 0; | 149 virtual void SetPriority(RequestPriority priority) = 0; |
| 145 | 150 |
| 146 // Set the WebSocketHandshakeStreamBase::CreateHelper to be used for the | 151 // Set the WebSocketHandshakeStreamBase::CreateHelper to be used for the |
| 147 // request. Only relevant to WebSocket transactions. Must be called before | 152 // request. Only relevant to WebSocket transactions. Must be called before |
| 148 // Start(). Ownership of |create_helper| remains with the caller. | 153 // Start(). Ownership of |create_helper| remains with the caller. |
| 149 virtual void SetWebSocketHandshakeStreamCreateHelper( | 154 virtual void SetWebSocketHandshakeStreamCreateHelper( |
| 150 WebSocketHandshakeStreamBase::CreateHelper* create_helper) = 0; | 155 WebSocketHandshakeStreamBase::CreateHelper* create_helper) = 0; |
| 151 | 156 |
| 152 // Set the callback to receive notification just before network use. | 157 // Set the callback to receive notification just before network use. |
| 153 virtual void SetBeforeNetworkStartCallback( | 158 virtual void SetBeforeNetworkStartCallback( |
| 154 const BeforeNetworkStartCallback& callback) = 0; | 159 const BeforeNetworkStartCallback& callback) = 0; |
| 155 | 160 |
| 156 // Resumes the transaction after being deferred. | 161 // Resumes the transaction after being deferred. |
| 157 virtual int ResumeNetworkStart() = 0; | 162 virtual int ResumeNetworkStart() = 0; |
| 158 }; | 163 }; |
| 159 | 164 |
| 160 } // namespace net | 165 } // namespace net |
| 161 | 166 |
| 162 #endif // NET_HTTP_HTTP_TRANSACTION_H_ | 167 #endif // NET_HTTP_HTTP_TRANSACTION_H_ |
| OLD | NEW |