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

Side by Side Diff: net/socket/client_socket_handle.cc

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
« no previous file with comments | « net/socket/client_socket_handle.h ('k') | net/socket/socket_test_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "net/socket/client_socket_handle.h" 5 #include "net/socket/client_socket_handle.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "net/base/net_errors.h" 12 #include "net/base/net_errors.h"
13 #include "net/socket/client_socket_pool.h" 13 #include "net/socket/client_socket_pool.h"
14 14
15 namespace net { 15 namespace net {
16 16
17 ClientSocketHandle::ClientSocketHandle() 17 ClientSocketHandle::ClientSocketHandle()
18 : is_initialized_(false), 18 : is_initialized_(false),
19 pool_(NULL), 19 pool_(NULL),
20 higher_pool_(NULL), 20 higher_pool_(NULL),
21 reuse_type_(ClientSocketHandle::UNUSED), 21 reuse_type_(ClientSocketHandle::UNUSED),
22 callback_(base::Bind(&ClientSocketHandle::OnIOComplete, 22 callback_(base::Bind(&ClientSocketHandle::OnIOComplete,
23 base::Unretained(this))), 23 base::Unretained(this))),
24 is_ssl_error_(false) {} 24 is_ssl_error_(false),
25 ssl_failure_state_(SSL_FAILURE_NONE) {
26 }
25 27
26 ClientSocketHandle::~ClientSocketHandle() { 28 ClientSocketHandle::~ClientSocketHandle() {
27 Reset(); 29 Reset();
28 } 30 }
29 31
30 void ClientSocketHandle::Reset() { 32 void ClientSocketHandle::Reset() {
31 ResetInternal(true); 33 ResetInternal(true);
32 ResetErrorState(); 34 ResetErrorState();
33 } 35 }
34 36
(...skipping 30 matching lines...) Expand all
65 idle_time_ = base::TimeDelta(); 67 idle_time_ = base::TimeDelta();
66 init_time_ = base::TimeTicks(); 68 init_time_ = base::TimeTicks();
67 setup_time_ = base::TimeDelta(); 69 setup_time_ = base::TimeDelta();
68 connect_timing_ = LoadTimingInfo::ConnectTiming(); 70 connect_timing_ = LoadTimingInfo::ConnectTiming();
69 pool_id_ = -1; 71 pool_id_ = -1;
70 } 72 }
71 73
72 void ClientSocketHandle::ResetErrorState() { 74 void ClientSocketHandle::ResetErrorState() {
73 is_ssl_error_ = false; 75 is_ssl_error_ = false;
74 ssl_error_response_info_ = HttpResponseInfo(); 76 ssl_error_response_info_ = HttpResponseInfo();
77 ssl_failure_state_ = SSL_FAILURE_NONE;
75 pending_http_proxy_connection_.reset(); 78 pending_http_proxy_connection_.reset();
76 } 79 }
77 80
78 LoadState ClientSocketHandle::GetLoadState() const { 81 LoadState ClientSocketHandle::GetLoadState() const {
79 CHECK(!is_initialized()); 82 CHECK(!is_initialized());
80 CHECK(!group_name_.empty()); 83 CHECK(!group_name_.empty());
81 // Because of http://crbug.com/37810 we may not have a pool, but have 84 // Because of http://crbug.com/37810 we may not have a pool, but have
82 // just a raw socket. 85 // just a raw socket.
83 if (!pool_) 86 if (!pool_)
84 return LOAD_STATE_IDLE; 87 return LOAD_STATE_IDLE;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // TODO(eroman): This logging is not complete, in particular set_socket() and 166 // TODO(eroman): This logging is not complete, in particular set_socket() and
164 // release() socket. It ends up working though, since those methods are being 167 // release() socket. It ends up working though, since those methods are being
165 // used to layer sockets (and the destination sources are the same). 168 // used to layer sockets (and the destination sources are the same).
166 DCHECK(socket_.get()); 169 DCHECK(socket_.get());
167 socket_->NetLog().BeginEvent( 170 socket_->NetLog().BeginEvent(
168 NetLog::TYPE_SOCKET_IN_USE, 171 NetLog::TYPE_SOCKET_IN_USE,
169 requesting_source_.ToEventParametersCallback()); 172 requesting_source_.ToEventParametersCallback());
170 } 173 }
171 174
172 } // namespace net 175 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/client_socket_handle.h ('k') | net/socket/socket_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698