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

Unified Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 691553004: Record stack trace and coarse reason for referrer failures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/chrome_network_delegate.cc
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
index f2e1d77d84628e7642809bbd0ff29418e6745a83..4b4d618896e0f2ff14371b63e9cd91c85fa12d9b 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -9,7 +9,9 @@
#include <vector>
#include "base/base_paths.h"
+#include "base/debug/alias.h"
#include "base/debug/dump_without_crashing.h"
+#include "base/debug/stack_trace.h"
#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
@@ -227,7 +229,21 @@ void RecordIOThreadToRequestStartOnUIThread(
#endif // defined(OS_ANDROID)
void ReportInvalidReferrerSend(const GURL& target_url,
- const GURL& referrer_url) {
+ const GURL& referrer_url,
+ const base::debug::StackTrace& callstack) {
+ // Record information to help debug http://crbug.com/422871
+ base::debug::StackTrace trace = callstack;
+ base::debug::Alias(&trace);
+ enum { INVALID_URL, FILE_URL, DATA_URL, HTTP_URL, OTHER } reason = OTHER;
+ if (!target_url.is_valid())
+ reason = INVALID_URL;
+ else if (target_url.SchemeIsFile())
+ reason = FILE_URL;
+ else if (target_url.SchemeIs(url::kDataScheme))
+ reason = DATA_URL;
+ else if (target_url.SchemeIs(url::kHttpScheme))
+ reason = HTTP_URL;
+ base::debug::Alias(&reason);
base::RecordAction(
base::UserMetricsAction("Net.URLRequest_StartJob_InvalidReferrer"));
base::debug::DumpWithoutCrashing();
@@ -792,8 +808,10 @@ bool ChromeNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader(
const net::URLRequest& request,
const GURL& target_url,
const GURL& referrer_url) const {
+ base::debug::StackTrace callstack;
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
- base::Bind(&ReportInvalidReferrerSend, target_url, referrer_url));
+ base::Bind(&ReportInvalidReferrerSend, target_url,
+ referrer_url, callstack));
return true;
}
« 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