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

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

Issue 2706923002: Rework security checks to be based on Window rather than Frame. (Closed)
Patch Set: Do not hardcode V8Window::wrapperTypeInfo Created 3 years, 7 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/bindings/core/v8/custom/V8WindowCustom.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp
index a6e1f06b7c4e9be4b635e4ae76709e528b0dc690..81cd0848dc109fb0ce61db39d9c82f57b96439d8 100644
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp
@@ -159,14 +159,8 @@ void V8Window::openerAttributeSetterCustom(
const v8::PropertyCallbackInfo<void>& info) {
v8::Isolate* isolate = info.GetIsolate();
DOMWindow* impl = V8Window::toImpl(info.Holder());
- // TODO(dcheng): Investigate removing this, since opener is not really a
- // cross-origin property (so it shouldn't be accessible to begin with)
- ExceptionState exception_state(isolate, ExceptionState::kSetterContext,
- "Window", "opener");
- if (!BindingSecurity::ShouldAllowAccessTo(CurrentDOMWindow(info.GetIsolate()),
- impl, exception_state)) {
+ if (!impl->GetFrame())
return;
- }
// Opener can be shadowed if it is in the same domain.
// Have a special handling of null value to behave
@@ -349,7 +343,8 @@ void V8Window::namedPropertyGetterCustom(
if (!BindingSecurity::ShouldAllowAccessTo(
CurrentDOMWindow(info.GetIsolate()), window,
BindingSecurity::ErrorReportOption::kDoNotReport)) {
- BindingSecurity::FailedAccessCheckFor(info.GetIsolate(), frame);
+ BindingSecurity::FailedAccessCheckFor(
+ info.GetIsolate(), window->GetWrapperTypeInfo(), info.Holder());
return;
}

Powered by Google App Engine
This is Rietveld 408576698