| 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 #include "net/socket/stream_socket.h" | 5 #include "net/socket/stream_socket.h" |
| 6 | 6 |
| 7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 void StreamSocket::PopulateAllocatorDump( |
| 15 base::trace_event::MemoryAllocatorDump* dump) const {} |
| 16 |
| 14 StreamSocket::UseHistory::UseHistory() | 17 StreamSocket::UseHistory::UseHistory() |
| 15 : was_ever_connected_(false), | 18 : was_ever_connected_(false), |
| 16 was_used_to_convey_data_(false), | 19 was_used_to_convey_data_(false), |
| 17 omnibox_speculation_(false), | 20 omnibox_speculation_(false), |
| 18 subresource_speculation_(false) { | 21 subresource_speculation_(false) { |
| 19 } | 22 } |
| 20 | 23 |
| 21 StreamSocket::UseHistory::~UseHistory() { | 24 StreamSocket::UseHistory::~UseHistory() { |
| 22 EmitPreconnectionHistograms(); | 25 EmitPreconnectionHistograms(); |
| 23 } | 26 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 result = 0; // Never used, and not really connected. | 95 result = 0; // Never used, and not really connected. |
| 93 | 96 |
| 94 if (omnibox_speculation_) | 97 if (omnibox_speculation_) |
| 95 result += 3; | 98 result += 3; |
| 96 else if (subresource_speculation_) | 99 else if (subresource_speculation_) |
| 97 result += 6; | 100 result += 6; |
| 98 UMA_HISTOGRAM_ENUMERATION("Net.PreconnectUtilization2", result, 9); | 101 UMA_HISTOGRAM_ENUMERATION("Net.PreconnectUtilization2", result, 9); |
| 99 } | 102 } |
| 100 | 103 |
| 101 } // namespace net | 104 } // namespace net |
| OLD | NEW |