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

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

Issue 1853543002: Add -ifsameorigin to autoplay experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@autoplay
Patch Set: comment. Created 4 years, 8 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/Frame.cpp
diff --git a/third_party/WebKit/Source/core/frame/Frame.cpp b/third_party/WebKit/Source/core/frame/Frame.cpp
index ab7a50184a2baa5636cdd71ad122233d114f4d20..1b6b9e7afbcfe0496541a2af988aa6ebe38f0c1e 100644
--- a/third_party/WebKit/Source/core/frame/Frame.cpp
+++ b/third_party/WebKit/Source/core/frame/Frame.cpp
@@ -288,6 +288,14 @@ Settings* Frame::settings() const
return nullptr;
}
+bool Frame::isCrossOrigin() const
+{
+ // Check to see if the frame can script into the top level document.
+ const SecurityOrigin* securityOrigin = securityContext()->getSecurityOrigin();
+ Frame* top = tree().top();
+ return top && !securityOrigin->canAccess(top->securityContext()->getSecurityOrigin());
+}
+
Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner)
: m_treeNode(this)
, m_host(host)

Powered by Google App Engine
This is Rietveld 408576698