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

Side by Side Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 646033008: Add some more debugging info for invalid referrers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« 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) 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"
12 #include "base/debug/dump_without_crashing.h" 13 #include "base/debug/dump_without_crashing.h"
13 #include "base/debug/trace_event.h" 14 #include "base/debug/trace_event.h"
14 #include "base/logging.h" 15 #include "base/logging.h"
15 #include "base/metrics/histogram.h" 16 #include "base/metrics/histogram.h"
16 #include "base/metrics/user_metrics.h" 17 #include "base/metrics/user_metrics.h"
17 #include "base/path_service.h" 18 #include "base/path_service.h"
18 #include "base/prefs/pref_member.h" 19 #include "base/prefs/pref_member.h"
19 #include "base/prefs/pref_service.h" 20 #include "base/prefs/pref_service.h"
20 #include "base/strings/string_number_conversions.h" 21 #include "base/strings/string_number_conversions.h"
21 #include "base/time/time.h" 22 #include "base/time/time.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 base::TimeDelta request_lag = request_start - 225 base::TimeDelta request_lag = request_start -
225 g_browser_process->io_thread()->creation_time(); 226 g_browser_process->io_thread()->creation_time();
226 UMA_HISTOGRAM_TIMES("Net.IOThreadCreationToHTTPRequestStart", request_lag); 227 UMA_HISTOGRAM_TIMES("Net.IOThreadCreationToHTTPRequestStart", request_lag);
227 } 228 }
228 #endif // defined(OS_ANDROID) 229 #endif // defined(OS_ANDROID)
229 230
230 void ReportInvalidReferrerSend(const GURL& target_url, 231 void ReportInvalidReferrerSend(const GURL& target_url,
231 const GURL& referrer_url) { 232 const GURL& referrer_url) {
232 base::RecordAction( 233 base::RecordAction(
233 base::UserMetricsAction("Net.URLRequest_StartJob_InvalidReferrer")); 234 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);
234 base::debug::DumpWithoutCrashing(); 242 base::debug::DumpWithoutCrashing();
235 NOTREACHED(); 243 NOTREACHED();
236 } 244 }
237 245
238 } // namespace 246 } // namespace
239 247
240 ChromeNetworkDelegate::ChromeNetworkDelegate( 248 ChromeNetworkDelegate::ChromeNetworkDelegate(
241 extensions::EventRouterForwarder* event_router, 249 extensions::EventRouterForwarder* event_router,
242 BooleanPrefMember* enable_referrers) 250 BooleanPrefMember* enable_referrers)
243 : profile_(NULL), 251 : profile_(NULL),
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 if (data_reduction_proxy_statistics_prefs_) { 828 if (data_reduction_proxy_statistics_prefs_) {
821 StoreAccumulatedContentLength(received_content_length, 829 StoreAccumulatedContentLength(received_content_length,
822 original_content_length, 830 original_content_length,
823 request_type, 831 request_type,
824 reinterpret_cast<Profile*>(profile_), 832 reinterpret_cast<Profile*>(profile_),
825 data_reduction_proxy_statistics_prefs_); 833 data_reduction_proxy_statistics_prefs_);
826 } 834 }
827 received_content_length_ += received_content_length; 835 received_content_length_ += received_content_length;
828 original_content_length_ += original_content_length; 836 original_content_length_ += original_content_length;
829 } 837 }
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