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

Unified Diff: webkit/port/bindings/scripts/CodeGeneratorV8.pm

Issue 17053: Ensure that constructor functions are created in the context of the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 12 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 | « no previous file | webkit/port/bindings/v8/v8_proxy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/port/bindings/scripts/CodeGeneratorV8.pm
===================================================================
--- webkit/port/bindings/scripts/CodeGeneratorV8.pm (revision 7540)
+++ webkit/port/bindings/scripts/CodeGeneratorV8.pm (working copy)
@@ -415,9 +415,15 @@
INC_STATS(\"DOM.$implClassName.constructors._get\");
v8::Handle<v8::Value> data = info.Data();
ASSERT(data->IsNumber());
-
V8ClassIndex::V8WrapperType type = V8ClassIndex::FromInt(data->Int32Value());
-
+ DOMWindow* window = V8Proxy::ToNativeObject<DOMWindow>(V8ClassIndex::DOMWINDOW, info.Holder());
+ Frame* frame = window->frame();
+ if (frame) {
+ // Get the proxy corresponding to the DOMWindow if possible to
+ // make sure that the constructor function is constructed in the
+ // context of the DOMWindow and not in the context of the caller.
+ return V8Proxy::retrieve(frame)->GetConstructor(type);
+ }
return V8Proxy::retrieve()->GetConstructor(type);
}
« no previous file with comments | « no previous file | webkit/port/bindings/v8/v8_proxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698