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

Unified Diff: Source/modules/fetch/FetchManager.cpp

Issue 1195453005: [Fetch] Omit console error messages for cancellation, timeout, and non-BlinkInternal (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Comment fix. Created 5 years, 6 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
« no previous file with comments | « LayoutTests/http/tests/fetch/chromium/error-messages-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/fetch/FetchManager.cpp
diff --git a/Source/modules/fetch/FetchManager.cpp b/Source/modules/fetch/FetchManager.cpp
index 29b2f61ea1404304127a1d3fe565bbd53ff39aa9..3eb65789bff34f79437c23c031f48f6fd34ba8cb 100644
--- a/Source/modules/fetch/FetchManager.cpp
+++ b/Source/modules/fetch/FetchManager.cpp
@@ -195,12 +195,18 @@ void FetchManager::Loader::didFinishLoading(unsigned long, double)
void FetchManager::Loader::didFail(const ResourceError& error)
{
- failed("Fetch API cannot load " + error.failingURL() + ". " + error.localizedDescription());
+ if (error.isCancellation() || error.isTimeout() || error.domain() != errorDomainBlinkInternal)
+ failed(String());
+ else
+ failed("Fetch API cannot load " + error.failingURL() + ". " + error.localizedDescription());
}
void FetchManager::Loader::didFailAccessControlCheck(const ResourceError& error)
{
- failed("Fetch API cannot load " + error.failingURL() + ". " + error.localizedDescription());
+ if (error.isCancellation() || error.isTimeout() || error.domain() != errorDomainBlinkInternal)
+ failed(String());
+ else
+ failed("Fetch API cannot load " + error.failingURL() + ". " + error.localizedDescription());
}
void FetchManager::Loader::didFailRedirectCheck()
@@ -430,7 +436,8 @@ void FetchManager::Loader::failed(const String& message)
if (m_failed || m_finished)
return;
m_failed = true;
- executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message));
+ if (!message.isEmpty())
+ executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message));
if (m_responseBuffer) {
m_responseBuffer->error(DOMException::create(NetworkError, "Failed to fetch"));
m_responseBuffer.clear();
« no previous file with comments | « LayoutTests/http/tests/fetch/chromium/error-messages-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698