| 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_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 5 #ifndef NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
| 6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 virtual int64 GetTotalReceivedBytes() const OVERRIDE; | 65 virtual int64 GetTotalReceivedBytes() const OVERRIDE; |
| 66 virtual void DoneReading() OVERRIDE {} | 66 virtual void DoneReading() OVERRIDE {} |
| 67 virtual const HttpResponseInfo* GetResponseInfo() const OVERRIDE; | 67 virtual const HttpResponseInfo* GetResponseInfo() const OVERRIDE; |
| 68 virtual LoadState GetLoadState() const OVERRIDE; | 68 virtual LoadState GetLoadState() const OVERRIDE; |
| 69 virtual UploadProgress GetUploadProgress() const OVERRIDE; | 69 virtual UploadProgress GetUploadProgress() const OVERRIDE; |
| 70 virtual bool GetLoadTimingInfo( | 70 virtual bool GetLoadTimingInfo( |
| 71 LoadTimingInfo* load_timing_info) const OVERRIDE; | 71 LoadTimingInfo* load_timing_info) const OVERRIDE; |
| 72 virtual void SetPriority(RequestPriority priority) OVERRIDE; | 72 virtual void SetPriority(RequestPriority priority) OVERRIDE; |
| 73 virtual void SetWebSocketHandshakeStreamCreateHelper( | 73 virtual void SetWebSocketHandshakeStreamCreateHelper( |
| 74 WebSocketHandshakeStreamBase::CreateHelper* create_helper) OVERRIDE; | 74 WebSocketHandshakeStreamBase::CreateHelper* create_helper) OVERRIDE; |
| 75 virtual void SetBeforeNetworkStartCallback( |
| 76 const base::Callback<void(bool*)>& callback) OVERRIDE; |
| 77 virtual int ResumeNetworkStart() OVERRIDE; |
| 75 | 78 |
| 76 // HttpStreamRequest::Delegate methods: | 79 // HttpStreamRequest::Delegate methods: |
| 77 virtual void OnStreamReady(const SSLConfig& used_ssl_config, | 80 virtual void OnStreamReady(const SSLConfig& used_ssl_config, |
| 78 const ProxyInfo& used_proxy_info, | 81 const ProxyInfo& used_proxy_info, |
| 79 HttpStreamBase* stream) OVERRIDE; | 82 HttpStreamBase* stream) OVERRIDE; |
| 80 virtual void OnWebSocketHandshakeStreamReady( | 83 virtual void OnWebSocketHandshakeStreamReady( |
| 81 const SSLConfig& used_ssl_config, | 84 const SSLConfig& used_ssl_config, |
| 82 const ProxyInfo& used_proxy_info, | 85 const ProxyInfo& used_proxy_info, |
| 83 WebSocketHandshakeStreamBase* stream) OVERRIDE; | 86 WebSocketHandshakeStreamBase* stream) OVERRIDE; |
| 84 virtual void OnStreamFailed(int status, | 87 virtual void OnStreamFailed(int status, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 110 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, | 113 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, |
| 111 WindowUpdateOverflow); | 114 WindowUpdateOverflow); |
| 112 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, | 115 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, |
| 113 FlowControlStallResume); | 116 FlowControlStallResume); |
| 114 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, | 117 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, |
| 115 FlowControlStallResumeAfterSettings); | 118 FlowControlStallResumeAfterSettings); |
| 116 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, | 119 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, |
| 117 FlowControlNegativeSendWindowSize); | 120 FlowControlNegativeSendWindowSize); |
| 118 | 121 |
| 119 enum State { | 122 enum State { |
| 123 STATE_NOTIFY_BEFORE_CREATE_STREAM, |
| 120 STATE_CREATE_STREAM, | 124 STATE_CREATE_STREAM, |
| 121 STATE_CREATE_STREAM_COMPLETE, | 125 STATE_CREATE_STREAM_COMPLETE, |
| 122 STATE_INIT_STREAM, | 126 STATE_INIT_STREAM, |
| 123 STATE_INIT_STREAM_COMPLETE, | 127 STATE_INIT_STREAM_COMPLETE, |
| 124 STATE_GENERATE_PROXY_AUTH_TOKEN, | 128 STATE_GENERATE_PROXY_AUTH_TOKEN, |
| 125 STATE_GENERATE_PROXY_AUTH_TOKEN_COMPLETE, | 129 STATE_GENERATE_PROXY_AUTH_TOKEN_COMPLETE, |
| 126 STATE_GENERATE_SERVER_AUTH_TOKEN, | 130 STATE_GENERATE_SERVER_AUTH_TOKEN, |
| 127 STATE_GENERATE_SERVER_AUTH_TOKEN_COMPLETE, | 131 STATE_GENERATE_SERVER_AUTH_TOKEN_COMPLETE, |
| 128 STATE_INIT_REQUEST_BODY, | 132 STATE_INIT_REQUEST_BODY, |
| 129 STATE_INIT_REQUEST_BODY_COMPLETE, | 133 STATE_INIT_REQUEST_BODY_COMPLETE, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 145 void DoCallback(int result); | 149 void DoCallback(int result); |
| 146 void OnIOComplete(int result); | 150 void OnIOComplete(int result); |
| 147 | 151 |
| 148 // Runs the state transition loop. | 152 // Runs the state transition loop. |
| 149 int DoLoop(int result); | 153 int DoLoop(int result); |
| 150 | 154 |
| 151 // Each of these methods corresponds to a State value. Those with an input | 155 // Each of these methods corresponds to a State value. Those with an input |
| 152 // argument receive the result from the previous state. If a method returns | 156 // argument receive the result from the previous state. If a method returns |
| 153 // ERR_IO_PENDING, then the result from OnIOComplete will be passed to the | 157 // ERR_IO_PENDING, then the result from OnIOComplete will be passed to the |
| 154 // next state method as the result arg. | 158 // next state method as the result arg. |
| 159 int DoNotifyBeforeCreateStream(); |
| 155 int DoCreateStream(); | 160 int DoCreateStream(); |
| 156 int DoCreateStreamComplete(int result); | 161 int DoCreateStreamComplete(int result); |
| 157 int DoInitStream(); | 162 int DoInitStream(); |
| 158 int DoInitStreamComplete(int result); | 163 int DoInitStreamComplete(int result); |
| 159 int DoGenerateProxyAuthToken(); | 164 int DoGenerateProxyAuthToken(); |
| 160 int DoGenerateProxyAuthTokenComplete(int result); | 165 int DoGenerateProxyAuthTokenComplete(int result); |
| 161 int DoGenerateServerAuthToken(); | 166 int DoGenerateServerAuthToken(); |
| 162 int DoGenerateServerAuthTokenComplete(int result); | 167 int DoGenerateServerAuthTokenComplete(int result); |
| 163 int DoInitRequestBody(); | 168 int DoInitRequestBody(); |
| 164 int DoInitRequestBodyComplete(int result); | 169 int DoInitRequestBodyComplete(int result); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 | 330 |
| 326 // True when the tunnel is in the process of being established - we can't | 331 // True when the tunnel is in the process of being established - we can't |
| 327 // read from the socket until the tunnel is done. | 332 // read from the socket until the tunnel is done. |
| 328 bool establishing_tunnel_; | 333 bool establishing_tunnel_; |
| 329 | 334 |
| 330 // The helper object to use to create WebSocketHandshakeStreamBase | 335 // The helper object to use to create WebSocketHandshakeStreamBase |
| 331 // objects. Only relevant when establishing a WebSocket connection. | 336 // objects. Only relevant when establishing a WebSocket connection. |
| 332 WebSocketHandshakeStreamBase::CreateHelper* | 337 WebSocketHandshakeStreamBase::CreateHelper* |
| 333 websocket_handshake_stream_base_create_helper_; | 338 websocket_handshake_stream_base_create_helper_; |
| 334 | 339 |
| 340 base::Callback<void(bool*)> before_network_start_callback_; |
| 341 |
| 335 DISALLOW_COPY_AND_ASSIGN(HttpNetworkTransaction); | 342 DISALLOW_COPY_AND_ASSIGN(HttpNetworkTransaction); |
| 336 }; | 343 }; |
| 337 | 344 |
| 338 } // namespace net | 345 } // namespace net |
| 339 | 346 |
| 340 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 347 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
| OLD | NEW |