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

Unified Diff: Source/core/frame/LocalDOMWindow.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/frame/LocalDOMWindow.cpp
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
index daccebb8c8765c4cecef60d429956e97c33b4df0..0ab41a0219fd2ac679bcaf7e8bbfc3abed6d2bd3 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -72,6 +72,7 @@
#include "core/frame/Screen.h"
#include "core/frame/Settings.h"
#include "core/html/HTMLFrameOwnerElement.h"
+#include "core/inspector/ConsoleMessage.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/inspector/InspectorTraceEvents.h"
#include "core/inspector/ScriptCallStack.h"
@@ -889,7 +890,7 @@ void LocalDOMWindow::dispatchMessageEventWithOriginCheck(SecurityOrigin* intende
// Check target origin now since the target document may have changed since the timer was scheduled.
if (!intendedTargetOrigin->isSameSchemeHostPort(document()->securityOrigin())) {
String message = ExceptionMessages::failedToExecute("postMessage", "DOMWindow", "The target origin provided ('" + intendedTargetOrigin->toString() + "') does not match the recipient window's origin ('" + document()->securityOrigin()->toString() + "').");
- frameConsole()->addMessage(SecurityMessageSource, ErrorMessageLevel, message, stackTrace);
+ frameConsole()->addMessage(ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, message, stackTrace));
return;
}
}
@@ -969,7 +970,7 @@ void LocalDOMWindow::close(ExecutionContext* context)
bool allowScriptsToCloseWindows = settings && settings->allowScriptsToCloseWindows();
if (!(page->openedByDOM() || page->backForward().backForwardListCount() <= 1 || allowScriptsToCloseWindows)) {
- frameConsole()->addMessage(JSMessageSource, WarningMessageLevel, "Scripts may close only the windows that were opened by it.");
+ frameConsole()->addMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "Scripts may close only the windows that were opened by it."));
return;
}
@@ -1702,7 +1703,7 @@ void LocalDOMWindow::printErrorMessage(const String& message)
if (message.isEmpty())
return;
- frameConsole()->addMessage(JSMessageSource, ErrorMessageLevel, message);
+ frameConsole()->addMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message));
}
// FIXME: Once we're throwing exceptions for cross-origin access violations, we will always sanitize the target

Powered by Google App Engine
This is Rietveld 408576698