| 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);
|
|
|