Commit 660d336d authored by John Abd-El-Malek's avatar John Abd-El-Malek Committed by Commit Bot

Alias the url for webui code with network service to get more information in debugging the crash.

Bug: 891074
Change-Id: I8904c8d0285b8b2f245456509d88206f4789fc8d
Reviewed-on: https://chromium-review.googlesource.com/c/1330064Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606965}
parent 722eff78
......@@ -7,6 +7,7 @@
#include <map>
#include "base/bind.h"
#include "base/debug/alias.h"
#include "base/debug/crash_logging.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
......@@ -57,9 +58,12 @@ void CallOnError(network::mojom::URLLoaderClientPtrInfo client_info,
void ReadData(scoped_refptr<network::ResourceResponse> headers,
const ui::TemplateReplacements* replacements,
bool gzipped,
const GURL& url,
scoped_refptr<URLDataSourceImpl> data_source,
network::mojom::URLLoaderClientPtrInfo client_info,
scoped_refptr<base::RefCountedMemory> bytes) {
// TODO(jam): remove after https://crbug.com/891074 is fixed.
DEBUG_ALIAS_FOR_GURL(url_buf, url);
if (!bytes) {
CallOnError(std::move(client_info), net::ERR_FAILED);
return;
......@@ -127,6 +131,7 @@ void ReadData(scoped_refptr<network::ResourceResponse> headers,
void DataAvailable(scoped_refptr<network::ResourceResponse> headers,
const ui::TemplateReplacements* replacements,
bool gzipped,
const GURL& url,
scoped_refptr<URLDataSourceImpl> source,
network::mojom::URLLoaderClientPtrInfo client_info,
scoped_refptr<base::RefCountedMemory> bytes) {
......@@ -137,7 +142,7 @@ void DataAvailable(scoped_refptr<network::ResourceResponse> headers,
{base::TaskPriority::USER_BLOCKING, base::MayBlock(),
base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN})
->PostTask(FROM_HERE,
base::BindOnce(ReadData, headers, replacements, gzipped,
base::BindOnce(ReadData, headers, replacements, gzipped, url,
source, std::move(client_info), bytes));
}
......@@ -193,6 +198,7 @@ void StartURLLoader(const network::ResourceRequest& request,
// |replacements| is owned by |source| keep a reference to it in the callback.
auto data_available_callback =
base::Bind(DataAvailable, resource_response, replacements, gzipped,
request.url,
base::RetainedRef(source), base::Passed(&client_info));
// TODO(jam): once we only have this code path for WebUI, and not the
......
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