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

Unified Diff: Source/core/fetch/ResourceFetcher.cpp

Issue 376213002: DevTools: Make FrameConsole methods accept ConsoleMessage objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@scriptFailedToParse
Patch Set: Created 6 years, 5 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: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index 95df1cf50c865bb08806a8511e0bde036f04535e..96736a9289517b438a4433bcae4f78a7b2e8a386 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -46,6 +46,7 @@
#include "core/html/HTMLElement.h"
#include "core/html/HTMLFrameOwnerElement.h"
#include "core/html/imports/HTMLImportsController.h"
+#include "core/inspector/ConsoleMessage.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/loader/DocumentLoader.h"
#include "core/loader/FrameLoader.h"
@@ -626,7 +627,7 @@ bool ResourceFetcher::canAccessResource(Resource* resource, SecurityOrigin* sour
toFontResource(resource)->setCORSFailed();
if (frame() && frame()->document()) {
String resourceType = Resource::resourceTypeToString(resource->type(), resource->options().initiatorInfo);
- frame()->document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, resourceType + " from origin '" + SecurityOrigin::create(url)->toString() + "' has been blocked from loading by Cross-Origin Resource Sharing policy: " + errorDescription);
+ frame()->document()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, resourceType + " from origin '" + SecurityOrigin::create(url)->toString() + "' has been blocked from loading by Cross-Origin Resource Sharing policy: " + errorDescription));
}
return false;
}
@@ -1073,7 +1074,7 @@ void ResourceFetcher::printAccessDeniedMessage(const KURL& url) const
else
message = "Unsafe attempt to load URL " + url.elidedString() + " from frame with URL " + m_document->url().elidedString() + ". Domains, protocols and ports must match.\n";
- frame()->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, message);
+ frame()->document()->addConsoleMessage(ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, message));
}
void ResourceFetcher::setAutoLoadImages(bool enable)
@@ -1407,7 +1408,7 @@ bool ResourceFetcher::canAccessRedirect(Resource* resource, ResourceRequest& req
if (resource->type() == Resource::Font)
toFontResource(resource)->setCORSFailed();
if (frame() && frame()->document())
- frame()->document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, errorMessage);
+ frame()->document()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, errorMessage));
return false;
}
}

Powered by Google App Engine
This is Rietveld 408576698