[WK2] Remove repeating code in declaration of WK2 API classes
authormikhail.pozdnyakov@intel.com <mikhail.pozdnyakov@intel.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Apr 2013 08:32:49 +0000 (08:32 +0000)
committermikhail.pozdnyakov@intel.com <mikhail.pozdnyakov@intel.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Apr 2013 08:32:49 +0000 (08:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=112782

Reviewed by Benjamin Poulain.

The following two lines of code had been repeated in every WK2 API
object class:
1) static const Type APIType = SomeAPIType;
2) virtual Type type() const { return APIType; }

This patch introduces template class 'TypedAPIObject' inherited
from WebKit::APIObject and it contains the common functionality.
So the new pattern is that API object classes are inherited from
TypedAPIObject (rather than from WebKit::APIObject directly) passing
the corresponding API object type as a template parameter.

The existing API object classes are modified accordingly to the
proposed pattern.

* Shared/APIObject.h:
(WebKit):
(TypedAPIObject):
(WebKit::TypedAPIObject::~TypedAPIObject):
(WebKit::TypedAPIObject::TypedAPIObject):
* Shared/ImmutableArray.h:
(ImmutableArray):
* Shared/ImmutableDictionary.h:
(ImmutableDictionary):
* Shared/WebArchive.h:
(WebArchive):
* Shared/WebArchiveResource.h:
(WebArchiveResource):
* Shared/WebBackForwardListItem.h:
(WebBackForwardListItem):
* Shared/WebBatteryStatus.h:
(WebBatteryStatus):
* Shared/WebCertificateInfo.h:
* Shared/WebConnection.h:
(WebConnection):
* Shared/WebContextMenuItem.h:
(WebContextMenuItem):
* Shared/WebData.h:
* Shared/WebError.h:
(WebKit::WebError::errorCode):
* Shared/WebGeolocationPosition.h:
(WebGeolocationPosition):
* Shared/WebGeometry.h:
* Shared/WebGraphicsContext.h:
(WebGraphicsContext):
* Shared/WebHitTestResult.h:
* Shared/WebImage.h:
(WebImage):
* Shared/WebNetworkInfo.h:
(WebNetworkInfo):
* Shared/WebNumber.h:
* Shared/WebOpenPanelParameters.h:
(WebOpenPanelParameters):
* Shared/WebRenderLayer.h:
* Shared/WebRenderObject.h:
* Shared/WebSecurityOrigin.h:
* Shared/WebSerializedScriptValue.h:
(WebSerializedScriptValue):
* Shared/WebString.h:
* Shared/WebURL.h:
* Shared/WebURLRequest.h:
(WebURLRequest):
* Shared/WebURLResponse.h:
(WebURLResponse):
* Shared/WebUserContentURLPattern.h:
* Shared/mac/ObjCObjectGraph.h:
* UIProcess/Authentication/AuthenticationChallengeProxy.h:
(AuthenticationChallengeProxy):
* UIProcess/Authentication/AuthenticationDecisionListener.h:
(AuthenticationDecisionListener):
* UIProcess/Authentication/WebCredential.h:
(WebCredential):
* UIProcess/Authentication/WebProtectionSpace.h:
(WebProtectionSpace):
* UIProcess/Downloads/DownloadProxy.h:
(DownloadProxy):
* UIProcess/GeolocationPermissionRequestProxy.h:
(GeolocationPermissionRequestProxy):
* UIProcess/Notifications/NotificationPermissionRequest.h:
(NotificationPermissionRequest):
* UIProcess/Notifications/WebNotification.h:
(WebNotification):
* UIProcess/Notifications/WebNotificationManagerProxy.h:
(WebNotificationManagerProxy):
* UIProcess/Plugins/WebPluginSiteDataManager.h:
(WebPluginSiteDataManager):
* UIProcess/WebApplicationCacheManagerProxy.h:
(WebApplicationCacheManagerProxy):
* UIProcess/WebBackForwardList.h:
(WebBackForwardList):
* UIProcess/WebBatteryManagerProxy.h:
(WebBatteryManagerProxy):
* UIProcess/WebContext.h:
(WebContext):
* UIProcess/WebCookieManagerProxy.h:
(WebCookieManagerProxy):
* UIProcess/WebDatabaseManagerProxy.h:
(WebDatabaseManagerProxy):
* UIProcess/WebEditCommandProxy.h:
(WebEditCommandProxy):
* UIProcess/WebFrameProxy.h:
(WebFrameProxy):
* UIProcess/WebGeolocationManagerProxy.h:
(WebGeolocationManagerProxy):
* UIProcess/WebGrammarDetail.h:
(WebGrammarDetail):
* UIProcess/WebIconDatabase.h:
(WebIconDatabase):
* UIProcess/WebInspectorProxy.h:
(WebInspectorProxy):
* UIProcess/WebKeyValueStorageManagerProxy.h:
(WebKeyValueStorageManagerProxy):
* UIProcess/WebMediaCacheManagerProxy.h:
(WebMediaCacheManagerProxy):
* UIProcess/WebNavigationData.h:
(WebNavigationData):
* UIProcess/WebNetworkInfoManagerProxy.h:
(WebNetworkInfoManagerProxy):
* UIProcess/WebOpenPanelResultListenerProxy.h:
(WebOpenPanelResultListenerProxy):
* UIProcess/WebPageGroup.h:
(WebPageGroup):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::WebPreferences):
* UIProcess/WebPreferences.h:
(WebPreferences):
* UIProcess/WebResourceCacheManagerProxy.h:
(WebResourceCacheManagerProxy):
* UIProcess/WebTextChecker.h:
(WebTextChecker):
* UIProcess/WebVibrationProxy.h:
(WebVibrationProxy):
* UIProcess/efl/WebPopupItemEfl.h:
(WebPopupItemEfl):
* UIProcess/efl/WebView.h:
* UIProcess/soup/WebSoupRequestManagerProxy.h:
(WebSoupRequestManagerProxy):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
(InjectedBundleNodeHandle):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
(InjectedBundleRangeHandle):
* WebProcess/InjectedBundle/InjectedBundle.h:
(InjectedBundle):
* WebProcess/InjectedBundle/InjectedBundleBackForwardList.h:
* WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h:
* WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.h:
(InjectedBundleDOMWindowExtension):
* WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
* WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
(InjectedBundleNavigationAction):
* WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
(InjectedBundleScriptWorld):
* WebProcess/WebPage/PageOverlay.h:
(PageOverlay):
* WebProcess/WebPage/WebFrame.h:
(WebFrame):
* WebProcess/WebPage/WebInspector.h:
(WebInspector):
* WebProcess/WebPage/WebPage.h:
(WebPage):
* WebProcess/WebPage/WebPageGroupProxy.h:
(WebPageGroupProxy):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147403 268f45cc-cd09-0410-ab3c-d52691b4dbfc

82 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/APIObject.h
Source/WebKit2/Shared/ImmutableArray.h
Source/WebKit2/Shared/ImmutableDictionary.h
Source/WebKit2/Shared/WebArchive.h
Source/WebKit2/Shared/WebArchiveResource.h
Source/WebKit2/Shared/WebBackForwardListItem.h
Source/WebKit2/Shared/WebBatteryStatus.h
Source/WebKit2/Shared/WebCertificateInfo.h
Source/WebKit2/Shared/WebConnection.h
Source/WebKit2/Shared/WebContextMenuItem.h
Source/WebKit2/Shared/WebData.h
Source/WebKit2/Shared/WebError.h
Source/WebKit2/Shared/WebGeolocationPosition.h
Source/WebKit2/Shared/WebGeometry.h
Source/WebKit2/Shared/WebGraphicsContext.h
Source/WebKit2/Shared/WebHitTestResult.h
Source/WebKit2/Shared/WebImage.h
Source/WebKit2/Shared/WebNetworkInfo.h
Source/WebKit2/Shared/WebNumber.h
Source/WebKit2/Shared/WebOpenPanelParameters.h
Source/WebKit2/Shared/WebRenderLayer.h
Source/WebKit2/Shared/WebRenderObject.h
Source/WebKit2/Shared/WebSecurityOrigin.h
Source/WebKit2/Shared/WebSerializedScriptValue.h
Source/WebKit2/Shared/WebString.h
Source/WebKit2/Shared/WebURL.h
Source/WebKit2/Shared/WebURLRequest.h
Source/WebKit2/Shared/WebURLResponse.h
Source/WebKit2/Shared/WebUserContentURLPattern.h
Source/WebKit2/Shared/mac/ObjCObjectGraph.h
Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h
Source/WebKit2/UIProcess/Authentication/AuthenticationDecisionListener.h
Source/WebKit2/UIProcess/Authentication/WebCredential.h
Source/WebKit2/UIProcess/Authentication/WebProtectionSpace.h
Source/WebKit2/UIProcess/Downloads/DownloadProxy.h
Source/WebKit2/UIProcess/GeolocationPermissionRequestProxy.h
Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequest.h
Source/WebKit2/UIProcess/Notifications/WebNotification.h
Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h
Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h
Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h
Source/WebKit2/UIProcess/WebBackForwardList.h
Source/WebKit2/UIProcess/WebBatteryManagerProxy.h
Source/WebKit2/UIProcess/WebContext.h
Source/WebKit2/UIProcess/WebCookieManagerProxy.h
Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h
Source/WebKit2/UIProcess/WebEditCommandProxy.h
Source/WebKit2/UIProcess/WebFrameProxy.h
Source/WebKit2/UIProcess/WebGeolocationManagerProxy.h
Source/WebKit2/UIProcess/WebGrammarDetail.h
Source/WebKit2/UIProcess/WebIconDatabase.h
Source/WebKit2/UIProcess/WebInspectorProxy.h
Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h
Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h
Source/WebKit2/UIProcess/WebNavigationData.h
Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.h
Source/WebKit2/UIProcess/WebOpenPanelResultListenerProxy.h
Source/WebKit2/UIProcess/WebPageGroup.h
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPreferences.cpp
Source/WebKit2/UIProcess/WebPreferences.h
Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h
Source/WebKit2/UIProcess/WebTextChecker.h
Source/WebKit2/UIProcess/WebVibrationProxy.h
Source/WebKit2/UIProcess/efl/WebPopupItemEfl.h
Source/WebKit2/UIProcess/efl/WebView.h
Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.h
Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h
Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h
Source/WebKit2/WebProcess/WebPage/PageOverlay.h
Source/WebKit2/WebProcess/WebPage/WebFrame.h
Source/WebKit2/WebProcess/WebPage/WebInspector.h
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h

index 6ce8954..7acc220 100644 (file)
@@ -1,3 +1,174 @@
+2013-04-02  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
+
+        [WK2] Remove repeating code in declaration of WK2 API classes
+        https://bugs.webkit.org/show_bug.cgi?id=112782
+
+        Reviewed by Benjamin Poulain.
+
+        The following two lines of code had been repeated in every WK2 API
+        object class:
+        1) static const Type APIType = SomeAPIType;
+        2) virtual Type type() const { return APIType; }
+
+        This patch introduces template class 'TypedAPIObject' inherited
+        from WebKit::APIObject and it contains the common functionality. 
+        So the new pattern is that API object classes are inherited from
+        TypedAPIObject (rather than from WebKit::APIObject directly) passing
+        the corresponding API object type as a template parameter.
+
+        The existing API object classes are modified accordingly to the
+        proposed pattern.
+
+        * Shared/APIObject.h:
+        (WebKit):
+        (TypedAPIObject):
+        (WebKit::TypedAPIObject::~TypedAPIObject):
+        (WebKit::TypedAPIObject::TypedAPIObject):
+        * Shared/ImmutableArray.h:
+        (ImmutableArray):
+        * Shared/ImmutableDictionary.h:
+        (ImmutableDictionary):
+        * Shared/WebArchive.h:
+        (WebArchive):
+        * Shared/WebArchiveResource.h:
+        (WebArchiveResource):
+        * Shared/WebBackForwardListItem.h:
+        (WebBackForwardListItem):
+        * Shared/WebBatteryStatus.h:
+        (WebBatteryStatus):
+        * Shared/WebCertificateInfo.h:
+        * Shared/WebConnection.h:
+        (WebConnection):
+        * Shared/WebContextMenuItem.h:
+        (WebContextMenuItem):
+        * Shared/WebData.h:
+        * Shared/WebError.h:
+        (WebKit::WebError::errorCode):
+        * Shared/WebGeolocationPosition.h:
+        (WebGeolocationPosition):
+        * Shared/WebGeometry.h:
+        * Shared/WebGraphicsContext.h:
+        (WebGraphicsContext):
+        * Shared/WebHitTestResult.h:
+        * Shared/WebImage.h:
+        (WebImage):
+        * Shared/WebNetworkInfo.h:
+        (WebNetworkInfo):
+        * Shared/WebNumber.h:
+        * Shared/WebOpenPanelParameters.h:
+        (WebOpenPanelParameters):
+        * Shared/WebRenderLayer.h:
+        * Shared/WebRenderObject.h:
+        * Shared/WebSecurityOrigin.h:
+        * Shared/WebSerializedScriptValue.h:
+        (WebSerializedScriptValue):
+        * Shared/WebString.h:
+        * Shared/WebURL.h:
+        * Shared/WebURLRequest.h:
+        (WebURLRequest):
+        * Shared/WebURLResponse.h:
+        (WebURLResponse):
+        * Shared/WebUserContentURLPattern.h:
+        * Shared/mac/ObjCObjectGraph.h:
+        * UIProcess/Authentication/AuthenticationChallengeProxy.h:
+        (AuthenticationChallengeProxy):
+        * UIProcess/Authentication/AuthenticationDecisionListener.h:
+        (AuthenticationDecisionListener):
+        * UIProcess/Authentication/WebCredential.h:
+        (WebCredential):
+        * UIProcess/Authentication/WebProtectionSpace.h:
+        (WebProtectionSpace):
+        * UIProcess/Downloads/DownloadProxy.h:
+        (DownloadProxy):
+        * UIProcess/GeolocationPermissionRequestProxy.h:
+        (GeolocationPermissionRequestProxy):
+        * UIProcess/Notifications/NotificationPermissionRequest.h:
+        (NotificationPermissionRequest):
+        * UIProcess/Notifications/WebNotification.h:
+        (WebNotification):
+        * UIProcess/Notifications/WebNotificationManagerProxy.h:
+        (WebNotificationManagerProxy):
+        * UIProcess/Plugins/WebPluginSiteDataManager.h:
+        (WebPluginSiteDataManager):
+        * UIProcess/WebApplicationCacheManagerProxy.h:
+        (WebApplicationCacheManagerProxy):
+        * UIProcess/WebBackForwardList.h:
+        (WebBackForwardList):
+        * UIProcess/WebBatteryManagerProxy.h:
+        (WebBatteryManagerProxy):
+        * UIProcess/WebContext.h:
+        (WebContext):
+        * UIProcess/WebCookieManagerProxy.h:
+        (WebCookieManagerProxy):
+        * UIProcess/WebDatabaseManagerProxy.h:
+        (WebDatabaseManagerProxy):
+        * UIProcess/WebEditCommandProxy.h:
+        (WebEditCommandProxy):
+        * UIProcess/WebFrameProxy.h:
+        (WebFrameProxy):
+        * UIProcess/WebGeolocationManagerProxy.h:
+        (WebGeolocationManagerProxy):
+        * UIProcess/WebGrammarDetail.h:
+        (WebGrammarDetail):
+        * UIProcess/WebIconDatabase.h:
+        (WebIconDatabase):
+        * UIProcess/WebInspectorProxy.h:
+        (WebInspectorProxy):
+        * UIProcess/WebKeyValueStorageManagerProxy.h:
+        (WebKeyValueStorageManagerProxy):
+        * UIProcess/WebMediaCacheManagerProxy.h:
+        (WebMediaCacheManagerProxy):
+        * UIProcess/WebNavigationData.h:
+        (WebNavigationData):
+        * UIProcess/WebNetworkInfoManagerProxy.h:
+        (WebNetworkInfoManagerProxy):
+        * UIProcess/WebOpenPanelResultListenerProxy.h:
+        (WebOpenPanelResultListenerProxy):
+        * UIProcess/WebPageGroup.h:
+        (WebPageGroup):
+        * UIProcess/WebPageProxy.h:
+        (WebPageProxy):
+        * UIProcess/WebPreferences.cpp:
+        (WebKit::WebPreferences::WebPreferences):
+        * UIProcess/WebPreferences.h:
+        (WebPreferences):
+        * UIProcess/WebResourceCacheManagerProxy.h:
+        (WebResourceCacheManagerProxy):
+        * UIProcess/WebTextChecker.h:
+        (WebTextChecker):
+        * UIProcess/WebVibrationProxy.h:
+        (WebVibrationProxy):
+        * UIProcess/efl/WebPopupItemEfl.h:
+        (WebPopupItemEfl):
+        * UIProcess/efl/WebView.h:
+        * UIProcess/soup/WebSoupRequestManagerProxy.h:
+        (WebSoupRequestManagerProxy):
+        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
+        (InjectedBundleNodeHandle):
+        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
+        (InjectedBundleRangeHandle):
+        * WebProcess/InjectedBundle/InjectedBundle.h:
+        (InjectedBundle):
+        * WebProcess/InjectedBundle/InjectedBundleBackForwardList.h:
+        * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h:
+        * WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.h:
+        (InjectedBundleDOMWindowExtension):
+        * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
+        * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
+        (InjectedBundleNavigationAction):
+        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
+        (InjectedBundleScriptWorld):
+        * WebProcess/WebPage/PageOverlay.h:
+        (PageOverlay):
+        * WebProcess/WebPage/WebFrame.h:
+        (WebFrame):
+        * WebProcess/WebPage/WebInspector.h:
+        (WebInspector):
+        * WebProcess/WebPage/WebPage.h:
+        (WebPage):
+        * WebProcess/WebPage/WebPageGroupProxy.h:
+        (WebPageGroupProxy):
+
 2013-04-01  Timothy Hatcher  <timothy@apple.com>
 
         Allow changing Web Inspector dock sides without undocking first.
index 5eceb56..9710822 100644 (file)
@@ -148,6 +148,23 @@ protected:
     APIObject();
 };
 
+template <APIObject::Type ArgumentType>
+class TypedAPIObject : public APIObject {
+public:
+    static const Type APIType = ArgumentType;
+
+    virtual ~TypedAPIObject()
+    {
+    }
+
+protected:
+    TypedAPIObject()
+    {
+    }
+
+    virtual Type type() const OVERRIDE { return APIType; }
+};
+
 } // namespace WebKit
 
 #endif // APIObject_h
index d2208cd..6f7e768 100644 (file)
@@ -35,9 +35,8 @@ namespace WebKit {
 
 // ImmutableArray - An immutable array type suitable for vending to an API.
 
-class ImmutableArray : public APIObject {
+class ImmutableArray : public TypedAPIObject<APIObject::TypeArray> {
 public:
-    static const Type APIType = TypeArray;
     enum AdoptTag { Adopt };
 
     static PassRefPtr<ImmutableArray> create()
@@ -73,8 +72,6 @@ protected:
     ImmutableArray(APIObject** entries, size_t);
     ImmutableArray(Vector<RefPtr<APIObject> >& entries);
 
-    virtual Type type() const { return APIType; }
-
     Vector<RefPtr<APIObject> > m_entries;
 };
 
index 3f592c5..c969621 100644 (file)
@@ -38,10 +38,8 @@ class ImmutableArray;
 
 // ImmutableDictionary - An immutable dictionary type suitable for vending to an API.
 
-class ImmutableDictionary : public APIObject {
+class ImmutableDictionary : public TypedAPIObject<APIObject::TypeDictionary> {
 public:
-    static const Type APIType = TypeDictionary;
-
     typedef HashMap<String, RefPtr<APIObject> > MapType;
 
     static PassRefPtr<ImmutableDictionary> create()
@@ -85,8 +83,6 @@ protected:
     ImmutableDictionary();
     ImmutableDictionary(MapType& map);
 
-    virtual Type type() const { return APIType; }
-
     MapType m_map;
 };
 
index b16d551..6a07a45 100644 (file)
@@ -43,9 +43,8 @@ class ImmutableArray;
 class WebArchiveResource;
 class WebData;
 
-class WebArchive : public APIObject {
+class WebArchive : public TypedAPIObject<APIObject::TypeWebArchive> {
 public:
-    static const Type APIType = TypeWebArchive;
     virtual ~WebArchive();
 
     static PassRefPtr<WebArchive> create(WebArchiveResource* mainResource, ImmutableArray* subresources, ImmutableArray* subframeArchives);
@@ -66,8 +65,6 @@ private:
     WebArchive(WebData*);
     WebArchive(PassRefPtr<WebCore::LegacyWebArchive>);
 
-    virtual Type type() const { return APIType; }
-
     RefPtr<WebCore::LegacyWebArchive> m_legacyWebArchive;
     RefPtr<WebArchiveResource> m_cachedMainResource;
     RefPtr<ImmutableArray> m_cachedSubresources;
index 859284d..19a8790 100644 (file)
@@ -43,9 +43,8 @@ class WebData;
 class WebString;
 class WebURL;
 
-class WebArchiveResource : public APIObject {
+class WebArchiveResource : public TypedAPIObject<APIObject::TypeWebArchiveResource> {
 public:
-    static const Type APIType = TypeWebArchiveResource;
     virtual ~WebArchiveResource();
 
     static PassRefPtr<WebArchiveResource> create(WebData*, const String& URL, const String& MIMEType, const String& textEncoding);
@@ -62,8 +61,6 @@ private:
     WebArchiveResource(WebData*, const String& URL, const String& MIMEType, const String& textEncoding);
     WebArchiveResource(PassRefPtr<WebCore::ArchiveResource>);
 
-    virtual Type type() const { return APIType; }
-
     RefPtr<WebCore::ArchiveResource> m_archiveResource;
 };
 
index 2f34f5f..f373271 100644 (file)
@@ -37,10 +37,8 @@ namespace CoreIPC {
 
 namespace WebKit {
 
-class WebBackForwardListItem : public APIObject {
+class WebBackForwardListItem : public TypedAPIObject<APIObject::TypeBackForwardListItem> {
 public:
-    static const Type APIType = TypeBackForwardListItem;
-
     static PassRefPtr<WebBackForwardListItem> create(const String& originalURL, const String& url, const String& title, const uint8_t* backForwardData, size_t backForwardDataSize, uint64_t itemID)
     {
         return adoptRef(new WebBackForwardListItem(originalURL, url, title, backForwardData, backForwardDataSize, itemID));
@@ -70,8 +68,6 @@ public:
 private:
     WebBackForwardListItem(const String& originalURL, const String& url, const String& title, const uint8_t* backForwardData, size_t backForwardDataSize, uint64_t itemID);
 
-    virtual Type type() const { return APIType; }
-
     String m_originalURL;
     String m_url;
     String m_title;
index 6e3dea2..d66c293 100644 (file)
 
 namespace WebKit {
 
-class WebBatteryStatus : public APIObject {
+class WebBatteryStatus : public TypedAPIObject<APIObject::TypeBatteryStatus> {
 public:
-    static const Type APIType = TypeBatteryStatus;
-
     struct Data {
         void encode(CoreIPC::ArgumentEncoder&) const;
         static bool decode(CoreIPC::ArgumentDecoder&, Data&);
@@ -65,8 +63,6 @@ public:
 private:
     WebBatteryStatus(bool isCharging, double chargingTime, double dischargingTime, double level);
 
-    virtual Type type() const { return APIType; }
-
     Data m_data;
 };
 
index 84ff231..06182fc 100644 (file)
 
 namespace WebKit {
 
-class WebCertificateInfo : public APIObject {
+class WebCertificateInfo : public TypedAPIObject<APIObject::TypeCertificateInfo> {
 public:
-    static const Type APIType = TypeCertificateInfo;
-
     static PassRefPtr<WebCertificateInfo> create(const PlatformCertificateInfo& info)
     {
         return adoptRef(new WebCertificateInfo(info));
@@ -49,8 +47,6 @@ private:
     {
     }
 
-    virtual Type type() const { return APIType; }
-
     PlatformCertificateInfo m_platformCertificateInfo;
 };
 
index 9e0ce2c..b772e41 100644 (file)
@@ -34,9 +34,8 @@
 
 namespace WebKit {
 
-class WebConnection : public APIObject, public CoreIPC::MessageReceiver, public CoreIPC::MessageSender<WebConnection> {
+class WebConnection : public TypedAPIObject<APIObject::TypeConnection>, public CoreIPC::MessageReceiver, public CoreIPC::MessageSender<WebConnection> {
 public:
-    static const Type APIType = TypeConnection;
     virtual ~WebConnection();
 
     void initializeConnectionClient(const WKConnectionClient*);
@@ -50,8 +49,6 @@ public:
 protected:
     explicit WebConnection();
 
-    virtual Type type() const { return APIType; }
-
     virtual void encodeMessageBody(CoreIPC::ArgumentEncoder&, APIObject*) = 0;
     virtual bool decodeMessageBody(CoreIPC::ArgumentDecoder&, RefPtr<APIObject>&) = 0;
 
index 893dd5b..2414a05 100644 (file)
@@ -35,10 +35,8 @@ namespace WebKit {
 
 class ImmutableArray;
 
-class WebContextMenuItem : public APIObject {
+class WebContextMenuItem : public TypedAPIObject<APIObject::TypeContextMenuItem> {
 public:
-    static const Type APIType = TypeContextMenuItem;
-
     static PassRefPtr<WebContextMenuItem> create(const WebContextMenuItemData& data)
     {
         return adoptRef(new WebContextMenuItem(data));
@@ -55,9 +53,7 @@ public:
 
 private:
     WebContextMenuItem(const WebContextMenuItemData&);
-    
-    virtual Type type() const { return APIType; }
-    
+
     WebContextMenuItemData m_webContextMenuItemData;
 };
 
index a5a7dc1..e34bbee 100644 (file)
@@ -35,10 +35,8 @@ namespace WebKit {
 
 // WebData - A data buffer type suitable for vending to an API.
 
-class WebData : public APIObject {
+class WebData : public TypedAPIObject<APIObject::TypeData> {
 public:
-    static const Type APIType = TypeData;
-
     typedef void (*FreeDataFunction)(unsigned char*, const void* context);
 
     static PassRefPtr<WebData> createWithoutCopying(const unsigned char* bytes, size_t size, FreeDataFunction freeDataFunction, const void* context)
@@ -88,8 +86,6 @@ private:
             fastFree(static_cast<void*>(bytes));
     }
 
-    virtual Type type() const { return APIType; }
-
     const unsigned char* m_bytes;
     size_t m_size;
 
index 9c5ddb0..35ea359 100644 (file)
@@ -34,10 +34,8 @@ namespace WebKit {
 
 // WebError - An error type suitable for vending to an API.
 
-class WebError : public APIObject {
+class WebError : public TypedAPIObject<APIObject::TypeError> {
 public:
-    static const Type APIType = TypeError;
-
     static PassRefPtr<WebError> create()
     {
         return adoptRef(new WebError);
@@ -51,7 +49,7 @@ public:
     static const String& webKitErrorDomain();
 
     const String& domain() const { return m_platformError.domain(); }
-    int errorCode() const { return m_platformError.errorCode();; }
+    int errorCode() const { return m_platformError.errorCode(); }
     const String& failingURL() const { return m_platformError.failingURL(); }
     const String& localizedDescription() const { return m_platformError.localizedDescription(); }
 
@@ -67,8 +65,6 @@ private:
     {
     }
 
-    virtual Type type() const { return APIType; }
-
     WebCore::ResourceError m_platformError;
 };
 
index f9e28a5..9ba4093 100644 (file)
 
 namespace WebKit {
 
-class WebGeolocationPosition : public APIObject {
+class WebGeolocationPosition : public TypedAPIObject<APIObject::TypeGeolocationPosition> {
 public:
-    static const Type APIType = TypeGeolocationPosition;
-
     struct Data {
         void encode(CoreIPC::ArgumentEncoder&) const;
         static bool decode(CoreIPC::ArgumentDecoder&, Data&);
@@ -86,8 +84,6 @@ public:
 private:
     WebGeolocationPosition(double timestamp, double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed);
 
-    virtual Type type() const { return APIType; }
-
     Data m_data;
 };
 
index bdea9c7..3661af0 100644 (file)
@@ -38,10 +38,8 @@ namespace CoreIPC {
 
 namespace WebKit {
 
-class WebSize : public APIObject {
+class WebSize : public TypedAPIObject<APIObject::TypeSize> {
 public:
-    static const Type APIType = TypeSize;
-
     static PassRefPtr<WebSize> create(const WKSize& size)
     {
         return adoptRef(new WebSize(size));
@@ -54,15 +52,11 @@ private:
         : m_size(size)
     { }
 
-    virtual Type type() const { return APIType; }
-
     WKSize m_size;
 };
 
-class WebPoint : public APIObject {
+class WebPoint : public TypedAPIObject<APIObject::TypePoint> {
 public:
-    static const Type APIType = TypePoint;
-
     static PassRefPtr<WebPoint> create(const WKPoint& point)
     {
         return adoptRef(new WebPoint(point));
@@ -75,15 +69,11 @@ private:
         : m_point(point)
     { }
 
-    virtual Type type() const { return APIType; }
-
     WKPoint m_point;
 };
 
-class WebRect : public APIObject {
+class WebRect : public TypedAPIObject<APIObject::TypeRect> {
 public:
-    static const Type APIType = TypeRect;
-
     static PassRefPtr<WebRect> create(const WKRect& rect)
     {
         return adoptRef(new WebRect(rect));
@@ -96,8 +86,6 @@ private:
         : m_rect(rect)
     { }
 
-    virtual Type type() const { return APIType; }
-
     WKRect m_rect;
 };
 
index 8585d34..4cdd772 100644 (file)
 
 namespace WebKit {
 
-class WebGraphicsContext : public APIObject {
+class WebGraphicsContext : public TypedAPIObject<APIObject::TypeGraphicsContext> {
 public:
-    static const Type APIType = TypeGraphicsContext;
-
     static PassRefPtr<WebGraphicsContext> create(WebCore::GraphicsContext* graphicsContext)
     {
         return adoptRef(new WebGraphicsContext(graphicsContext));
@@ -57,8 +55,6 @@ public:
 private:
     explicit WebGraphicsContext(WebCore::GraphicsContext*);
 
-    virtual Type type() const { return APIType; }
-
 #if USE(CG)
     RetainPtr<CGContextRef> m_platformContext;
 #elif USE(CAIRO)
index 8f2aca7..a5b246d 100644 (file)
@@ -39,10 +39,8 @@ namespace WebKit {
 
 class WebFrame;
 
-class WebHitTestResult : public APIObject {
+class WebHitTestResult : public TypedAPIObject<APIObject::TypeHitTestResult> {
 public:
-    static const Type APIType = TypeHitTestResult;
-
     struct Data {
         String absoluteImageURL;
         String absolutePDFURL;
@@ -114,8 +112,6 @@ private:
     {
     }
 
-    virtual Type type() const { return APIType; }
-
     Data m_data;
 };
 
index 0380b7d..d2d3835 100644 (file)
@@ -40,10 +40,8 @@ class ShareableBitmap;
 
 // WebImage - An image type suitable for vending to an API.
 
-class WebImage : public APIObject {
+class WebImage : public TypedAPIObject<APIObject::TypeImage> {
 public:
-    static const Type APIType = TypeImage;
-
     static PassRefPtr<WebImage> create(const WebCore::IntSize&, ImageOptions);
     static PassRefPtr<WebImage> create(PassRefPtr<ShareableBitmap>);
     ~WebImage();
@@ -55,8 +53,6 @@ public:
 private:
     WebImage(PassRefPtr<ShareableBitmap>);
 
-    virtual Type type() const { return APIType; }
-
     RefPtr<ShareableBitmap> m_bitmap;
 };
 
index 5af139b..2b4bea3 100644 (file)
 
 namespace WebKit {
 
-class WebNetworkInfo : public APIObject {
+class WebNetworkInfo : public TypedAPIObject<APIObject::TypeNetworkInfo> {
 public:
-    static const Type APIType = TypeNetworkInfo;
-
     struct Data {
         void encode(CoreIPC::ArgumentEncoder&) const;
         static bool decode(CoreIPC::ArgumentDecoder&, Data&);
@@ -62,8 +60,6 @@ public:
 private:
     WebNetworkInfo(double bandwidth, bool metered);
 
-    virtual Type type() const { return APIType; }
-
     Data m_data;
 };
 
index 0b092ef..f9507c9 100644 (file)
 namespace WebKit {
 
 template<typename NumberType, APIObject::Type APIObjectType>
-class WebNumber : public APIObject {
+class WebNumber : public TypedAPIObject<APIObjectType> {
 public:
-    static const Type APIType = APIObjectType;
-
     static PassRefPtr<WebNumber> create(NumberType value)
     {
         return adoptRef(new WebNumber(value));
@@ -49,8 +47,6 @@ private:
     {
     }
 
-    virtual Type type() const { return APIType; }
-
     const NumberType m_value;
 };
 
index ab12c0f..9077cf2 100644 (file)
@@ -36,10 +36,8 @@ namespace WebKit {
 
 class ImmutableArray;
 
-class WebOpenPanelParameters : public APIObject {
+class WebOpenPanelParameters : public TypedAPIObject<APIObject::TypeOpenPanelParameters> {
 public:
-    static const Type APIType = TypeOpenPanelParameters;
-
     static PassRefPtr<WebOpenPanelParameters> create(const WebCore::FileChooserSettings&);
     ~WebOpenPanelParameters();
 
@@ -53,8 +51,6 @@ public:
 private:
     explicit WebOpenPanelParameters(const WebCore::FileChooserSettings&);
 
-    virtual Type type() const { return APIType; }
-
     WebCore::FileChooserSettings m_settings;
 };
 
index 5ebd050..24738b4 100644 (file)
@@ -36,10 +36,8 @@ namespace WebKit {
 
 class WebPage;
 
-class WebRenderLayer : public APIObject {
+class WebRenderLayer : public TypedAPIObject<APIObject::TypeRenderLayer> {
 public:
-    static const Type APIType = TypeRenderLayer;
-
     enum CompositingLayerType { None, Normal, Tiled, Media, Container };
 
     static PassRefPtr<WebRenderLayer> create(WebPage*);
@@ -76,8 +74,6 @@ private:
     {
     }
 
-    virtual Type type() const OVERRIDE { return APIType; }
-
     static PassRefPtr<MutableArray> createArrayFromLayerList(Vector<WebCore::RenderLayer*>*);
 
     RefPtr<WebRenderObject> m_renderer;
index 3e05622..7dad28e 100644 (file)
@@ -40,10 +40,8 @@ namespace WebKit {
 
 class WebPage;
 
-class WebRenderObject : public APIObject {
+class WebRenderObject : public TypedAPIObject<APIObject::TypeRenderObject> {
 public:
-    static const Type APIType = TypeRenderObject;
-
     static PassRefPtr<WebRenderObject> create(WebPage*);
     static PassRefPtr<WebRenderObject> create(WebCore::RenderObject* renderer)
     {
@@ -79,8 +77,6 @@ private:
     {
     }
 
-    virtual Type type() const OVERRIDE { return APIType; }
-
     RefPtr<MutableArray> m_children;
 
     String m_name;
index b6ec1c9..f243372 100644 (file)
 
 namespace WebKit {
 
-class WebSecurityOrigin : public APIObject {
+class WebSecurityOrigin : public TypedAPIObject<APIObject::TypeSecurityOrigin> {
 public:
-    static const Type APIType = TypeSecurityOrigin;
-
     static PassRefPtr<WebSecurityOrigin> createFromString(const String& string)
     {
         return create(WebCore::SecurityOrigin::createFromString(string));
@@ -71,8 +69,6 @@ private:
     {
     }
 
-    virtual Type type() const { return APIType; }
-
     RefPtr<WebCore::SecurityOrigin> m_securityOrigin;
 };
 
index ecb2a96..0e518fe 100644 (file)
 
 namespace WebKit {
 
-class WebSerializedScriptValue : public APIObject {
+class WebSerializedScriptValue : public TypedAPIObject<APIObject::TypeSerializedScriptValue> {
 public:
-    static const Type APIType = TypeSerializedScriptValue;
-    
     static PassRefPtr<WebSerializedScriptValue> create(PassRefPtr<WebCore::SerializedScriptValue> serializedValue)
     {
         return adoptRef(new WebSerializedScriptValue(serializedValue));
@@ -70,9 +68,7 @@ private:
         : m_serializedScriptValue(serializedScriptValue)
     {
     }
-    
-    virtual Type type() const { return APIType; }
-    
+
     RefPtr<WebCore::SerializedScriptValue> m_serializedScriptValue;
 };
     
index 791e6a3..2d605d3 100644 (file)
@@ -38,10 +38,8 @@ namespace WebKit {
 
 // WebString - A string type suitable for vending to an API.
 
-class WebString : public APIObject {
+class WebString : public TypedAPIObject<APIObject::TypeString> {
 public:
-    static const Type APIType = TypeString;
-
     static PassRefPtr<WebString> createNull()
     {
         return adoptRef(new WebString());
@@ -112,8 +110,6 @@ private:
     {
     }
 
-    virtual Type type() const { return APIType; }
-
     String m_string;
 };
 
index 46ebb43..27a744e 100644 (file)
@@ -37,10 +37,8 @@ namespace WebKit {
 
 // WebURL - A URL type suitable for vending to an API.
 
-class WebURL : public APIObject {
+class WebURL : public TypedAPIObject<APIObject::TypeURL> {
 public:
-    static const Type APIType = TypeURL;
-
     static PassRefPtr<WebURL> create(const String& string)
     {
         return adoptRef(new WebURL(string));
@@ -105,8 +103,6 @@ private:
         m_parsedURL = WTF::adoptPtr(new WebCore::KURL(WebCore::KURL(), m_string));
     }
 
-    virtual Type type() const { return APIType; }
-
     String m_string;
     mutable OwnPtr<WebCore::KURL> m_parsedURL;
 };
index d3e3982..4f8aeff 100644 (file)
@@ -38,10 +38,8 @@ typedef void* PlatformRequest;
 
 namespace WebKit {
 
-class WebURLRequest : public APIObject {
+class WebURLRequest : public TypedAPIObject<APIObject::TypeURLRequest> {
 public:
-    static const Type APIType = TypeURLRequest;
-
     static PassRefPtr<WebURLRequest> create(const WebCore::KURL&);
 
     static PassRefPtr<WebURLRequest> create(const WebCore::ResourceRequest& request)
@@ -66,8 +64,6 @@ private:
     explicit WebURLRequest(const WebCore::ResourceRequest&);
     explicit WebURLRequest(PlatformRequest);
 
-    virtual Type type() const { return APIType; }
-
     WebCore::ResourceRequest m_request;
 };
 
index 77bbc18..add3466 100644 (file)
@@ -38,10 +38,8 @@ typedef void* PlatformResponse;
 
 namespace WebKit {
 
-class WebURLResponse : public APIObject {
+class WebURLResponse : public TypedAPIObject<APIObject::TypeURLResponse> {
 public:
-    static const Type APIType = TypeURLResponse;
-
     static PassRefPtr<WebURLResponse> create(const WebCore::ResourceResponse& response)
     {
         return adoptRef(new WebURLResponse(response));
@@ -59,8 +57,6 @@ private:
     explicit WebURLResponse(const WebCore::ResourceResponse&);
     explicit WebURLResponse(PlatformResponse);
 
-    virtual Type type() const { return APIType; }
-
     WebCore::ResourceResponse m_response;
 };
 
index 88f03da..5c08b80 100644 (file)
 
 namespace WebKit {
 
-class WebUserContentURLPattern : public APIObject {
+class WebUserContentURLPattern : public TypedAPIObject<APIObject::TypeUserContentURLPattern> {
 public:
-    static const Type APIType = TypeUserContentURLPattern;
-
     static PassRefPtr<WebUserContentURLPattern> create(const String& pattern)
     {
         return adoptRef(new WebUserContentURLPattern(pattern));
@@ -58,8 +56,6 @@ private:
     {
     }
 
-    virtual Type type() const { return APIType; }
-
     WebCore::UserContentURLPattern m_pattern;
     String m_patternString;
 };
index 7160c6f..9d63f05 100644 (file)
 
 namespace WebKit {
 
-class ObjCObjectGraph : public APIObject {
+class ObjCObjectGraph : public TypedAPIObject<APIObject::TypeObjCObjectGraph> {
 public:
-    static const Type APIType = TypeObjCObjectGraph;
-
     static PassRefPtr<ObjCObjectGraph> create(id rootObject)
     {
         return adoptRef(new ObjCObjectGraph(rootObject));
@@ -48,8 +46,6 @@ private:
     {
     }
 
-    virtual Type type() const { return APIType; }
-
     RetainPtr<id> m_rootObject;
 };
 
index e819331..ce3d6d6 100644 (file)
@@ -41,10 +41,8 @@ class ChildProcessProxy;
 class WebCredential;
 class WebProtectionSpace;
 
-class AuthenticationChallengeProxy : public APIObject {
+class AuthenticationChallengeProxy : public TypedAPIObject<APIObject::TypeAuthenticationChallenge> {
 public:
-    static const Type APIType = TypeAuthenticationChallenge;
-
     static PassRefPtr<AuthenticationChallengeProxy> create(const WebCore::AuthenticationChallenge& authenticationChallenge, uint64_t challengeID, CoreIPC::Connection* connection)
     {
         return adoptRef(new AuthenticationChallengeProxy(authenticationChallenge, challengeID, connection));
@@ -64,8 +62,6 @@ public:
 private:
     AuthenticationChallengeProxy(const WebCore::AuthenticationChallenge&, uint64_t challengeID, CoreIPC::Connection*);
 
-    virtual Type type() const { return APIType; }
-    
     WebCore::AuthenticationChallenge m_coreAuthenticationChallenge;
     uint64_t m_challengeID;
     RefPtr<CoreIPC::Connection> m_connection;
index b2f92f4..940a650 100644 (file)
@@ -35,10 +35,8 @@ namespace WebKit {
 class AuthenticationChallengeProxy;
 class WebCredential;
 
-class AuthenticationDecisionListener : public APIObject {
+class AuthenticationDecisionListener : public TypedAPIObject<APIObject::TypeAuthenticationDecisionListener> {
 public:
-    static const Type APIType = TypeAuthenticationDecisionListener;
-
     static PassRefPtr<AuthenticationDecisionListener> create(AuthenticationChallengeProxy* authenticationChallenge)
     {
         return adoptRef(new AuthenticationDecisionListener(authenticationChallenge));
@@ -52,8 +50,6 @@ public:
 private:
     explicit AuthenticationDecisionListener(AuthenticationChallengeProxy*);
 
-    virtual Type type() const { return APIType; }
-    
     AuthenticationChallengeProxy* m_challengeProxy;
 };
 
index 2b1cc83..a957e78 100644 (file)
@@ -37,12 +37,10 @@ namespace WebKit {
 
 class WebCertificateInfo;
 
-class WebCredential : public APIObject {
+class WebCredential : public TypedAPIObject<APIObject::TypeCredential> {
 public:
     ~WebCredential();
 
-    static const Type APIType = TypeCredential;
-
     static PassRefPtr<WebCredential> create(const WebCore::Credential& credential)
     {
         return adoptRef(new WebCredential(credential));
@@ -68,8 +66,6 @@ private:
     explicit WebCredential(const WebCore::Credential&);
     explicit WebCredential(WebCertificateInfo*);
 
-    virtual Type type() const { return APIType; }
-
     WebCore::Credential m_coreCredential;
     RefPtr<WebCertificateInfo> m_certificateInfo;
 };
index 7c3882a..4d4905f 100644 (file)
 
 namespace WebKit {
 
-class WebProtectionSpace : public APIObject {
+class WebProtectionSpace : public TypedAPIObject<APIObject::TypeProtectionSpace> {
 public:
-    static const Type APIType = TypeProtectionSpace;
-
     static PassRefPtr<WebProtectionSpace> create(const WebCore::ProtectionSpace& protectionSpace)
     {
         return adoptRef(new WebProtectionSpace(protectionSpace));
@@ -53,8 +51,6 @@ public:
 private:
     explicit WebProtectionSpace(const WebCore::ProtectionSpace&);
 
-    virtual Type type() const { return APIType; }
-    
     WebCore::ProtectionSpace m_coreProtectionSpace;
 };
 
index 8156e4f..1d98305 100644 (file)
@@ -46,10 +46,8 @@ class WebContext;
 class WebData;
 class WebPageProxy;
 
-class DownloadProxy : public APIObject, public CoreIPC::MessageReceiver {
+class DownloadProxy : public TypedAPIObject<APIObject::TypeDownload>, public CoreIPC::MessageReceiver {
 public:
-    static const Type APIType = TypeDownload;
-
     static PassRefPtr<DownloadProxy> create(DownloadProxyMap&, WebContext*);
     ~DownloadProxy();
 
@@ -72,8 +70,6 @@ public:
 private:
     explicit DownloadProxy(DownloadProxyMap&, WebContext*);
 
-    virtual Type type() const { return APIType; }
-
     // CoreIPC::MessageReceiver
     virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE;
     virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&) OVERRIDE;
index c34c3fd..3912754 100644 (file)
@@ -33,10 +33,8 @@ namespace WebKit {
 
 class GeolocationPermissionRequestManagerProxy;
 
-class GeolocationPermissionRequestProxy : public APIObject {
+class GeolocationPermissionRequestProxy : public TypedAPIObject<APIObject::TypeGeolocationPermissionRequest> {
 public:
-    static const Type APIType = TypeGeolocationPermissionRequest;
-
     static PassRefPtr<GeolocationPermissionRequestProxy> create(GeolocationPermissionRequestManagerProxy* manager, uint64_t geolocationID)
     {
         return adoptRef(new GeolocationPermissionRequestProxy(manager, geolocationID));
@@ -50,8 +48,6 @@ public:
 private:
     GeolocationPermissionRequestProxy(GeolocationPermissionRequestManagerProxy*, uint64_t geolocationID);
 
-    virtual Type type() const { return APIType; }
-
     GeolocationPermissionRequestManagerProxy* m_manager;
     uint64_t m_geolocationID;
 };
index 24db98b..2576a7a 100644 (file)
@@ -33,22 +33,18 @@ namespace WebKit {
 
 class NotificationPermissionRequestManagerProxy;
 
-class NotificationPermissionRequest : public APIObject {
+class NotificationPermissionRequest : public TypedAPIObject<APIObject::TypeNotificationPermissionRequest> {
 public:
-    static const Type APIType = TypeNotificationPermissionRequest;
-    
     static PassRefPtr<NotificationPermissionRequest> create(NotificationPermissionRequestManagerProxy*, uint64_t notificationID);
-    
+
     void allow();
     void deny();
-    
+
     void invalidate();
-    
+
 private:
     NotificationPermissionRequest(NotificationPermissionRequestManagerProxy*, uint64_t notificationID);
-    
-    virtual Type type() const { return APIType; }
-    
+
     NotificationPermissionRequestManagerProxy* m_manager;
     uint64_t m_notificationID;    
 };
index 8edcced..14e905c 100644 (file)
@@ -41,15 +41,13 @@ class ArgumentEncoder;
 
 namespace WebKit {
 
-class WebNotification : public APIObject {
+class WebNotification : public TypedAPIObject<APIObject::TypeNotification> {
 public:
-    static const Type APIType = TypeNotification;
-    
     static PassRefPtr<WebNotification> create(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID)
     {
         return adoptRef(new WebNotification(title, body, iconURL, tag, lang, dir, originString, notificationID));
     }
-    
+
     const String& title() const { return m_title; }
     const String& body() const { return m_body; }
     const String& iconURL() const { return m_iconURL; }
@@ -63,8 +61,6 @@ public:
 private:
     WebNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID);
 
-    virtual Type type() const { return APIType; }
-    
     String m_title;
     String m_body;
     String m_iconURL;
index 26f10fa..17ba286 100644 (file)
@@ -43,9 +43,8 @@ class WebContext;
 class WebPageProxy;
 class WebSecurityOrigin;
 
-class WebNotificationManagerProxy : public APIObject, public WebContextSupplement, private CoreIPC::MessageReceiver {
+class WebNotificationManagerProxy : public TypedAPIObject<APIObject::TypeNotificationManager>, public WebContextSupplement, private CoreIPC::MessageReceiver {
 public:
-    static const Type APIType = TypeNotificationManager;
 
     static const char* supplementName();
 
@@ -67,8 +66,6 @@ public:
 
 private:
     explicit WebNotificationManagerProxy(WebContext*);
-    
-    virtual Type type() const { return APIType; }
 
     // WebContextSupplement
     virtual void contextDestroyed() OVERRIDE;
index 6e517f4..8430a23 100644 (file)
@@ -41,10 +41,8 @@ class WebProcessProxy;
 
 typedef GenericCallback<WKArrayRef> ArrayCallback;
 
-class WebPluginSiteDataManager : public APIObject {
+class WebPluginSiteDataManager : public TypedAPIObject<APIObject::TypePluginSiteDataManager> {
 public:
-    static const Type APIType = TypePluginSiteDataManager;
-
     static PassRefPtr<WebPluginSiteDataManager> create(WebContext*);
     virtual ~WebPluginSiteDataManager();
 
@@ -67,8 +65,6 @@ public:
 private:
     explicit WebPluginSiteDataManager(WebContext*);
 
-    virtual Type type() const { return APIType; }
-
     WebContext* m_webContext;
     HashMap<uint64_t, RefPtr<ArrayCallback> > m_arrayCallbacks;
     HashMap<uint64_t, RefPtr<VoidCallback> > m_voidCallbacks;
index 715265f..ee5a270 100644 (file)
@@ -46,10 +46,8 @@ struct SecurityOriginData;
 
 typedef GenericCallback<WKArrayRef> ArrayCallback;
 
-class WebApplicationCacheManagerProxy : public APIObject, public WebContextSupplement, private CoreIPC::MessageReceiver {
+class WebApplicationCacheManagerProxy : public TypedAPIObject<APIObject::TypeApplicationCacheManager>, public WebContextSupplement, private CoreIPC::MessageReceiver {
 public:
-    static const Type APIType = TypeApplicationCacheManager;
-
     static const char* supplementName();
 
     static PassRefPtr<WebApplicationCacheManagerProxy> create(WebContext*);
@@ -65,8 +63,6 @@ public:
 private:
     explicit WebApplicationCacheManagerProxy(WebContext*);
 
-    virtual Type type() const { return APIType; }
-
     void didGetApplicationCacheOrigins(const Vector<SecurityOriginData>&, uint64_t callbackID);
 
     // WebContextSupplement
index b6de90b..ecef42b 100644 (file)
@@ -47,10 +47,8 @@ typedef Vector<RefPtr<WebBackForwardListItem> > BackForwardListItemVector;
  *      Back        Forward
  */
 
-class WebBackForwardList : public APIObject {
+class WebBackForwardList : public TypedAPIObject<APIObject::TypeBackForwardList> {
 public:
-    static const Type APIType = TypeBackForwardList;
-
     static PassRefPtr<WebBackForwardList> create(WebPageProxy* page)
     {
         return adoptRef(new WebBackForwardList(page));
@@ -87,8 +85,6 @@ public:
 private:
     explicit WebBackForwardList(WebPageProxy*);
 
-    virtual Type type() const { return APIType; }
-
     WebPageProxy* m_page;
     BackForwardListItemVector m_entries;
     
index 7498457..f4c49f6 100644 (file)
@@ -37,11 +37,9 @@ namespace WebKit {
 
 class WebContext;
 class WebBatteryStatus;
-class WebBatteryManagerProxy : public APIObject, private CoreIPC::MessageReceiver {
+class WebBatteryManagerProxy : public TypedAPIObject<APIObject::TypeBatteryManager>, private CoreIPC::MessageReceiver {
 
 public:
-    static const Type APIType = TypeBatteryManager;
-
     static PassRefPtr<WebBatteryManagerProxy> create(WebContext*);
     virtual ~WebBatteryManagerProxy();
 
@@ -56,8 +54,6 @@ public:
 private:
     explicit WebBatteryManagerProxy(WebContext*);
 
-    virtual Type type() const { return APIType; }
-
     // CoreIPC::MessageReceiver
     virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE;
 
index 09a1228..f6db592 100644 (file)
@@ -85,14 +85,12 @@ extern NSString *SchemeForCustomProtocolRegisteredNotificationName;
 extern NSString *SchemeForCustomProtocolUnregisteredNotificationName;
 #endif
 
-class WebContext : public APIObject, private CoreIPC::MessageReceiver
+class WebContext : public TypedAPIObject<APIObject::TypeContext>, private CoreIPC::MessageReceiver
 #if ENABLE(NETSCAPE_PLUGIN_API)
     , private PluginInfoStoreClient
 #endif
     {
 public:
-    static const Type APIType = TypeContext;
-
     static PassRefPtr<WebContext> create(const String& injectedBundlePath);
     virtual ~WebContext();
 
@@ -304,8 +302,6 @@ private:
     WebContext(ProcessModel, const String& injectedBundlePath);
     void platformInitialize();
 
-    virtual Type type() const { return APIType; }
-
     void platformInitializeWebProcess(WebProcessCreationParameters&);
     void platformInvalidateContext();
 
index 0ac5e7f..ae3b5c2 100644 (file)
@@ -48,10 +48,8 @@ class WebProcessProxy;
 typedef GenericCallback<WKArrayRef> ArrayCallback;
 typedef GenericCallback<WKHTTPCookieAcceptPolicy, HTTPCookieAcceptPolicy> HTTPCookieAcceptPolicyCallback;
 
-class WebCookieManagerProxy : public APIObject, public WebContextSupplement, private CoreIPC::MessageReceiver {
+class WebCookieManagerProxy : public TypedAPIObject<APIObject::TypeCookieManager>, public WebContextSupplement, private CoreIPC::MessageReceiver {
 public:
-    static const Type APIType = TypeCookieManager;
-
     static const char* supplementName();
 
     static PassRefPtr<WebCookieManagerProxy> create(WebContext*);
@@ -80,8 +78,6 @@ public:
 private:
     WebCookieManagerProxy(WebContext*);
 
-    virtual Type type() const { return APIType; }
-
     void didGetHostnamesWithCookies(const Vector<String>&, uint64_t callbackID);
     void didGetHTTPCookieAcceptPolicy(uint32_t policy, uint64_t callbackID);
 
index a93a978..3266d58 100644 (file)
@@ -46,10 +46,8 @@ class WebSecurityOrigin;
 
 typedef GenericCallback<WKArrayRef> ArrayCallback;
 
-class WebDatabaseManagerProxy : public APIObject, public WebContextSupplement, private CoreIPC::MessageReceiver {
+class WebDatabaseManagerProxy : public TypedAPIObject<APIObject::TypeDatabaseManager>, public WebContextSupplement, private CoreIPC::MessageReceiver {
 public:
-    static const Type APIType = TypeDatabaseManager;
-
     static const char* supplementName();
 
     static PassRefPtr<WebDatabaseManagerProxy> create(WebContext*);
@@ -79,8 +77,6 @@ public:
 private:
     explicit WebDatabaseManagerProxy(WebContext*);
 
-    virtual Type type() const { return APIType; }
-
     // WebContextSupplement
     virtual void contextDestroyed() OVERRIDE;
     virtual void processDidClose(WebProcessProxy*) OVERRIDE;
index 67d1430..f4f32ca 100644 (file)
@@ -36,7 +36,7 @@ namespace WebKit {
 
 class WebPageProxy;
 
-class WebEditCommandProxy : public APIObject {
+class WebEditCommandProxy : public TypedAPIObject<APIObject::TypeEditCommandProxy> {
 public:
     static PassRefPtr<WebEditCommandProxy> create(uint64_t commandID, WebCore::EditAction editAction, WebPageProxy* page)
     {
@@ -57,8 +57,6 @@ public:
 private:
     WebEditCommandProxy(uint64_t commandID, WebCore::EditAction, WebPageProxy*);
 
-    virtual Type type() const { return TypeEditCommandProxy; }
-
     uint64_t m_commandID;
     WebCore::EditAction m_editAction;
     WebPageProxy* m_page;
index 1cf5322..0bee666 100644 (file)
@@ -51,10 +51,8 @@ class WebPageProxy;
 
 typedef GenericCallback<WKDataRef> DataCallback;
 
-class WebFrameProxy : public APIObject {
+class WebFrameProxy : public TypedAPIObject<APIObject::TypeFrame> {
 public:
-    static const Type APIType = TypeFrame;
-
     static PassRefPtr<WebFrameProxy> create(WebPageProxy* page, uint64_t frameID)
     {
         return adoptRef(new WebFrameProxy(page, frameID));
@@ -122,8 +120,6 @@ public:
 private:
     WebFrameProxy(WebPageProxy* page, uint64_t frameID);
 
-    virtual Type type() const { return APIType; }
-
     WebPageProxy* m_page;
     LoadState m_loadState;
     String m_url;
index c0a80b2..a2d97c6 100644 (file)
@@ -37,10 +37,8 @@ namespace WebKit {
 class WebContext;
 class WebGeolocationPosition;
 
-class WebGeolocationManagerProxy : public APIObject, public WebContextSupplement, private CoreIPC::MessageReceiver {
+class WebGeolocationManagerProxy : public TypedAPIObject<APIObject::TypeGeolocationManager>, public WebContextSupplement, private CoreIPC::MessageReceiver {
 public:
-    static const Type APIType = TypeGeolocationManager;
-
     static const char* supplementName();
 
     static PassRefPtr<WebGeolocationManagerProxy> create(WebContext*);
@@ -57,8 +55,6 @@ public:
 private:
     explicit WebGeolocationManagerProxy(WebContext*);
 
-    virtual Type type() const { return APIType; }
-
     // WebContextSupplement
     virtual void contextDestroyed() OVERRIDE;
     virtual void processDidClose(WebProcessProxy*) OVERRIDE;
index 2fcebc0..0460740 100644 (file)
@@ -35,9 +35,8 @@ namespace WebKit {
 
 class ImmutableArray;
 
-class WebGrammarDetail : public APIObject {
+class WebGrammarDetail : public TypedAPIObject<APIObject::TypeGrammarDetail> {
 public:
-    static const Type APIType = TypeGrammarDetail;
     static PassRefPtr<WebGrammarDetail> create(int location, int length, ImmutableArray* guesses, const String& userDescription);
     static PassRefPtr<WebGrammarDetail> create(const WebCore::GrammarDetail&);
 
@@ -52,8 +51,6 @@ private:
     WebGrammarDetail(int location, int length, ImmutableArray* guesses, const String& userDescription);
     explicit WebGrammarDetail(const WebCore::GrammarDetail&);
 
-    virtual Type type() const { return APIType; }
-
     WebCore::GrammarDetail m_grammarDetail;
 };
 
index 844e2d9..be1b3dc 100644 (file)
@@ -53,10 +53,8 @@ namespace WebKit {
 
 class WebContext;
 
-class WebIconDatabase : public APIObject, public WebCore::IconDatabaseClient, private CoreIPC::MessageReceiver {
+class WebIconDatabase : public TypedAPIObject<APIObject::TypeIconDatabase>, public WebCore::IconDatabaseClient, private CoreIPC::MessageReceiver {
 public:
-    static const Type APIType = TypeIconDatabase;
-
     static PassRefPtr<WebIconDatabase> create(WebContext*);
     virtual ~WebIconDatabase();
 
@@ -92,8 +90,6 @@ public:
 private:
     WebIconDatabase(WebContext*);
 
-    virtual Type type() const { return APIType; }
-
     // WebCore::IconDatabaseClient
     virtual void didImportIconURLForPageURL(const String&);
     virtual void didImportIconDataForPageURL(const String&);
index eb20d44..db98d41 100644 (file)
@@ -67,10 +67,8 @@ enum AttachmentSide {
     AttachmentSideRight
 };
 
-class WebInspectorProxy : public APIObject, public CoreIPC::MessageReceiver {
+class WebInspectorProxy : public TypedAPIObject<APIObject::TypeInspector>, public CoreIPC::MessageReceiver {
 public:
-    static const Type APIType = TypeInspector;
-
     static PassRefPtr<WebInspectorProxy> create(WebPageProxy* page)
     {
         return adoptRef(new WebInspectorProxy(page));
@@ -147,8 +145,6 @@ public:
 private:
     explicit WebInspectorProxy(WebPageProxy*);
 
-    virtual Type type() const { return APIType; }
-
     // CoreIPC::MessageReceiver
     virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE;
     virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&) OVERRIDE;
index 5e3c3af..c7e9b66 100644 (file)
@@ -44,10 +44,8 @@ class WebSecurityOrigin;
 
 typedef GenericCallback<WKArrayRef> ArrayCallback;
 
-class WebKeyValueStorageManagerProxy : public APIObject, public WebContextSupplement, private CoreIPC::MessageReceiver {
+class WebKeyValueStorageManagerProxy : public TypedAPIObject<APIObject::TypeKeyValueStorageManager>, public WebContextSupplement, private CoreIPC::MessageReceiver {
 public:
-    static const Type APIType = TypeKeyValueStorageManager;
-
     static const char* supplementName();
 
     static PassRefPtr<WebKeyValueStorageManagerProxy> create(WebContext*);
@@ -63,8 +61,6 @@ public:
 private:
     explicit WebKeyValueStorageManagerProxy(WebContext*);
 
-    virtual Type type() const { return APIType; }
-
     void didGetKeyValueStorageOrigins(const Vector<SecurityOriginData>&, uint64_t callbackID);
 
     // WebContextSupplement
index 6a0e9b6..5c10b24 100644 (file)
@@ -42,10 +42,8 @@ class WebProcessProxy;
 
 typedef GenericCallback<WKArrayRef> ArrayCallback;
 
-class WebMediaCacheManagerProxy : public APIObject, public WebContextSupplement, private CoreIPC::MessageReceiver {
+class WebMediaCacheManagerProxy : public TypedAPIObject<APIObject::TypeMediaCacheManager>, public WebContextSupplement, private CoreIPC::MessageReceiver {
 public:
-    static const Type APIType = TypeMediaCacheManager;
-
     static const char* supplementName();
 
     static PassRefPtr<WebMediaCacheManagerProxy> create(WebContext*);
@@ -61,8 +59,6 @@ public:
 private:
     explicit WebMediaCacheManagerProxy(WebContext*);
 
-    virtual Type type() const { return APIType; }
-
     void didGetHostnamesWithMediaCache(const Vector<String>&, uint64_t callbackID);
 
     // WebContextSupplement
index c2e20f3..297485f 100644 (file)
 
 namespace WebKit {
 
-class WebNavigationData : public APIObject {
+class WebNavigationData : public TypedAPIObject<APIObject::TypeNavigationData> {
 public:
-    static const Type APIType = TypeNavigationData;
-
     static PassRefPtr<WebNavigationData> create(const WebNavigationDataStore& store)
     {
         return adoptRef(new WebNavigationData(store));
@@ -50,8 +48,6 @@ public:
 private:
     explicit WebNavigationData(const WebNavigationDataStore&);
 
-    virtual Type type() const { return APIType; }
-
     WebNavigationDataStore m_store;
 };
 
index 81f586a..52c69f5 100644 (file)
@@ -38,10 +38,8 @@ namespace WebKit {
 class WebContext;
 class WebNetworkInfo;
 
-class WebNetworkInfoManagerProxy : public APIObject, private CoreIPC::MessageReceiver {
+class WebNetworkInfoManagerProxy : public TypedAPIObject<APIObject::TypeNetworkInfoManager>, private CoreIPC::MessageReceiver {
 public:
-    static const Type APIType = TypeNetworkInfoManager;
-
     static PassRefPtr<WebNetworkInfoManagerProxy> create(WebContext*);
     virtual ~WebNetworkInfoManagerProxy();
 
@@ -55,8 +53,6 @@ public:
 private:
     explicit WebNetworkInfoManagerProxy(WebContext*);
 
-    virtual Type type() const { return APIType; }
-
     // CoreIPC::MessageReceiver
     virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE;
     virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&) OVERRIDE;
index 5ec369c..98ab30c 100644 (file)
@@ -35,10 +35,8 @@ namespace WebKit {
 class ImmutableArray;
 class WebPageProxy;
 
-class WebOpenPanelResultListenerProxy : public APIObject {
+class WebOpenPanelResultListenerProxy : public TypedAPIObject<APIObject::TypeFramePolicyListener> {
 public:
-    static const Type APIType = TypeFramePolicyListener;
-
     static PassRefPtr<WebOpenPanelResultListenerProxy> create(WebPageProxy* page)
     {
         return adoptRef(new WebOpenPanelResultListenerProxy(page));
@@ -54,8 +52,6 @@ public:
 private:
     explicit WebOpenPanelResultListenerProxy(WebPageProxy*);
 
-    virtual Type type() const { return APIType; }
-
     RefPtr<WebPageProxy> m_page;
 };
 
index 176b9ee..f0fddf5 100644 (file)
@@ -38,10 +38,8 @@ namespace WebKit {
 class WebPreferences;
 class WebPageProxy;
 
-class WebPageGroup : public APIObject {
+class WebPageGroup : public TypedAPIObject<APIObject::TypePageGroup> {
 public:
-    static const Type APIType = TypePageGroup;
-
     static PassRefPtr<WebPageGroup> create(const String& identifier = String(), bool visibleToInjectedBundle = true, bool visibleToHistoryClient = true);
     static WebPageGroup* get(uint64_t pageGroupID);
 
@@ -68,8 +66,6 @@ public:
 private:
     WebPageGroup(const String& identifier, bool visibleToInjectedBundle, bool visibleToHistoryClient);
 
-    virtual Type type() const { return APIType; }
-    
     template<typename MessageType> void sendToAllProcessesInGroup(const MessageType&, uint64_t destinationID);
 
     WebPageGroupData m_data;
index 3b32eef..c800b9b 100644 (file)
@@ -229,14 +229,13 @@ private:
 };
 
 class WebPageProxy
-    : public APIObject
+    : public TypedAPIObject<APIObject::TypePage>
 #if ENABLE(INPUT_TYPE_COLOR)
     , public WebColorChooserProxy::Client
 #endif
     , public WebPopupMenuProxy::Client
     , public CoreIPC::MessageReceiver {
 public:
-    static const Type APIType = TypePage;
 
     static PassRefPtr<WebPageProxy> create(PageClient*, PassRefPtr<WebProcessProxy>, WebPageGroup*, uint64_t pageID);
     virtual ~WebPageProxy();
@@ -778,8 +777,6 @@ public:
 private:
     WebPageProxy(PageClient*, PassRefPtr<WebProcessProxy>, WebPageGroup*, uint64_t pageID);
 
-    virtual Type type() const { return APIType; }
-
     // CoreIPC::MessageReceiver
     virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE;
     virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&) OVERRIDE;
index bbc2380..aebafa5 100644 (file)
@@ -42,8 +42,7 @@ WebPreferences::WebPreferences(const String& identifier)
 }
 
 WebPreferences::WebPreferences(const WebPreferences& other)
-    : APIObject()
-    , m_store(other.m_store)
+    : m_store(other.m_store)
 {
     platformInitializeStore();
 }
index 50bc025..1a1cb55 100644 (file)
@@ -41,10 +41,8 @@ namespace WebKit {
 
 class WebPageGroup;
 
-class WebPreferences : public APIObject {
+class WebPreferences : public TypedAPIObject<APIObject::TypePreferences> {
 public:
-    static const Type APIType = TypePreferences;
-
     static PassRefPtr<WebPreferences> create()
     {
         return adoptRef(new WebPreferences);
@@ -84,8 +82,6 @@ private:
 
     void platformInitializeStore();
 
-    virtual Type type() const { return APIType; }
-
     void update();
 
     void updateStringValueForKey(const String& key, const String& value);
index b31fde2..3b5a3b2 100644 (file)
@@ -44,10 +44,8 @@ class WebSecurityOrigin;
 
 typedef GenericCallback<WKArrayRef> ArrayCallback;
 
-class WebResourceCacheManagerProxy : public APIObject, public WebContextSupplement, private CoreIPC::MessageReceiver {
+class WebResourceCacheManagerProxy : public TypedAPIObject<APIObject::TypeCacheManager>, public WebContextSupplement, private CoreIPC::MessageReceiver {
 public:
-    static const Type APIType = TypeCacheManager;
-
     static const char* supplementName();
 
     static PassRefPtr<WebResourceCacheManagerProxy> create(WebContext*);
@@ -63,8 +61,6 @@ public:
 private:
     explicit WebResourceCacheManagerProxy(WebContext*);
 
-    virtual Type type() const { return APIType; }
-
     // WebContextSupplement
     virtual void contextDestroyed() OVERRIDE;
     virtual void processDidClose(WebProcessProxy*) OVERRIDE;
index a1c574c..863ed03 100644 (file)
@@ -35,10 +35,8 @@ namespace WebKit {
 
 class WebPageProxy;
 
-class WebTextChecker : public APIObject {
+class WebTextChecker : public TypedAPIObject<APIObject::TypeTextChecker> {
 public:
-    static const Type APIType = TypeTextChecker;
-
     static WebTextChecker* shared();
 
     void setClient(const WKTextCheckerClient*);
@@ -53,8 +51,6 @@ public:
 private:
     WebTextChecker();
 
-    virtual Type type() const { return APIType; }
-
     WebTextCheckerClient m_client;
 };
 
index e849a4c..1f9c891 100644 (file)
@@ -37,10 +37,8 @@ namespace WebKit {
 
 class WebPageProxy;
 
-class WebVibrationProxy : public APIObject, private CoreIPC::MessageReceiver {
+class WebVibrationProxy : public TypedAPIObject<APIObject::TypeVibration>, private CoreIPC::MessageReceiver {
 public:
-    static const Type APIType = TypeVibration;
-
     static PassRefPtr<WebVibrationProxy> create(WebPageProxy*);
     virtual ~WebVibrationProxy();
 
@@ -51,8 +49,6 @@ public:
 private:
     explicit WebVibrationProxy(WebPageProxy*);
 
-    virtual Type type() const { return APIType; }
-
     // CoreIPC::MessageReceiver
     virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE;
 
index 1581ca5..c3245a4 100644 (file)
 
 namespace WebKit {
 
-class WebPopupItemEfl : public APIObject {
+class WebPopupItemEfl : public TypedAPIObject<APIObject::TypePopupMenuItem> {
 public:
-    static const Type APIType = TypePopupMenuItem;
-
     static PassRefPtr<WebPopupItemEfl> create(const WebPopupItem& data)
     {
         return adoptRef(new WebPopupItemEfl(data));
@@ -57,8 +55,6 @@ public:
 private:
     explicit WebPopupItemEfl(const WebPopupItem&);
 
-    virtual Type type() const { return APIType; }
-
     WebPopupItem m_data;
 };
 
index 0a82268..7816042 100644 (file)
@@ -46,10 +46,8 @@ class CoordinatedGraphicsScene;
 
 namespace WebKit {
 
-class WebView : public APIObject, public PageClient {
+class WebView : public TypedAPIObject<APIObject::TypeView>, public PageClient {
 public:
-    static const Type APIType = TypeView;
-
     virtual ~WebView();
 
     static PassRefPtr<WebView> create(WebContext*, WebPageGroup*);
@@ -177,8 +175,6 @@ private:
     void countStringMatchesInCustomRepresentation(const String&, FindOptions, unsigned) OVERRIDE;
 
 private:
-    virtual Type type() const { return APIType; }
-
     WebViewClient m_client;
     EwkView* m_ewkView;
     RefPtr<WebPageProxy> m_page;
index 5f4d178..7ec383d 100644 (file)
@@ -34,10 +34,8 @@ namespace WebKit {
 class WebContext;
 class WebData;
 
-class WebSoupRequestManagerProxy : public APIObject, public WebContextSupplement, private CoreIPC::MessageReceiver {
+class WebSoupRequestManagerProxy : public TypedAPIObject<APIObject::TypeSoupRequestManager>, public WebContextSupplement, private CoreIPC::MessageReceiver {
 public:
-    static const Type APIType = TypeSoupRequestManager;
-
     static const char* supplementName();
 
     static PassRefPtr<WebSoupRequestManagerProxy> create(WebContext*);
@@ -58,8 +56,6 @@ public:
 private:
     WebSoupRequestManagerProxy(WebContext*);
 
-    virtual Type type() const { return APIType; }
-
     // WebContextSupplement
     virtual void contextDestroyed() OVERRIDE;
     virtual void processDidClose(WebProcessProxy*) OVERRIDE;
index 8903106..c441975 100644 (file)
@@ -44,10 +44,8 @@ class InjectedBundleScriptWorld;
 class WebFrame;
 class WebImage;
 
-class InjectedBundleNodeHandle : public APIObject {
+class InjectedBundleNodeHandle : public TypedAPIObject<APIObject::TypeBundleNodeHandle> {
 public:
-    static const Type APIType = TypeBundleNodeHandle;
-
     static PassRefPtr<InjectedBundleNodeHandle> getOrCreate(JSContextRef, JSObjectRef);
     static PassRefPtr<InjectedBundleNodeHandle> getOrCreate(WebCore::Node*);
 
@@ -79,8 +77,6 @@ private:
     static PassRefPtr<InjectedBundleNodeHandle> create(WebCore::Node*);
     InjectedBundleNodeHandle(WebCore::Node*);
 
-    virtual Type type() const { return APIType; }
-
     RefPtr<WebCore::Node> m_node;
 };
 
index 4887971..fd281d0 100644 (file)
@@ -39,10 +39,8 @@ namespace WebKit {
 
 class InjectedBundleScriptWorld;
 
-class InjectedBundleRangeHandle : public APIObject {
+class InjectedBundleRangeHandle : public TypedAPIObject<APIObject::TypeBundleRangeHandle> {
 public:
-    static const Type APIType = TypeBundleRangeHandle;
-
     static PassRefPtr<InjectedBundleRangeHandle> getOrCreate(JSContextRef, JSObjectRef);
     static PassRefPtr<InjectedBundleRangeHandle> getOrCreate(WebCore::Range*);
 
@@ -54,8 +52,6 @@ private:
     static PassRefPtr<InjectedBundleRangeHandle> create(WebCore::Range*);
     InjectedBundleRangeHandle(WebCore::Range*);
 
-    virtual Type type() const { return APIType; }
-
     RefPtr<WebCore::Range> m_range;
 };
 
index 34926b3..37d41c2 100644 (file)
@@ -77,10 +77,8 @@ class WebFrame;
 class WebPage;
 class WebPageGroupProxy;
 
-class InjectedBundle : public APIObject {
+class InjectedBundle : public TypedAPIObject<APIObject::TypeBundle> {
 public:
-    static const Type APIType = TypeBundle;
-
     static PassRefPtr<InjectedBundle> create(const String& path)
     {
         return adoptRef(new InjectedBundle(path));
@@ -179,8 +177,6 @@ public:
 private:
     explicit InjectedBundle(const String&);
 
-    virtual Type type() const { return APIType; }
-
     String m_path;
     PlatformBundle m_platformBundle; // This is leaked right now, since we never unload the bundle/module.
 
index 952bdb6..a152ba6 100644 (file)
@@ -35,10 +35,8 @@ class WebPage;
 
 class InjectedBundleBackForwardListItem;
 
-class InjectedBundleBackForwardList : public APIObject {
+class InjectedBundleBackForwardList : public TypedAPIObject<APIObject::TypeBundleBackForwardList> {
 public:
-    static const Type APIType = TypeBundleBackForwardList;
-
     static PassRefPtr<InjectedBundleBackForwardList> create(WebPage* page)
     {
         return adoptRef(new InjectedBundleBackForwardList(page));
@@ -55,8 +53,6 @@ public:
 private:
     InjectedBundleBackForwardList(WebPage* page) : m_page(page) { }
 
-    virtual Type type() const { return APIType; }
-
     WebPage* m_page;
 };
 
index 677fbc8..b163c15 100644 (file)
@@ -34,10 +34,8 @@ namespace WebKit {
 class ImmutableArray;
 class WebPageProxy;
 
-class InjectedBundleBackForwardListItem : public APIObject {
+class InjectedBundleBackForwardListItem : public TypedAPIObject<APIObject::TypeBundleBackForwardListItem> {
 public:
-    static const Type APIType = TypeBundleBackForwardListItem;
-
     static PassRefPtr<InjectedBundleBackForwardListItem> create(PassRefPtr<WebCore::HistoryItem> item)
     {
         if (!item)
@@ -61,8 +59,6 @@ public:
 private:
     InjectedBundleBackForwardListItem(PassRefPtr<WebCore::HistoryItem> item) : m_item(item) { }
 
-    virtual Type type() const { return APIType; }
-
     RefPtr<WebCore::HistoryItem> m_item;
 };
 
index 6ff96fc..a664a14 100644 (file)
@@ -40,10 +40,8 @@ namespace WebKit {
 class InjectedBundleScriptWorld;
 class WebFrame;
 
-class InjectedBundleDOMWindowExtension : public APIObject {
+class InjectedBundleDOMWindowExtension : public TypedAPIObject<APIObject::TypeBundleDOMWindowExtension> {
 public:
-    static const Type APIType = TypeBundleDOMWindowExtension;
-
     static PassRefPtr<InjectedBundleDOMWindowExtension> create(WebFrame*, InjectedBundleScriptWorld*);
     static InjectedBundleDOMWindowExtension* get(WebCore::DOMWindowExtension*);
 
@@ -53,8 +51,6 @@ public:
     InjectedBundleScriptWorld* world() const;
 
 private:
-    virtual Type type() const { return APIType; }
-
     InjectedBundleDOMWindowExtension(WebFrame*, InjectedBundleScriptWorld*);
 
     RefPtr<WebCore::DOMWindowExtension> m_coreExtension;
index 292fce1..d290239 100644 (file)
@@ -37,10 +37,8 @@ namespace WebKit {
 class InjectedBundleNodeHandle;
 class WebFrame;
 
-class InjectedBundleHitTestResult : public APIObject {
+class InjectedBundleHitTestResult : public TypedAPIObject<APIObject::TypeBundleHitTestResult> {
 public:
-    static const Type APIType = TypeBundleHitTestResult;
-
     static PassRefPtr<InjectedBundleHitTestResult> create(const WebCore::HitTestResult&);
 
     const WebCore::HitTestResult& coreHitTestResult() const { return m_hitTestResult; }
@@ -67,8 +65,6 @@ private:
     {
     }
 
-    virtual Type type() const { return APIType; }
-
     WebCore::HitTestResult m_hitTestResult;
 };
 
index 128c9fb..f9436e7 100644 (file)
@@ -43,10 +43,8 @@ namespace WebKit {
 
 class WebFrame;
 
-class InjectedBundleNavigationAction : public APIObject {
+class InjectedBundleNavigationAction : public TypedAPIObject<APIObject::TypeBundleNavigationAction> {
 public:
-    static const Type APIType = TypeBundleNavigationAction;
-
     static PassRefPtr<InjectedBundleNavigationAction> create(WebFrame*, const WebCore::NavigationAction&, PassRefPtr<WebCore::FormState>);
 
     static WebEvent::Modifiers modifiersForNavigationAction(const WebCore::NavigationAction&);
@@ -61,8 +59,6 @@ public:
 private:
     InjectedBundleNavigationAction(WebFrame*, const WebCore::NavigationAction&, PassRefPtr<WebCore::FormState>);
 
-    virtual Type type() const { return APIType; }
-
     WebCore::NavigationType m_navigationType;
     WebEvent::Modifiers m_modifiers;
     WebMouseEvent::Button m_mouseButton;
index 7562a6f..acdc830 100644 (file)
@@ -36,10 +36,8 @@ namespace WebCore {
 
 namespace WebKit {
 
-class InjectedBundleScriptWorld : public APIObject {
+class InjectedBundleScriptWorld : public TypedAPIObject<APIObject::TypeBundleScriptWorld> {
 public:
-    static const Type APIType = TypeBundleScriptWorld;
-
     static PassRefPtr<InjectedBundleScriptWorld> create();
     static PassRefPtr<InjectedBundleScriptWorld> getOrCreate(WebCore::DOMWrapperWorld*);
     static InjectedBundleScriptWorld* normalWorld();
@@ -53,8 +51,6 @@ public:
 private:
     InjectedBundleScriptWorld(PassRefPtr<WebCore::DOMWrapperWorld>);
 
-    virtual Type type() const { return APIType; }
-
     RefPtr<WebCore::DOMWrapperWorld> m_world;
 };
 
index d6136de..0fa058a 100644 (file)
@@ -40,7 +40,7 @@ namespace WebKit {
 class WebMouseEvent;
 class WebPage;
 
-class PageOverlay : public APIObject {
+class PageOverlay : public TypedAPIObject<APIObject::TypeBundlePageOverlay> {
 public:
     class Client {
     protected:
@@ -54,8 +54,6 @@ public:
         virtual bool mouseEvent(PageOverlay*, const WebMouseEvent&) = 0;
     };
 
-    static const Type APIType = TypeBundlePageOverlay;
-
     static PassRefPtr<PageOverlay> create(Client*);
     virtual ~PageOverlay();
 
@@ -76,9 +74,6 @@ protected:
     explicit PageOverlay(Client*);
 
 private:
-    // APIObject
-    virtual Type type() const { return APIType; }
-
     WebCore::IntRect bounds() const;
 
     void startFadeAnimation();
index bff6fe1..93112a7 100644 (file)
@@ -55,10 +55,8 @@ class InjectedBundleRangeHandle;
 class InjectedBundleScriptWorld;
 class WebPage;
 
-class WebFrame : public APIObject {
+class WebFrame : public TypedAPIObject<APIObject::TypeBundleFrame> {
 public:
-    static const Type APIType = TypeBundleFrame;
-
     static PassRefPtr<WebFrame> createMainFrame(WebPage*);
     static PassRefPtr<WebFrame> createSubframe(WebPage*, const String& frameName, WebCore::HTMLFrameOwnerElement*);
     ~WebFrame();
@@ -147,8 +145,6 @@ private:
 
     void init(WebPage*, const String& frameName, WebCore::HTMLFrameOwnerElement*);
 
-    virtual Type type() const { return APIType; }
-
     WebCore::Frame* m_coreFrame;
 
     uint64_t m_policyListenerID;
index e3b6a61..038a613 100644 (file)
@@ -43,10 +43,8 @@ class WebInspectorFrontendClient;
 class WebPage;
 struct WebPageCreationParameters;
 
-class WebInspector : public APIObject {
+class WebInspector : public TypedAPIObject<APIObject::TypeBundleInspector> {
 public:
-    static const Type APIType = TypeBundleInspector;
-
     static PassRefPtr<WebInspector> create(WebPage*, WebCore::InspectorFrontendChannel*);
 
     WebPage* page() const { return m_page; }
@@ -87,8 +85,6 @@ private:
 
     explicit WebInspector(WebPage*, WebCore::InspectorFrontendChannel*);
 
-    virtual Type type() const { return APIType; }
-
     // Called from WebInspectorClient
     WebPage* createInspectorPage();
     void destroyInspectorPage();
index 5454ec7..3df0bf5 100644 (file)
@@ -166,10 +166,8 @@ class WebTouchEvent;
 
 typedef Vector<RefPtr<PageOverlay> > PageOverlayList;
 
-class WebPage : public APIObject, public CoreIPC::MessageReceiver, public CoreIPC::MessageSender<WebPage> {
+class WebPage : public TypedAPIObject<APIObject::TypeBundlePage>, public CoreIPC::MessageReceiver, public CoreIPC::MessageSender<WebPage> {
 public:
-    static const Type APIType = TypeBundlePage;
-
     static PassRefPtr<WebPage> create(uint64_t pageID, const WebPageCreationParameters&);
     virtual ~WebPage();
 
@@ -653,8 +651,6 @@ public:
 private:
     WebPage(uint64_t pageID, const WebPageCreationParameters&);
 
-    virtual Type type() const { return APIType; }
-
     void platformInitialize();
 
     void didReceiveWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&);
index 26a9199..005ee8d 100644 (file)
@@ -41,10 +41,8 @@ class PageGroup;
 
 namespace WebKit {
 
-class WebPageGroupProxy : public APIObject {
+class WebPageGroupProxy : public TypedAPIObject<APIObject::TypeBundlePageGroup> {
 public:
-    static const Type APIType = TypeBundlePageGroup;
-
     static PassRefPtr<WebPageGroupProxy> create(const WebPageGroupData&);
     virtual ~WebPageGroupProxy();
 
@@ -58,8 +56,6 @@ public:
 private:
     WebPageGroupProxy(const WebPageGroupData&);
 
-    virtual Type type() const { return APIType; }
-
     void addUserStyleSheet(const WebCore::UserStyleSheet&);
     void addUserScript(const WebCore::UserScript&);
     void removeAllUserStyleSheets();