Commit c90dd391 authored by Kenichi Ishibashi's avatar Kenichi Ishibashi Committed by Commit Bot

service worker: Fix url in ServiceWorkerInstalledScriptsManager::GetScriptData trace event

This arg was broken (see the attached image in the linked bug).
Explicitly convert KURL to TracedValue to record the url
correctly.

Bug: 961553
Change-Id: I2abc1410527608c043375a522d5548fb974cb76a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1604392
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658968}
parent 5b7d844c
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "third_party/blink/renderer/core/html/parser/text_resource_decoder.h" #include "third_party/blink/renderer/core/html/parser/text_resource_decoder.h"
#include "third_party/blink/renderer/modules/service_worker/service_worker_thread.h" #include "third_party/blink/renderer/modules/service_worker/service_worker_thread.h"
#include "third_party/blink/renderer/platform/cross_thread_functional.h" #include "third_party/blink/renderer/platform/cross_thread_functional.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/traced_value.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h" #include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h" #include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/functional.h" #include "third_party/blink/renderer/platform/wtf/functional.h"
...@@ -235,6 +236,12 @@ class Internal : public mojom::blink::ServiceWorkerInstalledScriptsManager { ...@@ -235,6 +236,12 @@ class Internal : public mojom::blink::ServiceWorkerInstalledScriptsManager {
base::WeakPtrFactory<Internal> weak_factory_; base::WeakPtrFactory<Internal> weak_factory_;
}; };
std::unique_ptr<TracedValue> UrlToTracedValue(const KURL& url) {
auto value = std::make_unique<TracedValue>();
value->SetString("url", url.GetString());
return value;
}
} // namespace } // namespace
ServiceWorkerInstalledScriptsManager::ServiceWorkerInstalledScriptsManager( ServiceWorkerInstalledScriptsManager::ServiceWorkerInstalledScriptsManager(
...@@ -267,8 +274,8 @@ std::unique_ptr<InstalledScriptsManager::ScriptData> ...@@ -267,8 +274,8 @@ std::unique_ptr<InstalledScriptsManager::ScriptData>
ServiceWorkerInstalledScriptsManager::GetScriptData(const KURL& script_url) { ServiceWorkerInstalledScriptsManager::GetScriptData(const KURL& script_url) {
DCHECK(!IsMainThread()); DCHECK(!IsMainThread());
TRACE_EVENT1("ServiceWorker", TRACE_EVENT1("ServiceWorker",
"ServiceWorkerInstalledScriptsManager::GetScriptData", "url", "ServiceWorkerInstalledScriptsManager::GetScriptData",
script_url.GetString().Utf8().data()); "script_url", UrlToTracedValue(script_url));
if (!IsScriptInstalled(script_url)) if (!IsScriptInstalled(script_url))
return nullptr; return nullptr;
......
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