#include "bindings/v8/V8Binding.h"
#include "core/dom/Document.h"
#include "core/html/HTMLFrameElementBase.h"
-#include "core/frame/DOMWindow.h"
+#include "core/frame/LocalDOMWindow.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
#include "platform/weborigin/SecurityOrigin.h"
namespace WebCore {
-static bool isDocumentAccessibleFromDOMWindow(Document* targetDocument, DOMWindow* callingWindow)
+static bool isDocumentAccessibleFromDOMWindow(Document* targetDocument, LocalDOMWindow* callingWindow)
{
if (!targetDocument)
return false;
static bool canAccessDocument(v8::Isolate* isolate, Document* targetDocument, ExceptionState& exceptionState)
{
- DOMWindow* callingWindow = callingDOMWindow(isolate);
+ LocalDOMWindow* callingWindow = callingDOMWindow(isolate);
if (isDocumentAccessibleFromDOMWindow(targetDocument, callingWindow))
return true;
static bool canAccessDocument(v8::Isolate* isolate, Document* targetDocument, SecurityReportingOption reportingOption = ReportSecurityError)
{
- DOMWindow* callingWindow = callingDOMWindow(isolate);
+ LocalDOMWindow* callingWindow = callingDOMWindow(isolate);
if (isDocumentAccessibleFromDOMWindow(targetDocument, callingWindow))
return true;
return false;
}
-bool BindingSecurity::shouldAllowAccessToFrame(v8::Isolate* isolate, LocalFrame* target, SecurityReportingOption reportingOption)
+bool BindingSecurity::shouldAllowAccessToFrame(v8::Isolate* isolate, Frame* target, SecurityReportingOption reportingOption)
{
- return target && canAccessDocument(isolate, target->document(), reportingOption);
+ if (!target || !target->isLocalFrame())
+ return false;
+ return canAccessDocument(isolate, toLocalFrame(target)->document(), reportingOption);
}
-bool BindingSecurity::shouldAllowAccessToFrame(v8::Isolate* isolate, LocalFrame* target, ExceptionState& exceptionState)
+bool BindingSecurity::shouldAllowAccessToFrame(v8::Isolate* isolate, Frame* target, ExceptionState& exceptionState)
{
- return target && canAccessDocument(isolate, target->document(), exceptionState);
+ if (!target || !target->isLocalFrame())
+ return false;
+ return canAccessDocument(isolate, toLocalFrame(target)->document(), exceptionState);
}
bool BindingSecurity::shouldAllowAccessToNode(v8::Isolate* isolate, Node* target, ExceptionState& exceptionState)