Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/DOMWindow.cpp |
| diff --git a/third_party/WebKit/Source/core/frame/DOMWindow.cpp b/third_party/WebKit/Source/core/frame/DOMWindow.cpp |
| index b514d469fe941be440f78783a670567f6b5e445a..3564707d547477f395a52709945f546c92f4b91c 100644 |
| --- a/third_party/WebKit/Source/core/frame/DOMWindow.cpp |
| +++ b/third_party/WebKit/Source/core/frame/DOMWindow.cpp |
| @@ -8,6 +8,7 @@ |
| #include "bindings/core/v8/ScriptCallStackFactory.h" |
| #include "core/dom/Document.h" |
| #include "core/dom/ExceptionCode.h" |
| +#include "core/dom/ExecutionContext.h" |
| #include "core/dom/SecurityContext.h" |
| #include "core/events/MessageEvent.h" |
| #include "core/frame/Frame.h" |
| @@ -155,6 +156,15 @@ void DOMWindow::resetLocation() |
| } |
| } |
| +bool DOMWindow::isSecureContext() const |
| +{ |
| + if (!frame() || !document()) |
|
Srirama
2015/09/28 14:42:07
do we need the document check here? I think it is
philipj_slow
2015/09/28 15:20:26
Right, RemoteDOMWindow::document() can return null
|
| + return false; |
| + |
| + String unusedErrorMessage; |
| + return document()->isSecureContext(unusedErrorMessage, ExecutionContext::StandardSecureContextCheck); |
| +} |
| + |
| void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePortArray* ports, const String& targetOrigin, LocalDOMWindow* source, ExceptionState& exceptionState) |
| { |
| if (!isCurrentlyDisplayedInFrame()) |