Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(625)

Side by Side Diff: net/http/http_network_transaction.h

Issue 1127623005: Gather metrics classifying the cause of the TLS fallback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fallback-required
Patch Set: missing header Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "base/gtest_prod_util.h" 11 #include "base/gtest_prod_util.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/time/time.h" 14 #include "base/time/time.h"
15 #include "net/base/request_priority.h" 15 #include "net/base/request_priority.h"
16 #include "net/http/http_auth.h" 16 #include "net/http/http_auth.h"
17 #include "net/http/http_request_headers.h" 17 #include "net/http/http_request_headers.h"
18 #include "net/http/http_response_info.h" 18 #include "net/http/http_response_info.h"
19 #include "net/http/http_stream_factory.h" 19 #include "net/http/http_stream_factory.h"
20 #include "net/http/http_transaction.h" 20 #include "net/http/http_transaction.h"
21 #include "net/log/net_log.h" 21 #include "net/log/net_log.h"
22 #include "net/proxy/proxy_service.h" 22 #include "net/proxy/proxy_service.h"
23 #include "net/socket/connection_attempts.h" 23 #include "net/socket/connection_attempts.h"
24 #include "net/ssl/ssl_config_service.h" 24 #include "net/ssl/ssl_config_service.h"
25 #include "net/ssl/ssl_failure_state.h"
25 #include "net/websockets/websocket_handshake_stream_base.h" 26 #include "net/websockets/websocket_handshake_stream_base.h"
26 27
27 namespace net { 28 namespace net {
28 29
29 class ClientSocketHandle; 30 class ClientSocketHandle;
30 class HttpAuthController; 31 class HttpAuthController;
31 class HttpNetworkSession; 32 class HttpNetworkSession;
32 class HttpStream; 33 class HttpStream;
33 class HttpStreamRequest; 34 class HttpStreamRequest;
34 class IOBuffer; 35 class IOBuffer;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 int ResumeNetworkStart() override; 79 int ResumeNetworkStart() override;
79 80
80 // HttpStreamRequest::Delegate methods: 81 // HttpStreamRequest::Delegate methods:
81 void OnStreamReady(const SSLConfig& used_ssl_config, 82 void OnStreamReady(const SSLConfig& used_ssl_config,
82 const ProxyInfo& used_proxy_info, 83 const ProxyInfo& used_proxy_info,
83 HttpStream* stream) override; 84 HttpStream* stream) override;
84 void OnWebSocketHandshakeStreamReady( 85 void OnWebSocketHandshakeStreamReady(
85 const SSLConfig& used_ssl_config, 86 const SSLConfig& used_ssl_config,
86 const ProxyInfo& used_proxy_info, 87 const ProxyInfo& used_proxy_info,
87 WebSocketHandshakeStreamBase* stream) override; 88 WebSocketHandshakeStreamBase* stream) override;
88 void OnStreamFailed(int status, const SSLConfig& used_ssl_config) override; 89 void OnStreamFailed(int status,
90 const SSLConfig& used_ssl_config,
91 SSLFailureState ssl_failure_state) override;
89 void OnCertificateError(int status, 92 void OnCertificateError(int status,
90 const SSLConfig& used_ssl_config, 93 const SSLConfig& used_ssl_config,
91 const SSLInfo& ssl_info) override; 94 const SSLInfo& ssl_info) override;
92 void OnNeedsProxyAuth(const HttpResponseInfo& response_info, 95 void OnNeedsProxyAuth(const HttpResponseInfo& response_info,
93 const SSLConfig& used_ssl_config, 96 const SSLConfig& used_ssl_config,
94 const ProxyInfo& used_proxy_info, 97 const ProxyInfo& used_proxy_info,
95 HttpAuthController* auth_controller) override; 98 HttpAuthController* auth_controller) override;
96 void OnNeedsClientAuth(const SSLConfig& used_ssl_config, 99 void OnNeedsClientAuth(const SSLConfig& used_ssl_config,
97 SSLCertRequestInfo* cert_info) override; 100 SSLCertRequestInfo* cert_info) override;
98 void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info, 101 void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info,
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 ProxyInfo proxy_info_; 290 ProxyInfo proxy_info_;
288 291
289 scoped_ptr<HttpStreamRequest> stream_request_; 292 scoped_ptr<HttpStreamRequest> stream_request_;
290 scoped_ptr<HttpStream> stream_; 293 scoped_ptr<HttpStream> stream_;
291 294
292 // True if we've validated the headers that the stream parser has returned. 295 // True if we've validated the headers that the stream parser has returned.
293 bool headers_valid_; 296 bool headers_valid_;
294 297
295 SSLConfig server_ssl_config_; 298 SSLConfig server_ssl_config_;
296 SSLConfig proxy_ssl_config_; 299 SSLConfig proxy_ssl_config_;
300 // The SSLFailureState of the most recent failed stream.
301 SSLFailureState server_ssl_failure_state_;
297 // fallback_error_code contains the error code that caused the last TLS 302 // fallback_error_code contains the error code that caused the last TLS
298 // fallback. If the fallback connection results in 303 // fallback. If the fallback connection results in
299 // ERR_SSL_INAPPROPRIATE_FALLBACK (i.e. the server indicated that the 304 // ERR_SSL_INAPPROPRIATE_FALLBACK (i.e. the server indicated that the
300 // fallback should not have been needed) then we use this value to return the 305 // fallback should not have been needed) then we use this value to return the
301 // original error that triggered the fallback. 306 // original error that triggered the fallback.
302 int fallback_error_code_; 307 int fallback_error_code_;
308 // The SSLFailureState which caused the last TLS version fallback.
309 SSLFailureState fallback_failure_state_;
303 310
304 HttpRequestHeaders request_headers_; 311 HttpRequestHeaders request_headers_;
305 312
306 // The size in bytes of the buffer we use to drain the response body that 313 // The size in bytes of the buffer we use to drain the response body that
307 // we want to throw away. The response body is typically a small error 314 // we want to throw away. The response body is typically a small error
308 // page just a few hundred bytes long. 315 // page just a few hundred bytes long.
309 static const int kDrainBodyBufferSize = 1024; 316 static const int kDrainBodyBufferSize = 1024;
310 317
311 // User buffer and length passed to the Read method. 318 // User buffer and length passed to the Read method.
312 scoped_refptr<IOBuffer> read_buf_; 319 scoped_refptr<IOBuffer> read_buf_;
(...skipping 23 matching lines...) Expand all
336 BeforeProxyHeadersSentCallback before_proxy_headers_sent_callback_; 343 BeforeProxyHeadersSentCallback before_proxy_headers_sent_callback_;
337 344
338 ConnectionAttempts connection_attempts_; 345 ConnectionAttempts connection_attempts_;
339 346
340 DISALLOW_COPY_AND_ASSIGN(HttpNetworkTransaction); 347 DISALLOW_COPY_AND_ASSIGN(HttpNetworkTransaction);
341 }; 348 };
342 349
343 } // namespace net 350 } // namespace net
344 351
345 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ 352 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/socket/tls_socket_unittest.cc ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698