Changeset 148505 in webkit


Ignore:
Timestamp:
Apr 16, 2013 2:29:37 AM (11 years ago)
Author:
mjs@apple.com
Message:

Remove more traces of the now-obsolete support for V8
https://bugs.webkit.org/show_bug.cgi?id=114657

Reviewed by Ryosuke Niwa.

In addition to passing existing tests, I verified that the ElementFactory
and ElementWrapperFactory files were all textually identical before and after.

  • dom/CustomEvent.cpp:

(WebCore): Remove Use(V8) bock.

  • dom/CustomEvent.h:

(CustomEvent): ditto

  • dom/MessageEvent.cpp:

(WebCore::MessageEvent::MessageEvent): ditto
(WebCore::MessageEvent::initMessageEvent): ditto

  • dom/Node.h:

(Node): ditto

  • dom/make_event_factory.pl:

(generateImplementation): Remove V8 support.

  • dom/make_names.pl: Remove gobs of V8 support and simplify.

(printJSElementIncludes):
(printConditionalElementIncludes):
(printFactoryCppFile):
(printWrapperFunctions):
(printWrapperFactoryCppFile):
(printWrapperFactoryHeaderFile):

  • inspector/InjectedScriptCanvasModuleSource.js: Remove V8 stack

trace code.

  • platform/qt/PlatformSupport.h: Remove a macro only used for V8

bindings.

  • svg/SVGZoomAndPan.h:

(SVGZoomAndPan): Remove mention of V8 from comment.

Location:
trunk/Source/WebCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r148497 r148505  
     12013-04-15  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Remove more traces of the now-obsolete support for V8
     4        https://bugs.webkit.org/show_bug.cgi?id=114657
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        In addition to passing existing tests, I verified that the ElementFactory
     9        and ElementWrapperFactory files were all textually identical before and after.
     10
     11        * dom/CustomEvent.cpp:
     12        (WebCore): Remove Use(V8) bock.
     13        * dom/CustomEvent.h:
     14        (CustomEvent): ditto
     15        * dom/MessageEvent.cpp:
     16        (WebCore::MessageEvent::MessageEvent): ditto
     17        (WebCore::MessageEvent::initMessageEvent): ditto
     18        * dom/Node.h:
     19        (Node): ditto
     20        * dom/make_event_factory.pl:
     21        (generateImplementation): Remove V8 support.
     22        * dom/make_names.pl: Remove gobs of V8 support and simplify.
     23        (printJSElementIncludes):
     24        (printConditionalElementIncludes):
     25        (printFactoryCppFile):
     26        (printWrapperFunctions):
     27        (printWrapperFactoryCppFile):
     28        (printWrapperFactoryHeaderFile):
     29        * inspector/InjectedScriptCanvasModuleSource.js: Remove V8 stack
     30        trace code.
     31        * platform/qt/PlatformSupport.h: Remove a macro only used for V8
     32        bindings.
     33        * svg/SVGZoomAndPan.h:
     34        (SVGZoomAndPan): Remove mention of V8 from comment.
     35
    1362013-04-15  Ryosuke Niwa  <rniwa@webkit.org>
    237
  • trunk/Source/WebCore/dom/CustomEvent.cpp

    r134120 r148505  
    6060}
    6161
    62 #if USE(V8)
    63 void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> serializedScriptValue)
    64 {
    65     ASSERT(m_detail.hasNoValue());
    66     if (dispatched())
    67         return;
    68 
    69     initEvent(type, canBubble, cancelable);
    70 
    71     m_serializedScriptValue = serializedScriptValue;
    72 }
    73 #endif // USE(V8)
    74 
    7562const AtomicString& CustomEvent::interfaceName() const
    7663{
  • trunk/Source/WebCore/dom/CustomEvent.h

    r134120 r148505  
    5454
    5555    void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, const ScriptValue& detail);
    56 #if USE(V8)
    57     void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue>);
    58 #endif
    5956
    6057    virtual const AtomicString& interfaceName() const;
  • trunk/Source/WebCore/dom/MessageEvent.cpp

    r145930 r148505  
    7474    , m_ports(ports)
    7575{
    76 #if USE(V8)
    77     if (m_dataAsSerializedScriptValue)
    78         m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptContext();
    79 #endif
    8076}
    8177
     
    139135    m_source = source;
    140136    m_ports = ports;
    141 
    142 #if USE(V8)
    143     if (m_dataAsSerializedScriptValue)
    144         m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptContext();
    145 #endif
    146137}
    147138
  • trunk/Source/WebCore/dom/Node.h

    r148289 r148505  
    389389    void setHasEventTargetData(bool flag) { setFlag(flag, HasEventTargetDataFlag); }
    390390
    391 #if USE(V8)
    392     bool isV8CollectableDuringMinorGC() const { return getFlag(V8CollectableDuringMinorGCFlag); }
    393     void setV8CollectableDuringMinorGC(bool flag) { setFlag(flag, V8CollectableDuringMinorGCFlag); }
    394 #endif
    395 
    396391    enum ShouldSetAttached {
    397392        SetAttached,
     
    729724        HasScopedHTMLStyleChildFlag = 1 << 22,
    730725        HasEventTargetDataFlag = 1 << 23,
    731 #if USE(V8)
    732         V8CollectableDuringMinorGCFlag = 1 << 24,
    733 #endif
    734726        NeedsShadowTreeWalkerFlag = 1 << 25,
    735727        IsInShadowTreeFlag = 1 << 26,
  • trunk/Source/WebCore/dom/make_event_factory.pl

    r106603 r148505  
    8787    print F "\n";
    8888    print F "#include \"${namespace}Headers.h\"\n";
    89     print F "#if USE(V8)\n";
    90     print F "#include \"RuntimeEnabledFeatures.h\"\n";
    91     print F "#endif\n";
    9289    print F "\n";
    9390    print F "namespace WebCore {\n";
     
    10299
    103100        print F "#if ENABLE($conditional)\n" if $conditional;
    104         if ($runtimeConditional) {
    105             print F "    #if USE(V8)\n";
    106             print F "    // FIXME: JSC should support RuntimeEnabledFeatures as well.\n";
    107             print F "    if (type == \"$eventName\" && RuntimeEnabledFeatures::$runtimeConditional())\n";
    108             print F "        return ${interfaceName}::create();\n";
    109             print F "    #else\n";
    110         }
     101        # FIXEME JSC should support RuntimeEnabledFeatures
    111102        print F "    if (type == \"$eventName\")\n";
    112103        print F "        return ${interfaceName}::create();\n";
    113         print F "#endif // USE(V8)\n" if $runtimeConditional;
    114104        print F "#endif\n" if $conditional;
    115105    }
  • trunk/Source/WebCore/dom/make_names.pl

    r146851 r148505  
    4545my $printFactory = 0;
    4646my $printWrapperFactory = 0;
    47 my $printWrapperFactoryV8 = 0;
    4847my $fontNamesIn = "";
    4948my $tagsFile = "";
     
    8281    'preprocessor=s' => \$preprocessor,
    8382    'wrapperFactory' => \$printWrapperFactory,
    84     'wrapperFactoryV8' => \$printWrapperFactoryV8,
    8583    'fonts=s' => \$fontNamesIn
    8684);
     
    169167}
    170168
    171 die "You cannot specify both --wrapperFactory and --wrapperFactoryV8" if $printWrapperFactory && $printWrapperFactoryV8;
    172 my $wrapperFactoryType = "";
    173169if ($printWrapperFactory) {
    174     $wrapperFactoryType = "JS";
    175 } elsif ($printWrapperFactoryV8) {
    176     $wrapperFactoryType = "V8";
    177 }
    178 
    179 if ($wrapperFactoryType) {
    180     printWrapperFactoryCppFile($outputDir, $wrapperFactoryType, $wrapperFactoryFileName);
    181     printWrapperFactoryHeaderFile($outputDir, $wrapperFactoryType, $wrapperFactoryFileName);
     170    printWrapperFactoryCppFile($outputDir, $wrapperFactoryFileName);
     171    printWrapperFactoryHeaderFile($outputDir, $wrapperFactoryFileName);
    182172}
    183173
     
    729719{
    730720    my $F = shift;
    731     my $wrapperFactoryType = shift;
    732721
    733722    my %tagsSeen;
     
    741730        $tagsSeen{$JSInterfaceName} = 1;
    742731
    743         print F "#include \"${wrapperFactoryType}${JSInterfaceName}.h\"\n";
    744     }
    745     print F "#include \"${wrapperFactoryType}$parameters{fallbackInterfaceName}.h\"\n";
     732        print F "#include \"JS${JSInterfaceName}.h\"\n";
     733    }
     734    print F "#include \"JS$parameters{fallbackInterfaceName}.h\"\n";
    746735}
    747736
     
    767756sub printConditionalElementIncludes
    768757{
    769     my ($F, $wrapperFactoryType) = @_;
     758    my ($F, $wrapperIncludes) = @_;
    770759
    771760    my %conditionals;
     
    793782            print F "#include \"$interfaceName.h\"\n";
    794783        }
    795         if ($wrapperFactoryType) {
     784        if ($wrapperIncludes) {
    796785            for my $JSInterfaceName (sort keys %{$conditionals{$conditional}{JSInterfaceNames}}) {
    797786                next if $unconditionalJSElementIncludes{$JSInterfaceName};
    798                 print F "#include \"$wrapperFactoryType$JSInterfaceName.h\"\n";
     787                print F "#include \"JS$JSInterfaceName.h\"\n";
    799788            }
    800789        }
     
    850839print F "\n#include <wtf/HashMap.h>\n";
    851840
    852 printConditionalElementIncludes($F);
     841printConditionalElementIncludes($F, 0);
    853842
    854843print F <<END
     
    10401029{
    10411030    my $F = shift;
    1042     my $wrapperFactoryType = shift;
    10431031
    10441032    my %tagsSeen;
     
    10551043        }
    10561044
    1057         if ($wrapperFactoryType eq "JS") {
    1058             # Hack for the media tags
    1059             # FIXME: This should have been done via a CustomWrapper attribute and a separate *Custom file.
    1060             if ($enabledTags{$tagName}{wrapperOnlyIfMediaIsAvailable}) {
    1061                 print F <<END
     1045        # Hack for the media tags
     1046        # FIXME: This should have been done via a CustomWrapper attribute and a separate *Custom file.
     1047        if ($enabledTags{$tagName}{wrapperOnlyIfMediaIsAvailable}) {
     1048            print F <<END
    10621049static JSDOMWrapper* create${JSInterfaceName}Wrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<$parameters{namespace}Element> element)
    10631050{
     
    10691056
    10701057END
    1071 ;
    1072             } elsif ($enabledTags{$tagName}{contextConditional}) {
    1073                 my $contextConditional = $enabledTags{$tagName}{contextConditional};
    1074                 print F <<END
     1058    ;
     1059        } elsif ($enabledTags{$tagName}{contextConditional}) {
     1060            my $contextConditional = $enabledTags{$tagName}{contextConditional};
     1061            print F <<END
    10751062static JSDOMWrapper* create${JSInterfaceName}Wrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<$parameters{namespace}Element> element)
    10761063{
     
    10831070}
    10841071END
    1085 ;
    1086             } elsif ($enabledTags{$tagName}{runtimeConditional}) {
    1087                 my $runtimeConditional = $enabledTags{$tagName}{runtimeConditional};
    1088                 print F <<END
     1072    ;
     1073        } elsif ($enabledTags{$tagName}{runtimeConditional}) {
     1074            my $runtimeConditional = $enabledTags{$tagName}{runtimeConditional};
     1075            print F <<END
    10891076static JSDOMWrapper* create${JSInterfaceName}Wrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<$parameters{namespace}Element> element)
    10901077{
     
    10971084}
    10981085END
    1099 ;
    1100             } else {
    1101                 print F <<END
     1086    ;
     1087        } else {
     1088            print F <<END
    11021089static JSDOMWrapper* create${JSInterfaceName}Wrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<$parameters{namespace}Element> element)
    11031090{
     
    11061093
    11071094END
    1108 ;
    1109             }
    1110         } elsif ($wrapperFactoryType eq "V8") {
    1111             if ($enabledTags{$tagName}{wrapperOnlyIfMediaIsAvailable}) {
    1112                 print F <<END
    1113 static v8::Handle<v8::Object> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
    1114 {
    1115     Settings* settings = element->document()->settings();
    1116     if (!MediaPlayer::isAvailable() || (settings && !settings->mediaEnabled()))
    1117         return createV8$parameters{namespace}DirectWrapper(element, creationContext, isolate);
    1118     return wrap(static_cast<${JSInterfaceName}*>(element), creationContext, isolate);
    1119 }
    1120 
    1121 END
    1122 ;
    1123             } elsif ($enabledTags{$tagName}{contextConditional}) {
    1124                 my $contextConditional = $enabledTags{$tagName}{contextConditional};
    1125                 print F <<END
    1126 static v8::Handle<v8::Object> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
    1127 {
    1128     if (!ContextFeatures::${contextConditional}Enabled(element->document()))
    1129         return createV8$parameters{namespace}FallbackWrapper(to$parameters{fallbackInterfaceName}(element), creationContext, isolate);
    1130     return wrap(static_cast<${JSInterfaceName}*>(element), creationContext, isolate);
    1131 }
    1132 END
    1133 ;
    1134             } elsif ($enabledTags{$tagName}{runtimeConditional}) {
    1135                 my $runtimeConditional = $enabledTags{$tagName}{runtimeConditional};
    1136                 print F <<END
    1137 static v8::Handle<v8::Object> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
    1138 {
    1139     if (!RuntimeEnabledFeatures::${runtimeConditional}Enabled())
    1140         return createV8$parameters{namespace}FallbackWrapper(to$parameters{fallbackInterfaceName}(element), creationContext, isolate);
    1141     return wrap(static_cast<${JSInterfaceName}*>(element), creationContext, isolate);
    1142 }
    1143 END
    1144 ;
    1145             } elsif (${JSInterfaceName} eq "HTMLElement") {
    1146                 print F <<END
    1147 static v8::Handle<v8::Object> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
    1148 {
    1149     ASSERT_NOT_REACHED();
    1150     return v8::Handle<v8::Object>();
    1151 }
    1152 
    1153 END
    1154 ;
    1155              } else {
    1156             print F <<END
    1157 static v8::Handle<v8::Object> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
    1158 {
    1159     return wrap(static_cast<${JSInterfaceName}*>(element), creationContext, isolate);
    1160 }
    1161 
    1162 
    1163 END
    1164 ;
    1165             }
     1095    ;
    11661096        }
    11671097
     
    11751105{
    11761106    my $outputDir = shift;
    1177     my $wrapperFactoryType = shift;
    11781107    my $wrapperFactoryFileName = shift;
    11791108    my $F;
    1180     open F, ">" . $outputDir . "/" . $wrapperFactoryType . $wrapperFactoryFileName . ".cpp";
     1109    open F, ">" . $outputDir . "/JS" . $wrapperFactoryFileName . ".cpp";
    11811110
    11821111    printLicenseHeader($F);
    11831112
    11841113    print F "#include \"config.h\"\n";
    1185     print F "#include \"$wrapperFactoryType$parameters{namespace}ElementWrapperFactory.h\"\n";
     1114    print F "#include \"JS$parameters{namespace}ElementWrapperFactory.h\"\n";
    11861115
    11871116    print F "\n#if $parameters{guardFactoryWith}\n\n" if $parameters{guardFactoryWith};
    11881117
    1189     printJSElementIncludes($F, $wrapperFactoryType);
     1118    printJSElementIncludes($F);
    11901119
    11911120    print F "\n#include \"$parameters{namespace}Names.h\"\n\n";
     
    11951124    print F "\n#include <wtf/StdLibExtras.h>\n";
    11961125
    1197     printConditionalElementIncludes($F, $wrapperFactoryType);
     1126    printConditionalElementIncludes($F, 1);
    11981127
    11991128    print F <<END
     
    12101139;
    12111140
    1212     if ($wrapperFactoryType eq "JS") {   
    1213         print F <<END
     1141    print F <<END
    12141142using namespace JSC;
    12151143END
    12161144;
    1217     } elsif ($wrapperFactoryType eq "V8") {
    1218         print F <<END
    1219 #include "V8$parameters{namespace}Element.h"
    1220 
    1221 #if ENABLE(CUSTOM_ELEMENTS)
    1222 #include "CustomElementHelpers.h"
    1223 #endif
    1224 
    1225 #include <v8.h>
    1226 END
    1227 ;
    1228     }
    12291145
    12301146    print F <<END
     
    12361152END
    12371153;
    1238     if ($wrapperFactoryType eq "JS") {
    1239         print F <<END
     1154print F <<END
    12401155typedef JSDOMWrapper* (*Create$parameters{namespace}ElementWrapperFunction)(ExecState*, JSDOMGlobalObject*, PassRefPtr<$parameters{namespace}Element>);
    12411156
    12421157END
    12431158;
    1244     } elsif ($wrapperFactoryType eq "V8") {
    1245         print F <<END
    1246 typedef v8::Handle<v8::Object> (*Create$parameters{namespace}ElementWrapperFunction)($parameters{namespace}Element*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
    1247 
    1248 END
    1249 ;
    1250     }
    1251 
    1252     printWrapperFunctions($F, $wrapperFactoryType);
    1253 
    1254     if ($wrapperFactoryType eq "JS") {
    1255         print F <<END
     1159
     1160    printWrapperFunctions($F);
     1161
     1162print F <<END
    12561163JSDOMWrapper* createJS$parameters{namespace}Wrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<$parameters{namespace}Element> element)
    12571164{
     
    12611168END
    12621169;
    1263     } elsif ($wrapperFactoryType eq "V8") {
    1264         print F <<END
    1265 v8::Handle<v8::Object> createV8$parameters{namespace}Wrapper($parameters{namespace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
    1266 {
    1267     typedef HashMap<WTF::AtomicStringImpl*, Create$parameters{namespace}ElementWrapperFunction> FunctionMap;
    1268     DEFINE_STATIC_LOCAL(FunctionMap, map, ());
    1269     if (map.isEmpty()) {
    1270 END
    1271 ;
    1272     }
    12731170
    12741171    for my $tag (sort keys %enabledTags) {
     
    12941191END
    12951192;
    1296     if ($wrapperFactoryType eq "V8") {
    1297         print F <<END
    1298 #if ENABLE(CUSTOM_ELEMENTS)
    1299     if (PassRefPtr<CustomElementConstructor> constructor = CustomElementHelpers::constructorOf(element))
    1300         return CustomElementHelpers::wrap(element, creationContext, constructor, isolate);
    1301 #endif
    1302 END
    1303 ;
    1304     }
    13051193
    13061194    print F <<END
     
    13091197END
    13101198;
    1311     if ($wrapperFactoryType eq "JS") {
    1312         print F <<END
     1199    print F <<END
    13131200        return createWrapperFunction(exec, globalObject, element);
    13141201    return CREATE_DOM_WRAPPER(exec, globalObject, $parameters{fallbackInterfaceName}, element.get());
    13151202END
    13161203;
    1317     } elsif ($wrapperFactoryType eq "V8") {
    1318         print F <<END
    1319     {
    1320 END
    1321 ;
    1322         if ($parameters{namespace} eq "HTML") {
    1323             print F <<END
    1324         if (createWrapperFunction == createHTMLElementWrapper)
    1325            return V8HTMLElement::createWrapper(element, creationContext, isolate);
    1326 END
    1327         }
    1328         print F <<END
    1329         return createWrapperFunction(element, creationContext, isolate);
    1330     }
    1331 END
    1332 ;
    1333         if ($parameters{namespace} eq "SVG") {
    1334             print F <<END
    1335     return V8SVGElement::createWrapper(element, creationContext, isolate);
    1336 END
    1337 ;
    1338         } else {
    1339             print F <<END
    1340     return wrap(to$parameters{fallbackInterfaceName}(element), creationContext, isolate);
    1341 END
    1342 ;
    1343         }
    1344     }
    13451204    print F <<END
    13461205}
    13471206END
    13481207;
    1349 
    1350     if ($wrapperFactoryType eq "V8") {
    1351         print F <<END
    1352 
    1353 const QualifiedName* find$parameters{namespace}TagNameOfV8Type(const WrapperTypeInfo* type)
    1354 {
    1355     typedef HashMap<const WrapperTypeInfo*, const QualifiedName*> TypeNameMap;
    1356     DEFINE_STATIC_LOCAL(TypeNameMap, map, ());
    1357     if (map.isEmpty()) {
    1358 END
    1359 ;
    1360 
    1361         for my $tagName (sort keys %enabledTags) {
    1362             if (!usesDefaultJSWrapper($tagName)) {
    1363                 my $conditional = $enabledTags{$tagName}{conditional};
    1364                 if ($conditional) {
    1365                     my $conditionalString = "ENABLE(" . join(") && ENABLE(", split(/&/, $conditional)) . ")";
    1366                     print F "#if ${conditionalString}\n";
    1367                 }
    1368 
    1369                 my $JSInterfaceName = $enabledTags{$tagName}{JSInterfaceName};
    1370                 print F "       map.set(WrapperTypeTraits<${JSInterfaceName}>::info(), &${tagName}Tag);\n";
    1371 
    1372                 if ($conditional) {
    1373                     print F "#endif\n";
    1374                 }
    1375             }
    1376         }
    1377 
    1378         print F <<END
    1379     }
    1380 
    1381     return map.get(type);
    1382 }
    1383 
    1384 END
    1385 ;
    1386     }
    13871208
    13881209    print F "}\n\n";
     
    13951216{
    13961217    my $outputDir = shift;
    1397     my $wrapperFactoryType = shift;
    13981218    my $wrapperFactoryFileName = shift;
    13991219    my $F;
    1400     open F, ">" . $outputDir . "/" . $wrapperFactoryType . $wrapperFactoryFileName . ".h";
     1220    open F, ">" . $outputDir . "/JS" . $wrapperFactoryFileName . ".h";
    14011221
    14021222    printLicenseHeader($F);
    14031223
    1404     print F "#ifndef $wrapperFactoryType$parameters{namespace}ElementWrapperFactory_h\n";
    1405     print F "#define $wrapperFactoryType$parameters{namespace}ElementWrapperFactory_h\n\n";
     1224    print F "#ifndef JS$parameters{namespace}ElementWrapperFactory_h\n";
     1225    print F "#define JS$parameters{namespace}ElementWrapperFactory_h\n\n";
    14061226
    14071227    print F "#if $parameters{guardFactoryWith}\n" if $parameters{guardFactoryWith};
    14081228
    1409     if ($wrapperFactoryType eq "JS") {
    1410         print F <<END
     1229    print F <<END
    14111230#include <wtf/Forward.h>
    14121231
     
    14261245 
    14271246END
    1428 ;
    1429     } elsif ($wrapperFactoryType eq "V8") {
    1430         print F <<END
    1431 #include <V8$parameters{namespace}Element.h>
    1432 #include <V8$parameters{fallbackInterfaceName}.h>
    1433 #include <v8.h>
    1434 
    1435 namespace WebCore {
    1436 
    1437     class $parameters{namespace}Element;
    1438 
    1439     const QualifiedName* find$parameters{namespace}TagNameOfV8Type(const WrapperTypeInfo*);
    1440     v8::Handle<v8::Object> createV8$parameters{namespace}Wrapper($parameters{namespace}Element*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
    1441     inline v8::Handle<v8::Object> createV8$parameters{namespace}DirectWrapper($parameters{namespace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
    1442     {
    1443         return V8$parameters{namespace}Element::createWrapper(element, creationContext, isolate);
    1444     }
    1445     inline v8::Handle<v8::Object> createV8$parameters{namespace}FallbackWrapper($parameters{fallbackInterfaceName}* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
    1446     {
    1447         return V8$parameters{fallbackInterfaceName}::createWrapper(element, creationContext, isolate);
    1448     }
    1449 }
    1450 END
    1451 ;
    1452     }
     1247    ;
    14531248
    14541249    print F "#endif // $parameters{guardFactoryWith}\n\n" if $parameters{guardFactoryWith};
    14551250
    1456     print F "#endif // $wrapperFactoryType$parameters{namespace}ElementWrapperFactory_h\n";
     1251    print F "#endif // JS$parameters{namespace}ElementWrapperFactory_h\n";
    14571252
    14581253    close F;
  • trunk/Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js

    r144427 r148505  
    207207StackTrace.create = function(stackTraceLimit, topMostFunctionToIgnore)
    208208{
    209     if (typeof Error.captureStackTrace === "function")
    210         return new StackTraceV8(stackTraceLimit, topMostFunctionToIgnore || arguments.callee);
    211209    // FIXME: Support JSC, and maybe other browsers.
    212210    return null;
    213 }
    214 
    215 /**
    216  * @constructor
    217  * @implements {StackTrace}
    218  * @param {number=} stackTraceLimit
    219  * @param {Function=} topMostFunctionToIgnore
    220  * @see http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
    221  */
    222 function StackTraceV8(stackTraceLimit, topMostFunctionToIgnore)
    223 {
    224     StackTrace.call(this);
    225 
    226     var oldPrepareStackTrace = Error.prepareStackTrace;
    227     var oldStackTraceLimit = Error.stackTraceLimit;
    228     if (typeof stackTraceLimit === "number")
    229         Error.stackTraceLimit = stackTraceLimit;
    230 
    231     /**
    232      * @param {Object} error
    233      * @param {Array.<CallSite>} structuredStackTrace
    234      * @return {Array.<{sourceURL: string, lineNumber: number, columnNumber: number}>}
    235      */
    236     Error.prepareStackTrace = function(error, structuredStackTrace)
    237     {
    238         return structuredStackTrace.map(function(callSite) {
    239             return {
    240                 sourceURL: callSite.getFileName(),
    241                 lineNumber: callSite.getLineNumber(),
    242                 columnNumber: callSite.getColumnNumber()
    243             };
    244         });
    245     }
    246 
    247     var holder = /** @type {{stack: Array.<{sourceURL: string, lineNumber: number, columnNumber: number}>}} */ ({});
    248     Error.captureStackTrace(holder, topMostFunctionToIgnore || arguments.callee);
    249     this._stackTrace = holder.stack;
    250 
    251     Error.stackTraceLimit = oldStackTraceLimit;
    252     Error.prepareStackTrace = oldPrepareStackTrace;
    253 }
    254 
    255 StackTraceV8.prototype = {
    256     /**
    257      * @override
    258      * @param {number} index
    259      * @return {{sourceURL: string, lineNumber: number, columnNumber: number}|undefined}
    260      */
    261     callFrame: function(index)
    262     {
    263         return this._stackTrace[index];
    264     },
    265 
    266     __proto__: StackTrace.prototype
    267211}
    268212
     
    22752219    "textBaseline",
    22762220    "lineDashOffset",
    2277     // FIXME: Temporary properties implemented in JSC, but not in V8.
    22782221    "webkitLineDash",
    22792222    "webkitLineDashOffset"
  • trunk/Source/WebCore/platform/qt/PlatformSupport.h

    r127757 r148505  
    3232#include <wtf/text/WTFString.h>
    3333
    34 // V8 bindings use the ARRAYSIZE_UNSAFE macro. This macro was copied
    35 // from http://src.chromium.org/viewvc/chrome/trunk/src/base/basictypes.h
    36 //
    37 // ARRAYSIZE_UNSAFE performs essentially the same calculation as arraysize,
    38 // but can be used on anonymous types or types defined inside
    39 // functions. It's less safe than arraysize as it accepts some
    40 // (although not all) pointers. Therefore, you should use arraysize
    41 // whenever possible.
    42 //
    43 // The expression ARRAYSIZE_UNSAFE(a) is a compile-time constant of type
    44 // size_t.
    45 //
    46 // ARRAYSIZE_UNSAFE catches a few type errors. If you see a compiler error
    47 //
    48 //   "warning: division by zero in ..."
    49 //
    50 // when using ARRAYSIZE_UNSAFE, you are (wrongfully) giving it a pointer.
    51 // You should only use ARRAYSIZE_UNSAFE on statically allocated arrays.
    52 //
    53 // The following comments are on the implementation details, and can
    54 // be ignored by the users.
    55 //
    56 // ARRAYSIZE_UNSAFE(arr) works by inspecting sizeof(arr) (the # of bytes in
    57 // the array) and sizeof(*(arr)) (the # of bytes in one array
    58 // element). If the former is divisible by the latter, perhaps arr is
    59 // indeed an array, in which case the division result is the # of
    60 // elements in the array. Otherwise, arr cannot possibly be an array,
    61 // and we generate a compiler error to prevent the code from
    62 // compiling.
    63 //
    64 // Since the size of bool is implementation-defined, we need to cast
    65 // !(sizeof(a) & sizeof(*(a))) to size_t in order to ensure the final
    66 // result has type size_t.
    67 //
    68 // This macro is not perfect as it wrongfully accepts certain
    69 // pointers, namely where the pointer size is divisible by the pointee
    70 // size. Since all our code has to go through a 32-bit compiler,
    71 // where a pointer is 4 bytes, this means all pointers to a type whose
    72 // size is 3 or greater than 4 will be (righteously) rejected.
    73 
    74 #define ARRAYSIZE_UNSAFE(a) \
    75   ((sizeof(a) / sizeof(*(a))) / \
    76    static_cast<size_t>(!(sizeof(a) % sizeof(*(a)))))
    77 
    78 
    7934typedef struct NPObject NPObject;
    8035typedef struct _NPP NPP_t;
  • trunk/Source/WebCore/svg/SVGZoomAndPan.h

    r135069 r148505  
    7878    SVGZoomAndPanType zoomAndPan() const { return SVGZoomAndPanUnknown; }
    7979
    80     // These methods only exist to allow us to compile V8/JSSVGZoomAndPan.*.
     80    // These methods only exist to allow us to compile JSSVGZoomAndPan.*.
    8181    // These are never called, and thus ASSERT_NOT_REACHED.
    8282    void ref();
Note: See TracChangeset for help on using the changeset viewer.