Commit 6b59fe72 authored by Clark DuVall's avatar Clark DuVall Committed by Commit Bot

Add crash keys to debug WebRequest request ID collision

This should help figuring out where the duplicate IDs are coming from.

Bug: 996940
Change-Id: I3e3611e83ed563cf883729f307bbe2b66ac6b74d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1977186Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728258}
parent 9dd85832
include_rules = [
# TODO(crbug.com/996940): Remove this when done debugging.
"+components/crash",
]
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/callback_helpers.h" #include "base/callback_helpers.h"
#include "base/feature_list.h" #include "base/feature_list.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "components/crash/core/common/crash_key.h"
#include "components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h" #include "components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
...@@ -1036,6 +1038,20 @@ void WebRequestProxyingURLLoaderFactory::CreateLoaderAndStart( ...@@ -1036,6 +1038,20 @@ void WebRequestProxyingURLLoaderFactory::CreateLoaderAndStart(
request_id_generator_->Generate(routing_id, request_id); request_id_generator_->Generate(routing_id, request_id);
if (request_id) { if (request_id) {
// TODO(crbug.com/996940): Remove these when done debugging.
static crash_reporter::CrashKeyString<1024> url_key("wr-url");
crash_reporter::ScopedCrashKeyString url_string(
&url_key, request.url.possibly_invalid_spec());
static crash_reporter::CrashKeyString<8> type_key("wr-loader-type");
crash_reporter::ScopedCrashKeyString type_string(
&type_key, base::NumberToString(int(loader_factory_type_)));
static crash_reporter::CrashKeyString<32> id_key("wr-request-id");
crash_reporter::ScopedCrashKeyString id_string(
&id_key, base::NumberToString(render_process_id_) + ":" +
base::NumberToString(request_id));
// Only requests with a non-zero request ID can have their proxy associated // Only requests with a non-zero request ID can have their proxy associated
// with said ID. This is necessary to support correlation against any auth // with said ID. This is necessary to support correlation against any auth
// events received by the browser. Requests with a request ID of 0 therefore // events received by the browser. Requests with a request ID of 0 therefore
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment