OLD | NEW |
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 "chrome/browser/net/chrome_network_delegate.h" | 5 #include "chrome/browser/net/chrome_network_delegate.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 NOTREACHED(); | 124 NOTREACHED(); |
125 } | 125 } |
126 | 126 |
127 // Record network errors that HTTP requests complete with, including OK and | 127 // Record network errors that HTTP requests complete with, including OK and |
128 // ABORTED. | 128 // ABORTED. |
129 void RecordNetworkErrorHistograms(const net::URLRequest* request) { | 129 void RecordNetworkErrorHistograms(const net::URLRequest* request) { |
130 if (request->url().SchemeIs("http")) { | 130 if (request->url().SchemeIs("http")) { |
131 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.HttpRequestCompletionErrorCodes", | 131 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.HttpRequestCompletionErrorCodes", |
132 std::abs(request->status().error())); | 132 std::abs(request->status().error())); |
133 | 133 |
134 if (request->load_flags() & net::LOAD_MAIN_FRAME) { | 134 if (request->load_flags() & net::LOAD_MAIN_FRAME_DEPRECATED) { |
135 UMA_HISTOGRAM_SPARSE_SLOWLY( | 135 UMA_HISTOGRAM_SPARSE_SLOWLY( |
136 "Net.HttpRequestCompletionErrorCodes.MainFrame", | 136 "Net.HttpRequestCompletionErrorCodes.MainFrame", |
137 std::abs(request->status().error())); | 137 std::abs(request->status().error())); |
138 } | 138 } |
139 } | 139 } |
140 } | 140 } |
141 | 141 |
142 } // namespace | 142 } // namespace |
143 | 143 |
144 ChromeNetworkDelegate::ChromeNetworkDelegate( | 144 ChromeNetworkDelegate::ChromeNetworkDelegate( |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 if (!data_use_aggregator_) | 584 if (!data_use_aggregator_) |
585 return; | 585 return; |
586 | 586 |
587 if (is_data_usage_off_the_record_) { | 587 if (is_data_usage_off_the_record_) { |
588 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); | 588 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); |
589 return; | 589 return; |
590 } | 590 } |
591 | 591 |
592 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); | 592 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); |
593 } | 593 } |
OLD | NEW |