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

Unified Diff: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 2812513004: service worker: Clarify the navigation preload network error message. (Closed)
Patch Set: linebreak Created 3 years, 8 months 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
Index: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
index a03713f246686e97e800801ab06aefd3cecc78ba..c7e8b5b33844e27bd80aced8b8bb71899f7eec8f 100644
--- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
+++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
@@ -310,6 +310,13 @@ void ServiceWorkerGlobalScopeProxy::OnNavigationPreloadError(
// This method may be called after onNavigationPreloadResponse() was called.
if (!fetch_event)
return;
+ // Display an unsanitized console message.
+ if (!error->unsanitized_message.IsEmpty()) {
+ WorkerGlobalScope()->AddConsoleMessage(ConsoleMessage::Create(
+ kWorkerMessageSource, blink::MessageLevel::kErrorMessageLevel,
+ error->unsanitized_message));
+ }
+ // Reject the preloadResponse promise.
fetch_event->OnNavigationPreloadError(
WorkerGlobalScope()->ScriptController()->GetScriptState(),
std::move(error));

Powered by Google App Engine
This is Rietveld 408576698