Commit 4c5c7509 authored by Yutaka Hirano's avatar Yutaka Hirano Committed by Commit Bot

[ServiceWorker] Stop using GetUserAgent from non-browser process

The result of ContentClient::GetUserAgent is known to be incorrect in
the renderer process, so get the value in the browser and pass it via
IPC.

Bug: 818450
Change-Id: Ia1af4c237b9d63059c634cd0bbb41ab53436b8cd
Reviewed-on: https://chromium-review.googlesource.com/c/1352119Reviewed-by: default avatarMakoto Shimazu <shimazu@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611599}
parent 9f029b08
......@@ -1585,6 +1585,7 @@ void ServiceWorkerVersion::StartWorkerInternal() {
params->scope = scope_;
params->script_url = script_url_;
params->script_type = script_type_;
params->user_agent = GetContentClient()->GetUserAgent();
params->is_installed = IsInstalled(status_);
params->pause_after_download = pause_after_download();
......
......@@ -43,6 +43,8 @@ struct EmbeddedWorkerStartParams {
// This service worker's script type:
// https://w3c.github.io/ServiceWorker/#dfn-type
blink.mojom.ScriptType script_type;
// The string used for "user-agent" HTTP header.
string user_agent;
// The id to talk with the DevTools agent for the worker.
int32 worker_devtools_agent_route_id;
// Unique token identifying this worker for DevTools.
......
......@@ -164,8 +164,7 @@ EmbeddedWorkerInstanceClientImpl::StartWorkerContext(
blink::WebEmbeddedWorkerStartData start_data;
start_data.script_url = params->script_url;
start_data.user_agent =
blink::WebString::FromUTF8(GetContentClient()->GetUserAgent());
start_data.user_agent = blink::WebString::FromUTF8(params->user_agent);
start_data.script_type = params->script_type;
start_data.wait_for_debugger_mode =
params->wait_for_debugger
......
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