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

Unified Diff: third_party/WebKit/Source/core/frame/DOMWindow.cpp

Issue 1373773003: Implement 'window.isSecureContext'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback. Created 5 years, 3 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: 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())

Powered by Google App Engine
This is Rietveld 408576698