Title: [98793] trunk
Revision
98793
Author
[email protected]
Date
2011-10-28 18:56:13 -0700 (Fri, 28 Oct 2011)

Log Message

Rename ExceptionCodeDescription.in to DOMExceptions.in
https://bugs.webkit.org/show_bug.cgi?id=71157

Reviewed by Eric Seidel.

.:

* Source/cmake/WebKitMacros.cmake:

Source/WebCore:

This file is now used for more than just the descriptions of the exceptions.

* CMakeLists.txt:
* CodeGenerators.pri:
* DerivedSources.make:
* GNUmakefile.am:
* WebCore.gyp/WebCore.gyp:
* WebCore.gyp/scripts/action_makenames.py:
* dom/DOMExceptions.in: Copied from Source/WebCore/dom/ExceptionCodeDescription.in.
* dom/ExceptionCodeDescription.in: Removed.
* dom/make_dom_exceptions.pl: Copied from Source/WebCore/dom/make_exception_code_description.pl.
* dom/make_exception_code_description.pl: Removed.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/ChangeLog (98792 => 98793)


--- trunk/ChangeLog	2011-10-29 01:47:50 UTC (rev 98792)
+++ trunk/ChangeLog	2011-10-29 01:56:13 UTC (rev 98793)
@@ -1,5 +1,14 @@
 2011-10-28  Adam Barth  <[email protected]>
 
+        Rename ExceptionCodeDescription.in to DOMExceptions.in
+        https://bugs.webkit.org/show_bug.cgi?id=71157
+
+        Reviewed by Eric Seidel.
+
+        * Source/cmake/WebKitMacros.cmake:
+
+2011-10-28  Adam Barth  <[email protected]>
+
         ExceptionCode.cpp shouldn't need to know about every feature that throws exceptions
         https://bugs.webkit.org/show_bug.cgi?id=70890
 

Modified: trunk/Source/WebCore/CMakeLists.txt (98792 => 98793)


--- trunk/Source/WebCore/CMakeLists.txt	2011-10-29 01:47:50 UTC (rev 98792)
+++ trunk/Source/WebCore/CMakeLists.txt	2011-10-29 01:56:13 UTC (rev 98793)
@@ -2332,7 +2332,7 @@
 ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/dom/EventNames.cpp EventTargetInterfaces.h)
 
 
-GENERATE_EXCEPTION_CODE_DESCRIPTION(${WEBCORE_DIR}/dom/ExceptionCodeDescription.in ExceptionCodeDescription.cpp)
+GENERATE_EXCEPTION_CODE_DESCRIPTION(${WEBCORE_DIR}/dom/DOMExceptions.in ExceptionCodeDescription.cpp)
 LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/ExceptionCodeDescription.cpp)
 
 

Modified: trunk/Source/WebCore/ChangeLog (98792 => 98793)


--- trunk/Source/WebCore/ChangeLog	2011-10-29 01:47:50 UTC (rev 98792)
+++ trunk/Source/WebCore/ChangeLog	2011-10-29 01:56:13 UTC (rev 98793)
@@ -1,3 +1,23 @@
+2011-10-28  Adam Barth  <[email protected]>
+
+        Rename ExceptionCodeDescription.in to DOMExceptions.in
+        https://bugs.webkit.org/show_bug.cgi?id=71157
+
+        Reviewed by Eric Seidel.
+
+        This file is now used for more than just the descriptions of the exceptions.
+
+        * CMakeLists.txt:
+        * CodeGenerators.pri:
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * WebCore.gyp/WebCore.gyp:
+        * WebCore.gyp/scripts/action_makenames.py:
+        * dom/DOMExceptions.in: Copied from Source/WebCore/dom/ExceptionCodeDescription.in.
+        * dom/ExceptionCodeDescription.in: Removed.
+        * dom/make_dom_exceptions.pl: Copied from Source/WebCore/dom/make_exception_code_description.pl.
+        * dom/make_exception_code_description.pl: Removed.
+
 2011-10-28  Chris Rogers  <[email protected]>
 
         SincResampler must be able to resample progressively

Modified: trunk/Source/WebCore/CodeGenerators.pri (98792 => 98793)


--- trunk/Source/WebCore/CodeGenerators.pri	2011-10-29 01:47:50 UTC (rev 98792)
+++ trunk/Source/WebCore/CodeGenerators.pri	2011-10-29 01:56:13 UTC (rev 98793)
@@ -36,7 +36,7 @@
 
 EVENT_TARGET_FACTORY = $$PWD/dom/EventTargetFactory.in
 
-EXCEPTION_CODE_DESCRIPTION = $$PWD/dom/ExceptionCodeDescription.in
+DOM_EXCEPTIONS = $$PWD/dom/DOMExceptions.in
 
 COLORDATA_GPERF = $$PWD/platform/ColorData.gperf
 
@@ -774,10 +774,10 @@
 
 # GENERATOR 5-G:
 exceptioncodedescription.output = $${WC_GENERATED_SOURCES_DIR}/ExceptionCodeDescription.cpp
-exceptioncodedescription.input = EXCEPTION_CODE_DESCRIPTION
-exceptioncodedescription.wkScript = $$PWD/dom/make_exception_code_description.pl
-exceptioncodedescription.commands = perl -I$$PWD/bindings/scripts $$exceptioncodedescription.wkScript --input $$EXCEPTION_CODE_DESCRIPTION --outputDir $$WC_GENERATED_SOURCES_DIR
-exceptioncodedescription.depends = $$PWD/dom/make_exception_code_description.pl $$EXCEPTION_CODE_DESCRIPTION
+exceptioncodedescription.input = DOM_EXCEPTIONS
+exceptioncodedescription.wkScript = $$PWD/dom/make_dom_exceptions.pl
+exceptioncodedescription.commands = perl -I$$PWD/bindings/scripts $$exceptioncodedescription.wkScript --input $$DOM_EXCEPTIONS --outputDir $$WC_GENERATED_SOURCES_DIR
+exceptioncodedescription.depends = $$PWD/dom/make_dom_exceptions.pl $$DOM_EXCEPTIONS
 addExtraCompiler(exceptioncodedescription)
 
 # GENERATOR 8-A:

Modified: trunk/Source/WebCore/DerivedSources.make (98792 => 98793)


--- trunk/Source/WebCore/DerivedSources.make	2011-10-29 01:47:50 UTC (rev 98792)
+++ trunk/Source/WebCore/DerivedSources.make	2011-10-29 01:56:13 UTC (rev 98793)
@@ -857,8 +857,8 @@
 EventTargetHeaders.h EventTargetInterfaces.h : dom/make_event_factory.pl dom/EventTargetFactory.in
 	perl -I $(WebCore)/bindings/scripts $< --input $(WebCore)/dom/EventTargetFactory.in
 
-ExceptionCodeDescription.cpp ExceptionCodeDescription.h ExceptionHeaders.h ExceptionInterfaces.h : dom/make_exception_code_description.pl dom/ExceptionCodeDescription.in
-	perl -I $(WebCore)/bindings/scripts $< --input $(WebCore)/dom/ExceptionCodeDescription.in
+ExceptionCodeDescription.cpp ExceptionCodeDescription.h ExceptionHeaders.h ExceptionInterfaces.h : dom/make_dom_exceptions.pl dom/DOMExceptions.in
+	perl -I $(WebCore)/bindings/scripts $< --input $(WebCore)/dom/DOMExceptions.in
 
 # --------
  

Modified: trunk/Source/WebCore/GNUmakefile.am (98792 => 98793)


--- trunk/Source/WebCore/GNUmakefile.am	2011-10-29 01:47:50 UTC (rev 98792)
+++ trunk/Source/WebCore/GNUmakefile.am	2011-10-29 01:56:13 UTC (rev 98793)
@@ -696,8 +696,8 @@
 DerivedSources/WebCore/EventTargetHeaders.h DerivedSources/WebCore/EventTargetInterfaces.h: $(WebCore)/dom/make_event_factory.pl $(WebCore)/dom/EventTargetFactory.in
 	$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --input $(WebCore)/dom/EventTargetFactory.in --outputDir "$(GENSOURCES_WEBCORE)"
 
-DerivedSources/WebCore/ExceptionCodeDescription.cpp DerivedSources/WebCore/ExceptionCodeDescription.h DerivedSources/WebCore/ExceptionHeaders.h DerivedSources/WebCore/ExceptionInterfaces.h: $(WebCore)/dom/make_exception_code_description.pl $(WebCore)/dom/ExceptionCodeDescription.in
-	$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --input $(WebCore)/dom/ExceptionCodeDescription.in --outputDir "$(GENSOURCES_WEBCORE)"
+DerivedSources/WebCore/ExceptionCodeDescription.cpp DerivedSources/WebCore/ExceptionCodeDescription.h DerivedSources/WebCore/ExceptionHeaders.h DerivedSources/WebCore/ExceptionInterfaces.h: $(WebCore)/dom/make_dom_exceptions.pl $(WebCore)/dom/DOMExceptions.in
+	$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --input $(WebCore)/dom/DOMExceptions.in --outputDir "$(GENSOURCES_WEBCORE)"
 
 # All Web Inspector generated files are created with this one call to CodeGeneratorInspector.py
 DerivedSources/WebCore/InspectorProtocolVersion.h : $(WebCore)/inspector/Inspector.json $(WebCore)/inspector/generate-inspector-protocol-version
@@ -875,6 +875,7 @@
 	Source/WebCore/css/CSSGrammar.y \
 	Source/WebCore/css/CSSPropertyNames.in \
 	Source/WebCore/css/CSSValueKeywords.in \
+	Source/WebCore/dom/DOMExceptions.in \
 	Source/WebCore/css/fullscreen.css \
 	Source/WebCore/css/fullscreenQuickTime.css \
 	Source/WebCore/css/html.css \
@@ -895,10 +896,9 @@
 	Source/WebCore/css/WebKitFontFamilyNames.in \
 	Source/WebCore/dom/EventFactory.in \
 	Source/WebCore/dom/EventTargetFactory.in \
-	Source/WebCore/dom/ExceptionCodeDescription.in \
+	Source/WebCore/dom/make_dom_exceptions.pl \
+	Source/WebCore/dom/make_event_factory.pl \
 	Source/WebCore/dom/make_names.pl \
-	Source/WebCore/dom/make_event_factory.pl \
-	Source/WebCore/dom/make_exception_code_description.pl \
 	Source/WebCore/html/HTMLAttributeNames.in \
 	Source/WebCore/html/HTMLTagNames.in \
 	Source/WebCore/html/parser/create-html-entity-table \

Modified: trunk/Source/WebCore/WebCore.gyp/WebCore.gyp (98792 => 98793)


--- trunk/Source/WebCore/WebCore.gyp/WebCore.gyp	2011-10-29 01:47:50 UTC (rev 98792)
+++ trunk/Source/WebCore/WebCore.gyp/WebCore.gyp	2011-10-29 01:56:13 UTC (rev 98793)
@@ -698,8 +698,8 @@
         {
           'action_name': 'ExceptionCodeDescription',
           'inputs': [
-            '../dom/make_exception_code_description.pl',
-            '../dom/ExceptionCodeDescription.in',
+            '../dom/make_dom_exceptions.pl',
+            '../dom/DOMExceptions.in',
           ],
           'outputs': [
             '<(SHARED_INTERMEDIATE_DIR)/webkit/ExceptionCodeDescription.cpp',

Modified: trunk/Source/WebCore/WebCore.gyp/scripts/action_makenames.py (98792 => 98793)


--- trunk/Source/WebCore/WebCore.gyp/scripts/action_makenames.py	2011-10-29 01:47:50 UTC (rev 98792)
+++ trunk/Source/WebCore/WebCore.gyp/scripts/action_makenames.py	2011-10-29 01:56:13 UTC (rev 98793)
@@ -119,7 +119,7 @@
         inputBasename = os.path.basename(input)
         if inputBasename == 'make_names.pl' \
             or inputBasename == 'make_event_factory.pl' \
-            or inputBasename == 'make_exception_code_description.pl':
+            or inputBasename == 'make_dom_exceptions.pl':
             assert makeNamesInput == None
             makeNamesInput = inputAbs
         elif inputBasename.endswith('TagNames.in') \
@@ -132,7 +132,7 @@
             attrInput = inputAbsPosix
         elif inputBasename.endswith('EventFactory.in') \
             or inputBasename.endswith('EventTargetFactory.in') \
-            or inputBasename.endswith('ExceptionCodeDescription.in'):
+            or inputBasename.endswith('DOMExceptions.in'):
             eventsInput = inputAbsPosix
         elif inputBasename.endswith('Names.in'):
             options.append(inputAbsPosix)

Copied: trunk/Source/WebCore/dom/DOMExceptions.in (from rev 98792, trunk/Source/WebCore/dom/ExceptionCodeDescription.in) (0 => 98793)


--- trunk/Source/WebCore/dom/DOMExceptions.in	                        (rev 0)
+++ trunk/Source/WebCore/dom/DOMExceptions.in	2011-10-29 01:56:13 UTC (rev 98793)
@@ -0,0 +1,12 @@
+namespace=Exception
+
+DOMCoreException
+EventException
+FileException conditional=BLOB
+IDBDatabaseException conditional=INDEXED_DATABASE
+OperationNotAllowedException conditional=BLOB
+RangeException
+SQLException conditional=SQL_DATABASE
+SVGException conditional=SVG
+XMLHttpRequestException
+XPathException

Deleted: trunk/Source/WebCore/dom/ExceptionCodeDescription.in (98792 => 98793)


--- trunk/Source/WebCore/dom/ExceptionCodeDescription.in	2011-10-29 01:47:50 UTC (rev 98792)
+++ trunk/Source/WebCore/dom/ExceptionCodeDescription.in	2011-10-29 01:56:13 UTC (rev 98793)
@@ -1,12 +0,0 @@
-namespace=Exception
-
-DOMCoreException
-EventException
-FileException conditional=BLOB
-IDBDatabaseException conditional=INDEXED_DATABASE
-OperationNotAllowedException conditional=BLOB
-RangeException
-SQLException conditional=SQL_DATABASE
-SVGException conditional=SVG
-XMLHttpRequestException
-XPathException

Copied: trunk/Source/WebCore/dom/make_dom_exceptions.pl (from rev 98792, trunk/Source/WebCore/dom/make_exception_code_description.pl) (0 => 98793)


--- trunk/Source/WebCore/dom/make_dom_exceptions.pl	                        (rev 0)
+++ trunk/Source/WebCore/dom/make_dom_exceptions.pl	2011-10-29 01:56:13 UTC (rev 98793)
@@ -0,0 +1,181 @@
+#!/usr/bin/perl -w
+
+# Copyright (C) 2005, 2006, 2007, 2009 Apple Inc. All rights reserved.
+# Copyright (C) 2009, Julien Chaffraix <[email protected]>
+# Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+# Copyright (C) 2011 Ericsson AB. All rights reserved.
+# Copyright (C) 2011 Google, Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer. 
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution. 
+# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+#     its contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission. 
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+use strict;
+
+use InFilesCompiler;
+
+my %defaultParameters = (
+    'namespace' => 0
+);
+
+sub defaultItemFactory
+{
+    return (
+        'interfaceName' => 0,
+        'conditional' => 0
+    );
+}
+
+my $InCompiler = InFilesCompiler->new(\%defaultParameters, \&defaultItemFactory);
+
+my $outputDir = $InCompiler->initializeFromCommandLine();
+$InCompiler->compile(\&generateCode);
+
+sub generateCode()
+{
+    my $parsedParametersRef = shift;
+    my $parsedItemsRef = shift;
+
+    generateHeader($parsedParametersRef, $parsedItemsRef);
+    generateImplementation($parsedParametersRef, $parsedItemsRef);
+    $InCompiler->generateInterfacesHeader();
+    $InCompiler->generateHeadersHeader()
+}
+
+sub generateHeader()
+{
+    my $parsedParametersRef = shift;
+    my $parsedItemsRef = shift;
+
+    my $F;
+    my %parsedItems = %{ $parsedItemsRef };
+
+    my $outputFile = "$outputDir/ExceptionCodeDescription.h";
+
+    open F, ">$outputFile" or die "Failed to open file: $!";
+
+    print F $InCompiler->license();
+
+    print F "#ifndef ExceptionCodeDescription_h\n";
+    print F "#define ExceptionCodeDescription_h\n";
+    print F "\n";
+    print F "namespace WebCore {\n";
+    print F "\n";
+    print F "typedef int ExceptionCode;\n";
+    print F "\n";
+    print F "enum ExceptionType {\n";
+
+    for my $exceptionType (sort keys %parsedItems) {
+        my $conditional = $parsedItems{$exceptionType}{"conditional"};
+
+        print F "#if ENABLE($conditional)\n" if $conditional;
+        print F "    ${exceptionType}Type,\n";
+        print F "#endif\n" if $conditional;
+    }
+
+    print F "};\n";
+    print F "\n";
+    print F "struct ExceptionCodeDescription {\n";
+    print F "    explicit ExceptionCodeDescription(ExceptionCode);\n";
+    print F "\n";
+    print F "    // |typeName| has spaces and is suitable for use in exception\n";
+    print F "    // description strings; maximum length is 10 characters.\n";
+    print F "    const char* typeName; \n";
+    print F "\n";
+    print F "    // |name| is the exception name, also intended for use in exception\n";
+    print F "    // description strings; 0 if name not known; maximum length is 27\n";
+    print F "    // characters.\n";
+    print F "    const char* name; \n";
+    print F "\n";
+    print F "    // |description| is the exception description, intended for use in\n";
+    print F "    // exception strings. It is a more readable explanation of error.\n";
+    print F "    const char* description;\n";
+    print F "\n";
+    print F "    // |code| is the numeric value of the exception within a particular type.\n";
+    print F "    int code; \n";
+    print F "\n";
+    print F "    ExceptionType type;\n";
+    print F "};\n";
+    print F "\n";
+    print F "} // namespace WebCore\n";
+    print F "\n";
+    print F "#endif // ExceptionCodeDescription_h\n";
+
+    close F;
+}
+
+sub generateImplementation()
+{
+    my $parsedParametersRef = shift;
+    my $parsedItemsRef = shift;
+
+    my $F;
+    my %parsedItems = %{ $parsedItemsRef };
+
+    my $outputFile = "$outputDir/ExceptionCodeDescription.cpp";
+
+    open F, ">$outputFile" or die "Failed to open file: $!";
+
+    print F $InCompiler->license();
+
+    print F "#include \"config.h\"\n";
+    print F "#include \"ExceptionCodeDescription.h\"\n";
+    print F "\n";
+    print F "#include \"ExceptionCode.h\"\n";
+
+    for my $exceptionType (sort keys %parsedItems) {
+        my $conditional = $parsedItems{$exceptionType}{"conditional"};
+
+        print F "#if ENABLE($conditional)\n" if $conditional;
+        print F "#include \"$exceptionType.h\"\n";
+        print F "#endif\n" if $conditional;
+    }
+
+    print F "\n";
+    print F "namespace WebCore {\n";
+    print F "\n";
+    print F "ExceptionCodeDescription::ExceptionCodeDescription(ExceptionCode ec)\n";
+    print F "{\n";
+    print F "    ASSERT(ec);\n";
+
+    for my $exceptionType (sort keys %parsedItems) {
+        # DOMCoreException needs to be last because it's a catch-all.
+        next if $exceptionType eq "DOMCoreException";
+
+        my $conditional = $parsedItems{$exceptionType}{"conditional"};
+
+        print F "#if ENABLE($conditional)\n" if $conditional;
+        print F "    if (${exceptionType}::initializeDescription(ec, this))\n";
+        print F "        return;\n";
+        print F "#endif\n" if $conditional;
+    }
+
+    print F "    if (DOMCoreException::initializeDescription(ec, this))\n";
+    print F "        return;\n";
+    print F "    ASSERT_NOT_REACHED();\n";
+    print F "}\n";
+    print F "\n";
+    print F "} // namespace WebCore\n";
+
+    close F;
+}

Deleted: trunk/Source/WebCore/dom/make_exception_code_description.pl (98792 => 98793)


--- trunk/Source/WebCore/dom/make_exception_code_description.pl	2011-10-29 01:47:50 UTC (rev 98792)
+++ trunk/Source/WebCore/dom/make_exception_code_description.pl	2011-10-29 01:56:13 UTC (rev 98793)
@@ -1,181 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005, 2006, 2007, 2009 Apple Inc. All rights reserved.
-# Copyright (C) 2009, Julien Chaffraix <[email protected]>
-# Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
-# Copyright (C) 2011 Ericsson AB. All rights reserved.
-# Copyright (C) 2011 Google, Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-
-use InFilesCompiler;
-
-my %defaultParameters = (
-    'namespace' => 0
-);
-
-sub defaultItemFactory
-{
-    return (
-        'interfaceName' => 0,
-        'conditional' => 0
-    );
-}
-
-my $InCompiler = InFilesCompiler->new(\%defaultParameters, \&defaultItemFactory);
-
-my $outputDir = $InCompiler->initializeFromCommandLine();
-$InCompiler->compile(\&generateCode);
-
-sub generateCode()
-{
-    my $parsedParametersRef = shift;
-    my $parsedItemsRef = shift;
-
-    generateHeader($parsedParametersRef, $parsedItemsRef);
-    generateImplementation($parsedParametersRef, $parsedItemsRef);
-    $InCompiler->generateInterfacesHeader();
-    $InCompiler->generateHeadersHeader()
-}
-
-sub generateHeader()
-{
-    my $parsedParametersRef = shift;
-    my $parsedItemsRef = shift;
-
-    my $F;
-    my %parsedItems = %{ $parsedItemsRef };
-
-    my $outputFile = "$outputDir/ExceptionCodeDescription.h";
-
-    open F, ">$outputFile" or die "Failed to open file: $!";
-
-    print F $InCompiler->license();
-
-    print F "#ifndef ExceptionCodeDescription_h\n";
-    print F "#define ExceptionCodeDescription_h\n";
-    print F "\n";
-    print F "namespace WebCore {\n";
-    print F "\n";
-    print F "typedef int ExceptionCode;\n";
-    print F "\n";
-    print F "enum ExceptionType {\n";
-
-    for my $exceptionType (sort keys %parsedItems) {
-        my $conditional = $parsedItems{$exceptionType}{"conditional"};
-
-        print F "#if ENABLE($conditional)\n" if $conditional;
-        print F "    ${exceptionType}Type,\n";
-        print F "#endif\n" if $conditional;
-    }
-
-    print F "};\n";
-    print F "\n";
-    print F "struct ExceptionCodeDescription {\n";
-    print F "    explicit ExceptionCodeDescription(ExceptionCode);\n";
-    print F "\n";
-    print F "    // |typeName| has spaces and is suitable for use in exception\n";
-    print F "    // description strings; maximum length is 10 characters.\n";
-    print F "    const char* typeName; \n";
-    print F "\n";
-    print F "    // |name| is the exception name, also intended for use in exception\n";
-    print F "    // description strings; 0 if name not known; maximum length is 27\n";
-    print F "    // characters.\n";
-    print F "    const char* name; \n";
-    print F "\n";
-    print F "    // |description| is the exception description, intended for use in\n";
-    print F "    // exception strings. It is a more readable explanation of error.\n";
-    print F "    const char* description;\n";
-    print F "\n";
-    print F "    // |code| is the numeric value of the exception within a particular type.\n";
-    print F "    int code; \n";
-    print F "\n";
-    print F "    ExceptionType type;\n";
-    print F "};\n";
-    print F "\n";
-    print F "} // namespace WebCore\n";
-    print F "\n";
-    print F "#endif // ExceptionCodeDescription_h\n";
-
-    close F;
-}
-
-sub generateImplementation()
-{
-    my $parsedParametersRef = shift;
-    my $parsedItemsRef = shift;
-
-    my $F;
-    my %parsedItems = %{ $parsedItemsRef };
-
-    my $outputFile = "$outputDir/ExceptionCodeDescription.cpp";
-
-    open F, ">$outputFile" or die "Failed to open file: $!";
-
-    print F $InCompiler->license();
-
-    print F "#include \"config.h\"\n";
-    print F "#include \"ExceptionCodeDescription.h\"\n";
-    print F "\n";
-    print F "#include \"ExceptionCode.h\"\n";
-
-    for my $exceptionType (sort keys %parsedItems) {
-        my $conditional = $parsedItems{$exceptionType}{"conditional"};
-
-        print F "#if ENABLE($conditional)\n" if $conditional;
-        print F "#include \"$exceptionType.h\"\n";
-        print F "#endif\n" if $conditional;
-    }
-
-    print F "\n";
-    print F "namespace WebCore {\n";
-    print F "\n";
-    print F "ExceptionCodeDescription::ExceptionCodeDescription(ExceptionCode ec)\n";
-    print F "{\n";
-    print F "    ASSERT(ec);\n";
-
-    for my $exceptionType (sort keys %parsedItems) {
-        # DOMCoreException needs to be last because it's a catch-all.
-        next if $exceptionType eq "DOMCoreException";
-
-        my $conditional = $parsedItems{$exceptionType}{"conditional"};
-
-        print F "#if ENABLE($conditional)\n" if $conditional;
-        print F "    if (${exceptionType}::initializeDescription(ec, this))\n";
-        print F "        return;\n";
-        print F "#endif\n" if $conditional;
-    }
-
-    print F "    if (DOMCoreException::initializeDescription(ec, this))\n";
-    print F "        return;\n";
-    print F "    ASSERT_NOT_REACHED();\n";
-    print F "}\n";
-    print F "\n";
-    print F "} // namespace WebCore\n";
-
-    close F;
-}

Modified: trunk/Source/cmake/WebKitMacros.cmake (98792 => 98793)


--- trunk/Source/cmake/WebKitMacros.cmake	2011-10-29 01:47:50 UTC (rev 98792)
+++ trunk/Source/cmake/WebKitMacros.cmake	2011-10-29 01:56:13 UTC (rev 98793)
@@ -49,7 +49,7 @@
 
 
 MACRO (GENERATE_EXCEPTION_CODE_DESCRIPTION _infile _outfile)
-    SET(NAMES_GENERATOR ${WEBCORE_DIR}/dom/make_exception_code_description.pl)
+    SET(NAMES_GENERATOR ${WEBCORE_DIR}/dom/make_dom_exceptions.pl)
 
     ADD_CUSTOM_COMMAND(
         OUTPUT  ${DERIVED_SOURCES_WEBCORE_DIR}/${_outfile}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to