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

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

Issue 2698723002: Add rappor logging for Device Orientation on security origins different from the main frame (Closed)
Patch Set: add DEviceMotion Created 3 years, 10 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/DeviceSingleWindowEventController.cpp
diff --git a/third_party/WebKit/Source/core/frame/DeviceSingleWindowEventController.cpp b/third_party/WebKit/Source/core/frame/DeviceSingleWindowEventController.cpp
index ebd36b125167d64b3531584cafae979c16c57fed..79dc5d2431c6592979b02dc46b4a41e806601d87 100644
--- a/third_party/WebKit/Source/core/frame/DeviceSingleWindowEventController.cpp
+++ b/third_party/WebKit/Source/core/frame/DeviceSingleWindowEventController.cpp
@@ -68,6 +68,24 @@ void DeviceSingleWindowEventController::didRemoveAllEventListeners(
m_hasEventListener = false;
}
+bool DeviceSingleWindowEventController::isSameSecurityOriginAsMainFrame()
+ const {
+ if (!document().frame() || !document().page())
+ return false;
+
+ if (document().frame()->isMainFrame())
+ return true;
+
+ SecurityOrigin* mainSecurityOrigin =
+ document().page()->mainFrame()->securityContext()->getSecurityOrigin();
+
+ if (mainSecurityOrigin &&
+ document().getSecurityOrigin()->canAccess(mainSecurityOrigin))
+ return true;
+
+ return false;
+}
+
DEFINE_TRACE(DeviceSingleWindowEventController) {
visitor->trace(m_document);
PlatformEventController::trace(visitor);

Powered by Google App Engine
This is Rietveld 408576698