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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp

Issue 2640123006: Use the current context as the creation context for cross-origin objects. (Closed)
Patch Set: rebase Created 3 years, 11 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/tests/results/core/V8TestInterfaceCheckSecurity.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
index 6d7138f5db7f3c1d96c6bdcdc7df99d57fddd730..5a28da3c1a938b921ba72730b291ddd6102bb96f 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
@@ -396,8 +396,7 @@ void V8TestInterfaceCheckSecurity::TestInterfaceCheckSecurityOriginSafeMethodSet
}
bool V8TestInterfaceCheckSecurity::securityCheck(v8::Local<v8::Context> accessingContext, v8::Local<v8::Object> accessedObject, v8::Local<v8::Value> data) {
- TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(accessedObject);
- return BindingSecurity::shouldAllowAccessTo(toLocalDOMWindow(toDOMWindow(accessingContext)), impl, BindingSecurity::ErrorReportOption::DoNotReport);
+ #error "Unexpected security check for interface TestInterfaceCheckSecurity"
}
void V8TestInterfaceCheckSecurity::crossOriginNamedGetter(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
@@ -439,9 +438,11 @@ void V8TestInterfaceCheckSecurity::crossOriginNamedEnumerator(const v8::Property
for (const auto& attribute : TestInterfaceCheckSecurityV8Internal::kCrossOriginAttributeTable)
names.push_back(attribute.name);
- v8SetReturnValue(
- info,
- ToV8(names, info.Holder(), info.GetIsolate()).As<v8::Array>());
+ // Use the current context as the creation context, as a cross-origin access
+ // may involve an object that does not have a creation context.
+ v8SetReturnValue(info,
+ ToV8(names, info.GetIsolate()->GetCurrentContext()->Global(),
+ info.GetIsolate()).As<v8::Array>());
}
// Suppress warning: global constructors, because AttributeConfiguration is trivial
« no previous file with comments | « third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl ('k') | third_party/WebKit/Source/core/frame/Window.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698