Changeset 116172 in webkit


Ignore:
Timestamp:
May 4, 2012 2:23:15 PM (12 years ago)
Author:
arv@chromium.org
Message:

WebKit IDL does not use exception syntax
https://bugs.webkit.org/show_bug.cgi?id=85100

Reviewed by Dimitri Glazkov.

This adds support for exception ExceptionName { ... } which currently sets a flag
on the domClass.

Binding tests updated.

  • Modules/indexeddb/IDBDatabaseException.idl:
  • Modules/webdatabase/SQLException.idl:
  • bindings/scripts/IDLParser.pm:

(ParseInterface):
(DetermineParseMode):
(ProcessSection):

  • bindings/scripts/IDLStructure.pm:
  • bindings/scripts/test/CPP/WebDOMTestException.cpp: Added.

(WebDOMTestException::WebDOMTestExceptionPrivate::WebDOMTestExceptionPrivate):
(WebDOMTestException::WebDOMTestExceptionPrivate):
(WebDOMTestException::WebDOMTestException):
(WebDOMTestException::operator=):
(WebDOMTestException::impl):
(WebDOMTestException::~WebDOMTestException):
(WebDOMTestException::name):
(toWebCore):
(toWebKit):

  • bindings/scripts/test/CPP/WebDOMTestException.h: Added.

(WebCore):
(WebDOMTestException):

  • bindings/scripts/test/GObject/WebKitDOMTestException.cpp: Added.

(WebKit):
(WebKit::kit):
(WebKit::core):
(WebKit::wrapTestException):
(webkit_dom_test_exception_finalize):
(webkit_dom_test_exception_set_property):
(webkit_dom_test_exception_get_property):
(webkit_dom_test_exception_constructed):
(webkit_dom_test_exception_class_init):
(webkit_dom_test_exception_init):
(webkit_dom_test_exception_get_name):

  • bindings/scripts/test/GObject/WebKitDOMTestException.h: Added.

(_WebKitDOMTestException):
(_WebKitDOMTestExceptionClass):

  • bindings/scripts/test/GObject/WebKitDOMTestExceptionPrivate.h: Added.

(WebKit):

  • bindings/scripts/test/JS/JSTestException.cpp: Added.

(WebCore):
(WebCore::JSTestExceptionConstructor::JSTestExceptionConstructor):
(WebCore::JSTestExceptionConstructor::finishCreation):
(WebCore::JSTestExceptionConstructor::getOwnPropertySlot):
(WebCore::JSTestExceptionConstructor::getOwnPropertyDescriptor):
(WebCore::JSTestExceptionPrototype::self):
(WebCore::JSTestException::JSTestException):
(WebCore::JSTestException::finishCreation):
(WebCore::JSTestException::createPrototype):
(WebCore::JSTestException::destroy):
(WebCore::JSTestException::~JSTestException):
(WebCore::JSTestException::getOwnPropertySlot):
(WebCore::JSTestException::getOwnPropertyDescriptor):
(WebCore::jsTestExceptionName):
(WebCore::jsTestExceptionConstructor):
(WebCore::JSTestException::getConstructor):
(WebCore::isObservable):
(WebCore::JSTestExceptionOwner::isReachableFromOpaqueRoots):
(WebCore::JSTestExceptionOwner::finalize):
(WebCore::toJS):
(WebCore::toTestException):

  • bindings/scripts/test/JS/JSTestException.h: Added.

(WebCore):
(JSTestException):
(WebCore::JSTestException::create):
(WebCore::JSTestException::createStructure):
(WebCore::JSTestException::impl):
(WebCore::JSTestException::releaseImpl):
(WebCore::JSTestException::releaseImplIfNotNull):
(JSTestExceptionOwner):
(WebCore::wrapperOwner):
(WebCore::wrapperContext):
(JSTestExceptionPrototype):
(WebCore::JSTestExceptionPrototype::create):
(WebCore::JSTestExceptionPrototype::createStructure):
(WebCore::JSTestExceptionPrototype::JSTestExceptionPrototype):
(JSTestExceptionConstructor):
(WebCore::JSTestExceptionConstructor::create):
(WebCore::JSTestExceptionConstructor::createStructure):

  • bindings/scripts/test/ObjC/DOMTestException.h: Added.
  • bindings/scripts/test/ObjC/DOMTestException.mm: Added.

(-[DOMTestException dealloc]):
(-[DOMTestException finalize]):
(-[DOMTestException name]):
(core):
(kit):

  • bindings/scripts/test/ObjC/DOMTestExceptionInternal.h: Added.

(WebCore):

  • bindings/scripts/test/TestException.idl: Copied from Source/WebCore/xml/XPathException.idl.
  • bindings/scripts/test/V8/V8TestException.cpp: Added.

(WebCore):
(TestExceptionV8Internal):
(WebCore::TestExceptionV8Internal::V8_USE):
(WebCore::TestExceptionV8Internal::nameAttrGetter):
(WebCore::ConfigureV8TestExceptionTemplate):
(WebCore::V8TestException::GetRawTemplate):
(WebCore::V8TestException::GetTemplate):
(WebCore::V8TestException::HasInstance):
(WebCore::V8TestException::wrapSlow):
(WebCore::V8TestException::derefObject):

  • bindings/scripts/test/V8/V8TestException.h: Added.

(WebCore):
(V8TestException):
(WebCore::V8TestException::toNative):
(WebCore::V8TestException::wrap):
(WebCore::toV8):

  • dom/DOMCoreException.idl:
  • dom/EventException.idl:
  • dom/RangeException.idl:
  • fileapi/FileException.idl:
  • fileapi/OperationNotAllowedException.idl:
  • svg/SVGException.idl:
  • xml/XMLHttpRequestException.idl:
  • xml/XPathException.idl:
Location:
trunk/Source/WebCore
Files:
12 added
13 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r116171 r116172  
     12012-04-27  Erik Arvidsson  <arv@chromium.org>
     2
     3        WebKit IDL does not use exception syntax
     4        https://bugs.webkit.org/show_bug.cgi?id=85100
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        This adds support for exception ExceptionName { ... } which currently sets a flag
     9        on the domClass.
     10
     11        Binding tests updated.
     12
     13        * Modules/indexeddb/IDBDatabaseException.idl:
     14        * Modules/webdatabase/SQLException.idl:
     15        * bindings/scripts/IDLParser.pm:
     16        (ParseInterface):
     17        (DetermineParseMode):
     18        (ProcessSection):
     19        * bindings/scripts/IDLStructure.pm:
     20        * bindings/scripts/test/CPP/WebDOMTestException.cpp: Added.
     21        (WebDOMTestException::WebDOMTestExceptionPrivate::WebDOMTestExceptionPrivate):
     22        (WebDOMTestException::WebDOMTestExceptionPrivate):
     23        (WebDOMTestException::WebDOMTestException):
     24        (WebDOMTestException::operator=):
     25        (WebDOMTestException::impl):
     26        (WebDOMTestException::~WebDOMTestException):
     27        (WebDOMTestException::name):
     28        (toWebCore):
     29        (toWebKit):
     30        * bindings/scripts/test/CPP/WebDOMTestException.h: Added.
     31        (WebCore):
     32        (WebDOMTestException):
     33        * bindings/scripts/test/GObject/WebKitDOMTestException.cpp: Added.
     34        (WebKit):
     35        (WebKit::kit):
     36        (WebKit::core):
     37        (WebKit::wrapTestException):
     38        (webkit_dom_test_exception_finalize):
     39        (webkit_dom_test_exception_set_property):
     40        (webkit_dom_test_exception_get_property):
     41        (webkit_dom_test_exception_constructed):
     42        (webkit_dom_test_exception_class_init):
     43        (webkit_dom_test_exception_init):
     44        (webkit_dom_test_exception_get_name):
     45        * bindings/scripts/test/GObject/WebKitDOMTestException.h: Added.
     46        (_WebKitDOMTestException):
     47        (_WebKitDOMTestExceptionClass):
     48        * bindings/scripts/test/GObject/WebKitDOMTestExceptionPrivate.h: Added.
     49        (WebKit):
     50        * bindings/scripts/test/JS/JSTestException.cpp: Added.
     51        (WebCore):
     52        (WebCore::JSTestExceptionConstructor::JSTestExceptionConstructor):
     53        (WebCore::JSTestExceptionConstructor::finishCreation):
     54        (WebCore::JSTestExceptionConstructor::getOwnPropertySlot):
     55        (WebCore::JSTestExceptionConstructor::getOwnPropertyDescriptor):
     56        (WebCore::JSTestExceptionPrototype::self):
     57        (WebCore::JSTestException::JSTestException):
     58        (WebCore::JSTestException::finishCreation):
     59        (WebCore::JSTestException::createPrototype):
     60        (WebCore::JSTestException::destroy):
     61        (WebCore::JSTestException::~JSTestException):
     62        (WebCore::JSTestException::getOwnPropertySlot):
     63        (WebCore::JSTestException::getOwnPropertyDescriptor):
     64        (WebCore::jsTestExceptionName):
     65        (WebCore::jsTestExceptionConstructor):
     66        (WebCore::JSTestException::getConstructor):
     67        (WebCore::isObservable):
     68        (WebCore::JSTestExceptionOwner::isReachableFromOpaqueRoots):
     69        (WebCore::JSTestExceptionOwner::finalize):
     70        (WebCore::toJS):
     71        (WebCore::toTestException):
     72        * bindings/scripts/test/JS/JSTestException.h: Added.
     73        (WebCore):
     74        (JSTestException):
     75        (WebCore::JSTestException::create):
     76        (WebCore::JSTestException::createStructure):
     77        (WebCore::JSTestException::impl):
     78        (WebCore::JSTestException::releaseImpl):
     79        (WebCore::JSTestException::releaseImplIfNotNull):
     80        (JSTestExceptionOwner):
     81        (WebCore::wrapperOwner):
     82        (WebCore::wrapperContext):
     83        (JSTestExceptionPrototype):
     84        (WebCore::JSTestExceptionPrototype::create):
     85        (WebCore::JSTestExceptionPrototype::createStructure):
     86        (WebCore::JSTestExceptionPrototype::JSTestExceptionPrototype):
     87        (JSTestExceptionConstructor):
     88        (WebCore::JSTestExceptionConstructor::create):
     89        (WebCore::JSTestExceptionConstructor::createStructure):
     90        * bindings/scripts/test/ObjC/DOMTestException.h: Added.
     91        * bindings/scripts/test/ObjC/DOMTestException.mm: Added.
     92        (-[DOMTestException dealloc]):
     93        (-[DOMTestException finalize]):
     94        (-[DOMTestException name]):
     95        (core):
     96        (kit):
     97        * bindings/scripts/test/ObjC/DOMTestExceptionInternal.h: Added.
     98        (WebCore):
     99        * bindings/scripts/test/TestException.idl: Copied from Source/WebCore/xml/XPathException.idl.
     100        * bindings/scripts/test/V8/V8TestException.cpp: Added.
     101        (WebCore):
     102        (TestExceptionV8Internal):
     103        (WebCore::TestExceptionV8Internal::V8_USE):
     104        (WebCore::TestExceptionV8Internal::nameAttrGetter):
     105        (WebCore::ConfigureV8TestExceptionTemplate):
     106        (WebCore::V8TestException::GetRawTemplate):
     107        (WebCore::V8TestException::GetTemplate):
     108        (WebCore::V8TestException::HasInstance):
     109        (WebCore::V8TestException::wrapSlow):
     110        (WebCore::V8TestException::derefObject):
     111        * bindings/scripts/test/V8/V8TestException.h: Added.
     112        (WebCore):
     113        (V8TestException):
     114        (WebCore::V8TestException::toNative):
     115        (WebCore::V8TestException::wrap):
     116        (WebCore::toV8):
     117        * dom/DOMCoreException.idl:
     118        * dom/EventException.idl:
     119        * dom/RangeException.idl:
     120        * fileapi/FileException.idl:
     121        * fileapi/OperationNotAllowedException.idl:
     122        * svg/SVGException.idl:
     123        * xml/XMLHttpRequestException.idl:
     124        * xml/XPathException.idl:
     125
    11262012-05-04  Rafael Weinstein  <rafaelw@chromium.org>
    2127
  • trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseException.idl

    r109493 r116172  
    2626module storage {
    2727
    28     interface [
     28    exception [
    2929        Conditional=INDEXED_DATABASE,
    3030        DoNotCheckConstants
  • trunk/Source/WebCore/Modules/webdatabase/SQLException.idl

    r109877 r116172  
    3131module storage {
    3232
    33     interface [
     33    exception [
    3434        Conditional=SQL_DATABASE,
    3535        JSNoStaticTables,
  • trunk/Source/WebCore/bindings/scripts/IDLParser.pm

    r109210 r116172  
    3333use constant MODE_MODULE  => 10; # 'module' section
    3434use constant MODE_INTERFACE  => 11; # 'interface' section
     35use constant MODE_EXCEPTION  => 12; # 'exception' section
    3536
    3637# Helper variables
     
    275276
    276277    # Beginning of the regexp parsing magic
    277     if ($sectionName eq "interface") {
     278    if ($sectionName eq "interface" || $sectionName eq "exception") {
    278279        print " |- Trying to parse interface...\n" unless $beQuiet;
    279280
     
    284285        $data =~ /$IDLStructure::interfaceSelector/;
    285286
    286         my $interfaceExtendedAttributes = (defined($1) ? $1 : " "); chop($interfaceExtendedAttributes);
    287         $interfaceName = (defined($2) ? $2 : die("Parsing error!\nSource:\n$data\n)"));
    288         my $interfaceBase = (defined($3) ? $3 : "");
    289         $interfaceData = (defined($4) ? $4 : die("Parsing error!\nSource:\n$data\n)"));
     287        my $isException = (defined($1) ? ($1 eq 'exception') : die("Parsing error!\nSource:\n$data\n)"));
     288        my $interfaceExtendedAttributes = (defined($2) ? $2 : " "); chop($interfaceExtendedAttributes);
     289        $interfaceName = (defined($3) ? $3 : die("Parsing error!\nSource:\n$data\n)"));
     290        my $interfaceBase = (defined($4) ? $4 : "");
     291        $interfaceData = (defined($5) ? $5 : die("Parsing error!\nSource:\n$data\n)"));
    290292
    291293        # Fill in known parts of the domClass datastructure now...
     294        $dataNode->isException($isException);
    292295        $dataNode->name($interfaceName);
    293296        my $extendedAttributes = parseExtendedAttributes($interfaceExtendedAttributes);
     
    431434    } elsif ($_ =~ /interface/) {
    432435        $mode = MODE_INTERFACE;
     436    } elsif ($_ =~ /exception/) {
     437        $mode = MODE_EXCEPTION;
    433438    }
    434439
     
    445450        $document = new idlDocument();
    446451        $object->ParseModule($document);
    447     } elsif ($parseMode eq MODE_INTERFACE) {
     452    } elsif ($parseMode eq MODE_INTERFACE || $parseMode eq MODE_EXCEPTION) {
    448453        my $node = new domClass();
    449         $object->ParseInterface($node, "interface");
     454        my $sectionName = $parseMode eq MODE_INTERFACE ? "interface" : "exception";
     455        $object->ParseInterface($node, $sectionName);
    450456   
    451457        die ("No module specified! Fatal Error!\n") if ($document eq 0);
  • trunk/Source/WebCore/bindings/scripts/IDLStructure.pm

    r114887 r116172  
    4242    extendedAttributes => '$', # Extended attributes
    4343    constructor => '$', # Constructor
     44    isException => '$', # Used for exception interfaces
    4445});
    4546
     
    104105our $typeNamespaceSelector = '((?:' . $idlId . '*::)*)\s*(' . $idlDataType . '*)';
    105106
    106 our $interfaceSelector = 'interface\s*((?:' . $extendedAttributeSyntax . ' )?)(' . $idlIdNs . '*)\s*(?::(\s*[^{]*))?{([-a-zA-Z0-9_"=\s(),;:\[\]<>&\|]*)';
     107our $interfaceSelector = '(interface|exception)\s*((?:' . $extendedAttributeSyntax . ' )?)(' . $idlIdNs . '*)\s*(?::(\s*[^{]*))?{([-a-zA-Z0-9_"=\s(),;:\[\]<>&\|]*)';
    107108our $interfaceMethodSelector = '\s*((?:' . $extendedAttributeSyntax . ' )?)(static\s+)?' . $supportedTypes . '\s*(' . $idlIdNs . '*)\s*\(\s*([a-zA-Z0-9:\s,=\[\]<>]*)';
    108109our $interfaceParameterSelector = '(in|out)\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)';
  • trunk/Source/WebCore/bindings/scripts/test/TestException.idl

    r116171 r116172  
    11/*
    2  * Copyright (C) 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2012 Google Inc. All rights reserved.
    33 *
    4  * Redistribution and use in source and binary forms, with or without
     4 * Redistribution and use in source and binary formstrArg, with or without
    55 * modification, are permitted provided that the following conditions
    66 * are met:
     
    1616 *
    1717 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
    18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     18 * EXPRESS OR IMPLIED WARRANTIEstrArg, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    1919 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    2020 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
     
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 
    29 module xpath {
    30 
    31     interface [
    32         DoNotCheckConstants
    33     ] XPathException {
    34 
    35         readonly attribute unsigned short   code;
    36         readonly attribute DOMString        name;
    37         readonly attribute DOMString        message;
    38 
    39 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
    40         // Override in a Mozilla compatible format
    41         [NotEnumerable] DOMString toString();
    42 #endif
    43 
    44         // XPathExceptionCode
    45         const unsigned short INVALID_EXPRESSION_ERR = 51;
    46         const unsigned short TYPE_ERR = 52;
     28module test {
     29    exception TestException {
     30       readonly attribute DOMString name;
    4731    };
    48 
    4932}
  • trunk/Source/WebCore/dom/DOMCoreException.idl

    r108669 r116172  
    2929module core {
    3030
    31     interface [
     31    exception [
    3232        JSNoStaticTables,
    3333        DoNotCheckConstants,
  • trunk/Source/WebCore/dom/EventException.idl

    r106892 r116172  
    3030
    3131    // Introduced in DOM Level 2:
    32     interface [
     32    exception [
    3333        JSNoStaticTables,
    3434        DoNotCheckConstants
  • trunk/Source/WebCore/dom/RangeException.idl

    r106892 r116172  
    2020module ranges {
    2121
    22     interface [
     22    exception [
    2323        DoNotCheckConstants
    2424    ] RangeException {
  • trunk/Source/WebCore/fileapi/FileException.idl

    r106892 r116172  
    3030
    3131module html {
    32     interface [
     32    exception [
    3333        Conditional=BLOB|FILE_SYSTEM,
    3434        DoNotCheckConstants,
  • trunk/Source/WebCore/fileapi/OperationNotAllowedException.idl

    r111074 r116172  
    3030
    3131module html {
    32     interface [
     32    exception [
    3333        Conditional=BLOB,
    3434        DoNotCheckConstants,
  • trunk/Source/WebCore/svg/SVGException.idl

    r106892 r116172  
    2121module svg {
    2222
    23     interface [
     23    exception [
    2424        Conditional=SVG,
    2525        DoNotCheckConstants
  • trunk/Source/WebCore/xml/XMLHttpRequestException.idl

    r106892 r116172  
    2929module xml {
    3030
    31     interface [
     31    exception [
    3232        JSNoStaticTables,
    3333        DoNotCheckConstants
  • trunk/Source/WebCore/xml/XPathException.idl

    r106892 r116172  
    2929module xpath {
    3030
    31     interface [
     31    exception [
    3232        DoNotCheckConstants
    3333    ] XPathException {
Note: See TracChangeset for help on using the changeset viewer.