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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp

Issue 1417023006: bindings: Refactors BindingSecurity::shouldAllowAccessToXXX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the assertion condition. Created 5 years, 1 month 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/bindings/core/v8/custom/V8InjectedScriptManager.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp
index c5d2934fcc755b35658ee202a19fd2dbff0602ea..bb56576d37f2b2ca94309171798d5e509c32ae80 100644
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp
@@ -83,15 +83,8 @@ bool InjectedScriptManager::canAccessInspectedWindow(ScriptState* scriptState)
if (!scriptState->contextIsValid())
return false;
ScriptState::Scope scope(scriptState);
- v8::Local<v8::Object> global = scriptState->context()->Global();
- if (global.IsEmpty())
- return false;
- v8::Local<v8::Object> holder = V8Window::findInstanceInPrototypeChain(global, scriptState->isolate());
- if (holder.IsEmpty())
- return false;
- LocalFrame* frame = toLocalDOMWindow(V8Window::toImpl(holder))->frame();
-
- return BindingSecurity::shouldAllowAccessToFrame(scriptState->isolate(), callingDOMWindow(scriptState->isolate()), frame, DoNotReportSecurityError);
+ DOMWindow* window = toDOMWindow(scriptState->isolate(), scriptState->context()->Global());
+ return window && BindingSecurity::shouldAllowAccessTo(scriptState->isolate(), callingDOMWindow(scriptState->isolate()), window, DoNotReportSecurityError);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698