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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | webkit/port/bindings/v8/v8_proxy.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> 3 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
4 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 4 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
5 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> 5 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
6 # Copyright (C) 2006 Apple Computer, Inc. 6 # Copyright (C) 2006 Apple Computer, Inc.
7 # Copyright (C) 2007 Google Inc. 7 # Copyright (C) 2007 Google Inc.
8 # 8 #
9 # This file is part of the KDE project 9 # This file is part of the KDE project
10 # 10 #
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 408
409 sub GenerateConstructorGetter 409 sub GenerateConstructorGetter
410 { 410 {
411 my $implClassName = shift; 411 my $implClassName = shift;
412 412
413 push(@implContentDecls, <<END); 413 push(@implContentDecls, <<END);
414 static v8::Handle<v8::Value> ${implClassName}ConstructorGetter(v8::Local<v8::S tring> name, const v8::AccessorInfo& info) { 414 static v8::Handle<v8::Value> ${implClassName}ConstructorGetter(v8::Local<v8::S tring> name, const v8::AccessorInfo& info) {
415 INC_STATS(\"DOM.$implClassName.constructors._get\"); 415 INC_STATS(\"DOM.$implClassName.constructors._get\");
416 v8::Handle<v8::Value> data = info.Data(); 416 v8::Handle<v8::Value> data = info.Data();
417 ASSERT(data->IsNumber()); 417 ASSERT(data->IsNumber());
418
419 V8ClassIndex::V8WrapperType type = V8ClassIndex::FromInt(data->Int32Value()) ; 418 V8ClassIndex::V8WrapperType type = V8ClassIndex::FromInt(data->Int32Value()) ;
420 419 DOMWindow* window = V8Proxy::ToNativeObject<DOMWindow>(V8ClassIndex::DOMWIND OW, info.Holder());
420 Frame* frame = window->frame();
421 if (frame) {
422 // Get the proxy corresponding to the DOMWindow if possible to
423 // make sure that the constructor function is constructed in the
424 // context of the DOMWindow and not in the context of the caller.
425 return V8Proxy::retrieve(frame)->GetConstructor(type);
426 }
421 return V8Proxy::retrieve()->GetConstructor(type); 427 return V8Proxy::retrieve()->GetConstructor(type);
422 } 428 }
423 429
424 END 430 END
425 } 431 }
426 432
427 sub GenerateNormalAttrGetter 433 sub GenerateNormalAttrGetter
428 { 434 {
429 my $attribute = shift; 435 my $attribute = shift;
430 my $dataNode = shift; 436 my $dataNode = shift;
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after
2078 return 0; 2084 return 0;
2079 } 2085 }
2080 2086
2081 sub DebugPrint 2087 sub DebugPrint
2082 { 2088 {
2083 my $output = shift; 2089 my $output = shift;
2084 2090
2085 print $output; 2091 print $output;
2086 print "\n"; 2092 print "\n";
2087 } 2093 }
OLDNEW
« 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