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

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

Issue 3010050: Initialize was_ever_connected_ in ClientSocket.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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.h" 5 #include "net/socket/client_socket.h"
6 6
7 #include "base/histogram.h" 7 #include "base/histogram.h"
8 8
9 namespace net { 9 namespace net {
10 10
11 ClientSocket::ClientSocket() 11 ClientSocket::ClientSocket()
12 : omnibox_speculation_(false), 12 : was_ever_connected_(false),
13 omnibox_speculation_(false),
13 subresource_speculation_(false), 14 subresource_speculation_(false),
14 was_used_to_transmit_data_(false) {} 15 was_used_to_transmit_data_(false) {}
15 16
16 ClientSocket::~ClientSocket() { 17 ClientSocket::~ClientSocket() {
17 EmitPreconnectionHistograms(); 18 EmitPreconnectionHistograms();
18 } 19 }
19 20
20 void ClientSocket::EmitPreconnectionHistograms() const { 21 void ClientSocket::EmitPreconnectionHistograms() const {
21 DCHECK(!subresource_speculation_ || !omnibox_speculation_); 22 DCHECK(!subresource_speculation_ || !omnibox_speculation_);
22 // 0 ==> non-speculative, never connected. 23 // 0 ==> non-speculative, never connected.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // Record if this connection has every actually connected successfully. 60 // Record if this connection has every actually connected successfully.
60 // Note that IsConnected() won't be defined at destruction time, so we need 61 // Note that IsConnected() won't be defined at destruction time, so we need
61 // to record this data now, while the derived class is present. 62 // to record this data now, while the derived class is present.
62 was_ever_connected_ |= IsConnected(); 63 was_ever_connected_ |= IsConnected();
63 // A socket is_reused only after it has transmitted some data. 64 // A socket is_reused only after it has transmitted some data.
64 was_used_to_transmit_data_ |= is_reused; 65 was_used_to_transmit_data_ |= is_reused;
65 } 66 }
66 67
67 } // namespace net 68 } // namespace net
68 69
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698