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 <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/base_paths.h" | 11 #include "base/base_paths.h" |
12 #include "base/debug/alias.h" | |
13 #include "base/debug/dump_without_crashing.h" | 12 #include "base/debug/dump_without_crashing.h" |
14 #include "base/debug/trace_event.h" | 13 #include "base/debug/trace_event.h" |
15 #include "base/logging.h" | 14 #include "base/logging.h" |
16 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
17 #include "base/metrics/user_metrics.h" | 16 #include "base/metrics/user_metrics.h" |
18 #include "base/path_service.h" | 17 #include "base/path_service.h" |
19 #include "base/prefs/pref_member.h" | 18 #include "base/prefs/pref_member.h" |
20 #include "base/prefs/pref_service.h" | 19 #include "base/prefs/pref_service.h" |
21 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
22 #include "base/time/time.h" | 21 #include "base/time/time.h" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 base::TimeDelta request_lag = request_start - | 224 base::TimeDelta request_lag = request_start - |
226 g_browser_process->io_thread()->creation_time(); | 225 g_browser_process->io_thread()->creation_time(); |
227 UMA_HISTOGRAM_TIMES("Net.IOThreadCreationToHTTPRequestStart", request_lag); | 226 UMA_HISTOGRAM_TIMES("Net.IOThreadCreationToHTTPRequestStart", request_lag); |
228 } | 227 } |
229 #endif // defined(OS_ANDROID) | 228 #endif // defined(OS_ANDROID) |
230 | 229 |
231 void ReportInvalidReferrerSend(const GURL& target_url, | 230 void ReportInvalidReferrerSend(const GURL& target_url, |
232 const GURL& referrer_url) { | 231 const GURL& referrer_url) { |
233 base::RecordAction( | 232 base::RecordAction( |
234 base::UserMetricsAction("Net.URLRequest_StartJob_InvalidReferrer")); | 233 base::UserMetricsAction("Net.URLRequest_StartJob_InvalidReferrer")); |
235 // http://crbug.com/422871 | |
236 char url_buf[128]; | |
237 char referrer_buf[128]; | |
238 base::strlcpy(url_buf, target_url.spec().c_str(), arraysize(url_buf)); | |
239 base::strlcpy(referrer_buf, referrer_url.spec().c_str(), arraysize(url_buf)); | |
240 base::debug::Alias(url_buf); | |
241 base::debug::Alias(referrer_buf); | |
242 base::debug::DumpWithoutCrashing(); | 234 base::debug::DumpWithoutCrashing(); |
243 NOTREACHED(); | 235 NOTREACHED(); |
244 } | 236 } |
245 | 237 |
246 } // namespace | 238 } // namespace |
247 | 239 |
248 ChromeNetworkDelegate::ChromeNetworkDelegate( | 240 ChromeNetworkDelegate::ChromeNetworkDelegate( |
249 extensions::EventRouterForwarder* event_router, | 241 extensions::EventRouterForwarder* event_router, |
250 BooleanPrefMember* enable_referrers) | 242 BooleanPrefMember* enable_referrers) |
251 : profile_(NULL), | 243 : profile_(NULL), |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 if (data_reduction_proxy_statistics_prefs_) { | 820 if (data_reduction_proxy_statistics_prefs_) { |
829 StoreAccumulatedContentLength(received_content_length, | 821 StoreAccumulatedContentLength(received_content_length, |
830 original_content_length, | 822 original_content_length, |
831 request_type, | 823 request_type, |
832 reinterpret_cast<Profile*>(profile_), | 824 reinterpret_cast<Profile*>(profile_), |
833 data_reduction_proxy_statistics_prefs_); | 825 data_reduction_proxy_statistics_prefs_); |
834 } | 826 } |
835 received_content_length_ += received_content_length; | 827 received_content_length_ += received_content_length; |
836 original_content_length_ += original_content_length; | 828 original_content_length_ += original_content_length; |
837 } | 829 } |
OLD | NEW |