| Index: Source/core/frame/LocalDOMWindow.cpp
|
| diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
|
| index 8f94e75c8c754ce158dcee2d2878916784133eb9..a02bf9d5e876fd13bba8adec39cff9aa63017687 100644
|
| --- a/Source/core/frame/LocalDOMWindow.cpp
|
| +++ b/Source/core/frame/LocalDOMWindow.cpp
|
| @@ -72,6 +72,7 @@
|
| #include "core/frame/Settings.h"
|
| #include "core/frame/WebKitPoint.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"
|
| @@ -905,7 +906,9 @@ 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);
|
| + RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, message);
|
| + consoleMessage->setCallStack(stackTrace);
|
| + frameConsole()->addMessage(consoleMessage.release());
|
| return;
|
| }
|
| }
|
| @@ -985,7 +988,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;
|
| }
|
|
|
| @@ -1729,7 +1732,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
|
|
|