Title: [177744] trunk/Source/WebCore
Revision
177744
Author
[email protected]
Date
2014-12-25 20:23:28 -0800 (Thu, 25 Dec 2014)

Log Message

DOM exception creator functions should return Ref.
<https://webkit.org/b/139947>

Reviewed by Chris Dumez.

Tweak all the FooException::create() to return Ref instead of
PassRefPtr since construction always succeeds.

Also add a toJS() overload for ImplType& to keep bindings building.

* Modules/indexeddb/IDBDatabaseException.h:
(WebCore::IDBDatabaseException::create):
* Modules/webdatabase/SQLException.h:
(WebCore::SQLException::create):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* dom/DOMCoreException.h:
(WebCore::DOMCoreException::create):
* dom/EventException.h:
(WebCore::EventException::create):
* dom/RangeException.h:
(WebCore::RangeException::create):
* fileapi/FileException.h:
(WebCore::FileException::create):
* svg/SVGException.h:
(WebCore::SVGException::create):
* xml/XMLHttpRequestException.h:
(WebCore::XMLHttpRequestException::create):
* xml/XPathException.h:
(WebCore::XPathException::create):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (177743 => 177744)


--- trunk/Source/WebCore/ChangeLog	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/ChangeLog	2014-12-26 04:23:28 UTC (rev 177744)
@@ -1,3 +1,36 @@
+2014-12-25  Andreas Kling  <[email protected]>
+
+        DOM exception creator functions should return Ref.
+        <https://webkit.org/b/139947>
+
+        Reviewed by Chris Dumez.
+
+        Tweak all the FooException::create() to return Ref instead of
+        PassRefPtr since construction always succeeds.
+
+        Also add a toJS() overload for ImplType& to keep bindings building.
+
+        * Modules/indexeddb/IDBDatabaseException.h:
+        (WebCore::IDBDatabaseException::create):
+        * Modules/webdatabase/SQLException.h:
+        (WebCore::SQLException::create):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader):
+        * dom/DOMCoreException.h:
+        (WebCore::DOMCoreException::create):
+        * dom/EventException.h:
+        (WebCore::EventException::create):
+        * dom/RangeException.h:
+        (WebCore::RangeException::create):
+        * fileapi/FileException.h:
+        (WebCore::FileException::create):
+        * svg/SVGException.h:
+        (WebCore::SVGException::create):
+        * xml/XMLHttpRequestException.h:
+        (WebCore::XMLHttpRequestException::create):
+        * xml/XPathException.h:
+        (WebCore::XPathException::create):
+
 2014-12-25  Gyuyoung Kim  <[email protected]>
 
         Unreviewed, fix build break on win debug build since r177737.

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseException.h (177743 => 177744)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseException.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseException.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -34,9 +34,9 @@
 
 class IDBDatabaseException : public ExceptionBase {
 public:
-    static PassRefPtr<IDBDatabaseException> create(const ExceptionCodeDescription& description)
+    static Ref<IDBDatabaseException> create(const ExceptionCodeDescription& description)
     {
-        return adoptRef(new IDBDatabaseException(description));
+        return adoptRef(*new IDBDatabaseException(description));
     }
 
     static const int IDBDatabaseExceptionOffset = 1200;

Modified: trunk/Source/WebCore/Modules/webdatabase/SQLException.h (177743 => 177744)


--- trunk/Source/WebCore/Modules/webdatabase/SQLException.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLException.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -39,9 +39,9 @@
 
 class SQLException : public ExceptionBase {
 public:
-    static PassRefPtr<SQLException> create(const ExceptionCodeDescription& description)
+    static Ref<SQLException> create(const ExceptionCodeDescription& description)
     {
-        return adoptRef(new SQLException(description));
+        return adoptRef(*new SQLException(description));
     }
 
     static const int SQLExceptionOffset = 1000;

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2014-12-26 04:23:28 UTC (rev 177744)
@@ -1171,6 +1171,7 @@
     }
     if (ShouldGenerateToJSDeclaration($hasParent, $interface)) {
         push(@headerContent, "WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*);\n");
+        push(@headerContent, "inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType& impl) { return toJS(exec, globalObject, &impl); }\n");
     }
     if ($usesToJSNewlyCreated{$interfaceName}) {
         push(@headerContent, "JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, $interfaceName*);\n");

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -89,6 +89,7 @@
 }
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestActiveDOMObject*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestActiveDOMObject& impl) { return toJS(exec, globalObject, &impl); }
 
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -93,6 +93,7 @@
 }
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCustomNamedGetter*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestCustomNamedGetter& impl) { return toJS(exec, globalObject, &impl); }
 
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -89,6 +89,7 @@
 }
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestEventConstructor*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestEventConstructor& impl) { return toJS(exec, globalObject, &impl); }
 
 bool fillTestEventConstructorInit(TestEventConstructorInit&, JSDictionary&);
 

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -97,6 +97,7 @@
 }
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestEventTarget*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestEventTarget& impl) { return toJS(exec, globalObject, &impl); }
 
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -90,6 +90,7 @@
 }
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestException*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestException& impl) { return toJS(exec, globalObject, &impl); }
 
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -87,6 +87,7 @@
 }
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestGenerateIsReachable*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestGenerateIsReachable& impl) { return toJS(exec, globalObject, &impl); }
 
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -116,6 +116,7 @@
 }
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestInterface*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestInterface& impl) { return toJS(exec, globalObject, &impl); }
 
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -87,6 +87,7 @@
 }
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestMediaQueryListListener*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestMediaQueryListListener& impl) { return toJS(exec, globalObject, &impl); }
 
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -88,6 +88,7 @@
 }
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNamedConstructor*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestNamedConstructor& impl) { return toJS(exec, globalObject, &impl); }
 
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -87,6 +87,7 @@
 }
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNondeterministic*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestNondeterministic& impl) { return toJS(exec, globalObject, &impl); }
 
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -102,6 +102,7 @@
 }
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestObj*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestObj& impl) { return toJS(exec, globalObject, &impl); }
 
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -87,6 +87,7 @@
 }
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestOverloadedConstructors*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestOverloadedConstructors& impl) { return toJS(exec, globalObject, &impl); }
 
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -93,6 +93,7 @@
 }
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestSerializedScriptValueInterface*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestSerializedScriptValueInterface& impl) { return toJS(exec, globalObject, &impl); }
 
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -89,6 +89,7 @@
 }
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestTypedefs*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestTypedefs& impl) { return toJS(exec, globalObject, &impl); }
 
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -88,6 +88,7 @@
 }
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, attribute*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, attribute& impl) { return toJS(exec, globalObject, &impl); }
 
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h (177743 => 177744)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -87,6 +87,7 @@
 }
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, readonly*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, readonly& impl) { return toJS(exec, globalObject, &impl); }
 
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/dom/DOMCoreException.h (177743 => 177744)


--- trunk/Source/WebCore/dom/DOMCoreException.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/dom/DOMCoreException.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -35,9 +35,9 @@
 
 class DOMCoreException : public ExceptionBase {
 public:
-    static PassRefPtr<DOMCoreException> create(const ExceptionCodeDescription& description)
+    static Ref<DOMCoreException> create(const ExceptionCodeDescription& description)
     {
-        return adoptRef(new DOMCoreException(description));
+        return adoptRef(*new DOMCoreException(description));
     }
 
     static bool initializeDescription(ExceptionCode, ExceptionCodeDescription*);

Modified: trunk/Source/WebCore/dom/EventException.h (177743 => 177744)


--- trunk/Source/WebCore/dom/EventException.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/dom/EventException.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -35,9 +35,9 @@
 
 class EventException : public ExceptionBase {
 public:
-    static PassRefPtr<EventException> create(const ExceptionCodeDescription& description)
+    static Ref<EventException> create(const ExceptionCodeDescription& description)
     {
-        return adoptRef(new EventException(description));
+        return adoptRef(*new EventException(description));
     }
 
     static const int EventExceptionOffset = 100;

Modified: trunk/Source/WebCore/dom/RangeException.h (177743 => 177744)


--- trunk/Source/WebCore/dom/RangeException.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/dom/RangeException.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -31,9 +31,9 @@
 
 class RangeException : public ExceptionBase {
 public:
-    static PassRefPtr<RangeException> create(const ExceptionCodeDescription& description)
+    static Ref<RangeException> create(const ExceptionCodeDescription& description)
     {
-        return adoptRef(new RangeException(description));
+        return adoptRef(*new RangeException(description));
     }
 
     static const int RangeExceptionOffset = 200;

Modified: trunk/Source/WebCore/fileapi/FileException.h (177743 => 177744)


--- trunk/Source/WebCore/fileapi/FileException.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/fileapi/FileException.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -37,9 +37,9 @@
 
 class FileException : public ExceptionBase {
 public:
-    static PassRefPtr<FileException> create(const ExceptionCodeDescription& description)
+    static Ref<FileException> create(const ExceptionCodeDescription& description)
     {
-        return adoptRef(new FileException(description));
+        return adoptRef(*new FileException(description));
     }
 
     static const int FileExceptionOffset = 1100;

Modified: trunk/Source/WebCore/svg/SVGException.h (177743 => 177744)


--- trunk/Source/WebCore/svg/SVGException.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/svg/SVGException.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -27,9 +27,9 @@
 
 class SVGException : public ExceptionBase {
 public:
-    static PassRefPtr<SVGException> create(const ExceptionCodeDescription& description)
+    static Ref<SVGException> create(const ExceptionCodeDescription& description)
     {
-        return adoptRef(new SVGException(description));
+        return adoptRef(*new SVGException(description));
     }
 
     static const int SVGExceptionOffset = 300;

Modified: trunk/Source/WebCore/xml/XMLHttpRequestException.h (177743 => 177744)


--- trunk/Source/WebCore/xml/XMLHttpRequestException.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/xml/XMLHttpRequestException.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -35,9 +35,9 @@
 
 class XMLHttpRequestException : public ExceptionBase {
 public:
-    static PassRefPtr<XMLHttpRequestException> create(const ExceptionCodeDescription& description)
+    static Ref<XMLHttpRequestException> create(const ExceptionCodeDescription& description)
     {
-        return adoptRef(new XMLHttpRequestException(description));
+        return adoptRef(*new XMLHttpRequestException(description));
     }
 
     static const int XMLHttpRequestExceptionOffset = 500;

Modified: trunk/Source/WebCore/xml/XPathException.h (177743 => 177744)


--- trunk/Source/WebCore/xml/XPathException.h	2014-12-26 03:51:56 UTC (rev 177743)
+++ trunk/Source/WebCore/xml/XPathException.h	2014-12-26 04:23:28 UTC (rev 177744)
@@ -35,9 +35,9 @@
 
 class XPathException : public ExceptionBase {
 public:
-    static PassRefPtr<XPathException> create(const ExceptionCodeDescription& description)
+    static Ref<XPathException> create(const ExceptionCodeDescription& description)
     {
-        return adoptRef(new XPathException(description));
+        return adoptRef(*new XPathException(description));
     }
 
     static const int XPathExceptionOffset = 400;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to