| 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_stream_metrics.h" | 5 #include "net/socket_stream/socket_stream_metrics.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "googleurl/src/gurl.h" | 11 #include "url/gurl.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 SocketStreamMetrics::SocketStreamMetrics(const GURL& url) | 15 SocketStreamMetrics::SocketStreamMetrics(const GURL& url) |
| 16 : received_bytes_(0), | 16 : received_bytes_(0), |
| 17 received_counts_(0), | 17 received_counts_(0), |
| 18 sent_bytes_(0), | 18 sent_bytes_(0), |
| 19 sent_counts_(0) { | 19 sent_counts_(0) { |
| 20 ProtocolType protocol_type = PROTOCOL_UNKNOWN; | 20 ProtocolType protocol_type = PROTOCOL_UNKNOWN; |
| 21 if (url.SchemeIs("ws")) | 21 if (url.SchemeIs("ws")) |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 UMA_HISTOGRAM_ENUMERATION("Net.SocketStream.ConnectionType", type, | 77 UMA_HISTOGRAM_ENUMERATION("Net.SocketStream.ConnectionType", type, |
| 78 NUM_CONNECTION_TYPES); | 78 NUM_CONNECTION_TYPES); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void SocketStreamMetrics::OnCountWireProtocolType(WireProtocolType type) { | 81 void SocketStreamMetrics::OnCountWireProtocolType(WireProtocolType type) { |
| 82 UMA_HISTOGRAM_ENUMERATION("Net.SocketStream.WireProtocolType", type, | 82 UMA_HISTOGRAM_ENUMERATION("Net.SocketStream.WireProtocolType", type, |
| 83 NUM_WIRE_PROTOCOL_TYPES); | 83 NUM_WIRE_PROTOCOL_TYPES); |
| 84 } | 84 } |
| 85 | 85 |
| 86 } // namespace net | 86 } // namespace net |
| OLD | NEW |