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

Side by Side Diff: webkit/port/bindings/scripts/CodeGeneratorV8.pm

Issue 11544: Remove use of wide characters in stats table identifiers. (Closed)
Patch Set: Created 12 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 unified diff | Download patch
« no previous file with comments | « webkit/glue/webframe_impl.cc ('k') | webkit/port/bindings/v8/V8MessagePortCustom.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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 if ($function->signature->extendedAttributes->{"v8DoNotCheckSignature"}) { 371 if ($function->signature->extendedAttributes->{"v8DoNotCheckSignature"}) {
372 $signature = "v8::Local<v8::Signature>()"; 372 $signature = "v8::Local<v8::Signature>()";
373 } 373 }
374 374
375 my $newTemplateString = GenerateNewFunctionTemplate($function, $dataNode, $sig nature); 375 my $newTemplateString = GenerateNewFunctionTemplate($function, $dataNode, $sig nature);
376 376
377 $implIncludes{"v8_proxy.h"} = 1; 377 $implIncludes{"v8_proxy.h"} = 1;
378 378
379 push(@implContentDecls, <<END); 379 push(@implContentDecls, <<END);
380 static v8::Handle<v8::Value> ${funcName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { 380 static v8::Handle<v8::Value> ${funcName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
381 INC_STATS(L\"DOM.$implClassName.$funcName._get\"); 381 INC_STATS(\"DOM.$implClassName.$funcName._get\");
382 static v8::Persistent<v8::FunctionTemplate> private_template = 382 static v8::Persistent<v8::FunctionTemplate> private_template =
383 v8::Persistent<v8::FunctionTemplate>::New($newTemplateString); 383 v8::Persistent<v8::FunctionTemplate>::New($newTemplateString);
384 v8::Handle<v8::Object> holder = V8Proxy::LookupDOMWrapper(V8ClassIndex::$cla ssIndex, info.This()); 384 v8::Handle<v8::Object> holder = V8Proxy::LookupDOMWrapper(V8ClassIndex::$cla ssIndex, info.This());
385 if (holder.IsEmpty()) { 385 if (holder.IsEmpty()) {
386 // can only reach here by 'object.__proto__.func', and it should passed 386 // can only reach here by 'object.__proto__.func', and it should passed
387 // domain security check already 387 // domain security check already
388 388
389 return private_template->GetFunction(); 389 return private_template->GetFunction();
390 } 390 }
391 END 391 END
(...skipping 13 matching lines...) Expand all
405 405
406 END 406 END
407 } 407 }
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(L\"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 418
419 V8ClassIndex::V8WrapperType type = V8ClassIndex::FromInt(data->Int32Value()) ; 419 V8ClassIndex::V8WrapperType type = V8ClassIndex::FromInt(data->Int32Value()) ;
420 420
421 v8::Handle<v8::FunctionTemplate> desc = V8Proxy::GetTemplate(type); 421 v8::Handle<v8::FunctionTemplate> desc = V8Proxy::GetTemplate(type);
422 v8::Handle<v8::Function> func = desc->GetFunction(); 422 v8::Handle<v8::Function> func = desc->GetFunction();
423 ASSERT(func->IsFunction()); 423 ASSERT(func->IsFunction());
424 return func; 424 return func;
425 } 425 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 # Special case for SVGColor 466 # Special case for SVGColor
467 if (($implClassName eq "SVGColor") and ($attrName eq "rgbColor")) { 467 if (($implClassName eq "SVGColor") and ($attrName eq "rgbColor")) {
468 $attrIsPodType = 0; 468 $attrIsPodType = 0;
469 } 469 }
470 470
471 my $getterStringUsesImp = $implClassName ne "double"; 471 my $getterStringUsesImp = $implClassName ne "double";
472 472
473 # Getter 473 # Getter
474 push(@implContentDecls, <<END); 474 push(@implContentDecls, <<END);
475 static v8::Handle<v8::Value> ${attrName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { 475 static v8::Handle<v8::Value> ${attrName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
476 INC_STATS(L\"DOM.$implClassName.$attrName._get\"); 476 INC_STATS(\"DOM.$implClassName.$attrName._get\");
477 END 477 END
478 478
479 if ($isPodType) { 479 if ($isPodType) {
480 push(@implContentDecls, <<END); 480 push(@implContentDecls, <<END);
481 V8SVGPODTypeWrapper<$implClassName>* imp_wrapper = V8Proxy::ToNativeObject<V 8SVGPODTypeWrapper<$implClassName> >(V8ClassIndex::$classIndex, info.Holder()); 481 V8SVGPODTypeWrapper<$implClassName>* imp_wrapper = V8Proxy::ToNativeObject<V 8SVGPODTypeWrapper<$implClassName> >(V8ClassIndex::$classIndex, info.Holder());
482 $implClassName imp_instance = *imp_wrapper; 482 $implClassName imp_instance = *imp_wrapper;
483 END 483 END
484 if ($getterStringUsesImp) { 484 if ($getterStringUsesImp) {
485 push(@implContentDecls, <<END); 485 push(@implContentDecls, <<END);
486 $implClassName* imp = &imp_instance; 486 $implClassName* imp = &imp_instance;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 sub GenerateReplaceableAttrSetter 614 sub GenerateReplaceableAttrSetter
615 { 615 {
616 my $implClassName = shift; 616 my $implClassName = shift;
617 617
618 $implIncludes{"v8_proxy.h"} = 1; 618 $implIncludes{"v8_proxy.h"} = 1;
619 619
620 push(@implContentDecls, 620 push(@implContentDecls,
621 " static void ${attrName}AttrSetter(v8::Local<v8::String> name," . 621 " static void ${attrName}AttrSetter(v8::Local<v8::String> name," .
622 " v8::Local<v8::Value> value, const v8::AccessorInfo& info)\n{\n"); 622 " v8::Local<v8::Value> value, const v8::AccessorInfo& info)\n{\n");
623 623
624 push(@implContentDecls, " INC_STATS(L\"DOM.$implClassName.$attrName._set\") ;\n"); 624 push(@implContentDecls, " INC_STATS(\"DOM.$implClassName.$attrName._set\"); \n");
625 625
626 push(@implContentDecls, " v8::Local<v8::String> ${attrName}_string = v8::St ring::New(\"${attrName}\");\n"); 626 push(@implContentDecls, " v8::Local<v8::String> ${attrName}_string = v8::St ring::New(\"${attrName}\");\n");
627 push(@implContentDecls, " info.Holder()->Delete(${attrName}_string);\n"); 627 push(@implContentDecls, " info.Holder()->Delete(${attrName}_string);\n");
628 push(@implContentDecls, " info.This()->Set(${attrName}_string, value);\n"); 628 push(@implContentDecls, " info.This()->Set(${attrName}_string, value);\n");
629 push(@implContentDecls, " }\n\n"); 629 push(@implContentDecls, " }\n\n");
630 } 630 }
631 631
632 632
633 sub GenerateNormalAttrSetter 633 sub GenerateNormalAttrSetter
634 { 634 {
635 my $attribute = shift; 635 my $attribute = shift;
636 my $dataNode = shift; 636 my $dataNode = shift;
637 my $classIndex = shift; 637 my $classIndex = shift;
638 my $implClassName = shift; 638 my $implClassName = shift;
639 639
640 my $attrExt = $attribute->signature->extendedAttributes; 640 my $attrExt = $attribute->signature->extendedAttributes;
641 641
642 $implIncludes{"v8_proxy.h"} = 1; 642 $implIncludes{"v8_proxy.h"} = 1;
643 643
644 push(@implContentDecls, 644 push(@implContentDecls,
645 " static void ${attrName}AttrSetter(v8::Local<v8::String> name," . 645 " static void ${attrName}AttrSetter(v8::Local<v8::String> name," .
646 " v8::Local<v8::Value> value, const v8::AccessorInfo& info)\n{\n"); 646 " v8::Local<v8::Value> value, const v8::AccessorInfo& info)\n{\n");
647 647
648 push(@implContentDecls, " INC_STATS(L\"DOM.$implClassName.$attrName._set\") ;\n"); 648 push(@implContentDecls, " INC_STATS(\"DOM.$implClassName.$attrName._set\"); \n");
649 649
650 my $isPodType = $codeGenerator->IsPodType($implClassName); 650 my $isPodType = $codeGenerator->IsPodType($implClassName);
651 651
652 if ($isPodType) { 652 if ($isPodType) {
653 $implClassName = GetNativeType($implClassName); 653 $implClassName = GetNativeType($implClassName);
654 $implIncludes{"V8SVGPODTypeWrapper.h"} = 1; 654 $implIncludes{"V8SVGPODTypeWrapper.h"} = 1;
655 push(@implContentDecls, " V8SVGPODTypeWrapper<$implClassName>* wrapper = V8Proxy::ToNativeObject<V8SVGPODTypeWrapper<$implClassName> >(V8ClassIndex::$cla ssIndex, info.Holder());\n"); 655 push(@implContentDecls, " V8SVGPODTypeWrapper<$implClassName>* wrapper = V8Proxy::ToNativeObject<V8SVGPODTypeWrapper<$implClassName> >(V8ClassIndex::$cla ssIndex, info.Holder());\n");
656 push(@implContentDecls, " $implClassName imp_instance = *wrapper;\n"); 656 push(@implContentDecls, " $implClassName imp_instance = *wrapper;\n");
657 push(@implContentDecls, " $implClassName* imp = &imp_instance;\n"); 657 push(@implContentDecls, " $implClassName* imp = &imp_instance;\n");
658 658
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 my $function = shift; 751 my $function = shift;
752 my $dataNode = shift; 752 my $dataNode = shift;
753 my $classIndex = shift; 753 my $classIndex = shift;
754 my $implClassName = shift; 754 my $implClassName = shift;
755 755
756 my $interfaceName = $dataNode->name; 756 my $interfaceName = $dataNode->name;
757 my $name = $function->signature->name; 757 my $name = $function->signature->name;
758 758
759 push(@implContentDecls, 759 push(@implContentDecls,
760 " static v8::Handle<v8::Value> ${name}Callback(const v8::Arguments& args)\n{\n" . 760 " static v8::Handle<v8::Value> ${name}Callback(const v8::Arguments& args)\n{\n" .
761 " INC_STATS(L\"DOM.$implClassName.$name\");\n"); 761 " INC_STATS(\"DOM.$implClassName.$name\");\n");
762 762
763 my $numParameters = @{$function->parameters}; 763 my $numParameters = @{$function->parameters};
764 764
765 if ($function->signature->extendedAttributes->{"RequiresAllArguments"}) { 765 if ($function->signature->extendedAttributes->{"RequiresAllArguments"}) {
766 push(@implContentDecls, 766 push(@implContentDecls,
767 " if (args.Length() < $numParameters) return v8::Undefined();\n"); 767 " if (args.Length() < $numParameters) return v8::Undefined();\n");
768 } 768 }
769 769
770 if ($codeGenerator->IsPodType($implClassName)) { 770 if ($codeGenerator->IsPodType($implClassName)) {
771 my $nativeClassName = GetNativeType($implClassName); 771 my $nativeClassName = GetNativeType($implClassName);
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after
2065 return 0; 2065 return 0;
2066 } 2066 }
2067 2067
2068 sub DebugPrint 2068 sub DebugPrint
2069 { 2069 {
2070 my $output = shift; 2070 my $output = shift;
2071 2071
2072 print $output; 2072 print $output;
2073 print "\n"; 2073 print "\n";
2074 } 2074 }
OLDNEW
« no previous file with comments | « webkit/glue/webframe_impl.cc ('k') | webkit/port/bindings/v8/V8MessagePortCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698