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

Unified Diff: Source/bindings/v8/BindingSecurity.cpp

Issue 189573002: Convert HTMLFrameOwnerElement and FocusController to use Frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Missed a null check Created 6 years, 9 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
« no previous file with comments | « Source/bindings/v8/BindingSecurity.h ('k') | Source/bindings/v8/V8WindowShell.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/BindingSecurity.cpp
diff --git a/Source/bindings/v8/BindingSecurity.cpp b/Source/bindings/v8/BindingSecurity.cpp
index 59cc6b1c1e387a747f17575b1017b7c0e37cf9a8..6b6110381e2cd484af6d083dc22539c7b7785947 100644
--- a/Source/bindings/v8/BindingSecurity.cpp
+++ b/Source/bindings/v8/BindingSecurity.cpp
@@ -80,14 +80,18 @@ static bool canAccessDocument(v8::Isolate* isolate, Document* targetDocument, Se
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)
« no previous file with comments | « Source/bindings/v8/BindingSecurity.h ('k') | Source/bindings/v8/V8WindowShell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698