[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

weinig at apple.com weinig at apple.com
Wed Dec 22 11:33:00 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 438853f8985a896f4d1d2b66b5c23cfc303ebf1c
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jul 29 01:41:14 2010 +0000

    Patch for https://bugs.webkit.org/show_bug.cgi?id=43163
    Add a CF-style base type (WKTypeRef) as a base for polymorphic functions.
    
    Reviewed by Darin Adler.
    
    - Add first polymorphic function, WKGetTypeID.
    - Add functions to each WK type to get their respective TypeIDs.
    - Adds WebURL to complement WebString.
    
    * Shared/APIObject.h:
    (WebKit::APIObject::):
    (WebKit::APIObject::~APIObject):
    * Shared/ImmutableArray.h:
    (WebKit::ImmutableArray::type):
    * Shared/WebString.h:
    (WebKit::WebString::type):
    * Shared/WebURL.h: Added.
    (WebKit::WebURL::create):
    (WebKit::WebURL::type):
    (WebKit::WebURL::isNull):
    (WebKit::WebURL::isEmpty):
    (WebKit::WebURL::string):
    (WebKit::WebURL::WebURL):
    * UIProcess/API/C/WKAPICast.h:
    (WebKit::ProxyingRefPtr::ProxyingRefPtr):
    (WebKit::ProxyingRefPtr::operator APIType):
    (toRef):
    (toURLRef):
    (toCopiedURLRef):
    * UIProcess/API/C/WKArray.cpp:
    (WKArrayGetTypeID):
    * UIProcess/API/C/WKArray.h:
    * UIProcess/API/C/WKBackForwardList.cpp:
    (WKBackForwardListGetTypeID):
    * UIProcess/API/C/WKBackForwardList.h:
    * UIProcess/API/C/WKBackForwardListItem.cpp:
    (WKBackForwardListItemGetTypeID):
    * UIProcess/API/C/WKBackForwardListItem.h:
    * UIProcess/API/C/WKBase.h:
    * UIProcess/API/C/WKContext.cpp:
    (WKContextGetTypeID):
    * UIProcess/API/C/WKContext.h:
    * UIProcess/API/C/WKFrame.cpp:
    (WKFrameGetTypeID):
    * UIProcess/API/C/WKFrame.h:
    * UIProcess/API/C/WKFramePolicyListener.cpp:
    (WKFramePolicyListenerGetTypeID):
    * UIProcess/API/C/WKFramePolicyListener.h:
    * UIProcess/API/C/WKNavigationData.cpp:
    (WKNavigationDataGetTypeID):
    * UIProcess/API/C/WKNavigationData.h:
    * UIProcess/API/C/WKPage.cpp:
    (WKPageGetTypeID):
    * UIProcess/API/C/WKPage.h:
    * UIProcess/API/C/WKPageNamespace.cpp:
    (WKPageNamespaceGetTypeID):
    * UIProcess/API/C/WKPageNamespace.h:
    * UIProcess/API/C/WKPreferences.cpp:
    (WKPreferencesGetTypeID):
    * UIProcess/API/C/WKPreferences.h:
    * UIProcess/API/C/WKString.cpp:
    (WKStringGetTypeID):
    * UIProcess/API/C/WKString.h:
    * UIProcess/API/C/WKType.cpp: Added.
    (WKGetTypeID):
    * UIProcess/API/C/WKType.h: Added.
    * UIProcess/API/C/WKURL.cpp:
    (WKURLGetTypeID):
    * UIProcess/API/C/WKURL.h:
    * UIProcess/API/win/WKView.cpp:
    (WKViewGetTypeID):
    * UIProcess/API/win/WKView.h:
    * UIProcess/WebBackForwardList.h:
    (WebKit::WebBackForwardList::type):
    * UIProcess/WebBackForwardListItem.h:
    (WebKit::WebBackForwardListItem::type):
    * UIProcess/WebContext.h:
    (WebKit::WebContext::type):
    * UIProcess/WebFramePolicyListenerProxy.h:
    (WebKit::WebFramePolicyListenerProxy::type):
    * UIProcess/WebFrameProxy.h:
    (WebKit::WebFrameProxy::type):
    * UIProcess/WebNavigationData.h:
    (WebKit::WebNavigationData::type):
    * UIProcess/WebPageNamespace.h:
    (WebKit::WebPageNamespace::type):
    * UIProcess/WebPageProxy.h:
    (WebKit::WebPageProxy::type):
    * UIProcess/WebPreferences.h:
    (WebKit::WebPreferences::type):
    * WebKit2.xcodeproj/project.pbxproj:
    * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
    (WKBundleGetTypeID):
    * WebProcess/InjectedBundle/API/c/WKBundle.h:
    * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
    (WKBundleFrameGetTypeID):
    * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
    * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
    (WKBundlePageGetTypeID):
    (WKBundlePageSetEditorClient):
    (WKBundlePageSetLoaderClient):
    (WKBundlePageSetUIClient):
    * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
    * WebProcess/WebPage/WebFrame.h:
    (WebKit::WebFrame::type):
    * WebProcess/WebPage/WebPage.h:
    (WebKit::WebPage::type):
    * win/WebKit2.vcproj:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64253 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 9ad16e0..6ceeb60 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,114 @@
+2010-07-28  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Patch for https://bugs.webkit.org/show_bug.cgi?id=43163
+        Add a CF-style base type (WKTypeRef) as a base for polymorphic functions.
+
+        - Add first polymorphic function, WKGetTypeID.
+        - Add functions to each WK type to get their respective TypeIDs.
+        - Adds WebURL to complement WebString.
+
+        * Shared/APIObject.h:
+        (WebKit::APIObject::):
+        (WebKit::APIObject::~APIObject):
+        * Shared/ImmutableArray.h:
+        (WebKit::ImmutableArray::type):
+        * Shared/WebString.h:
+        (WebKit::WebString::type):
+        * Shared/WebURL.h: Added.
+        (WebKit::WebURL::create):
+        (WebKit::WebURL::type):
+        (WebKit::WebURL::isNull):
+        (WebKit::WebURL::isEmpty):
+        (WebKit::WebURL::string):
+        (WebKit::WebURL::WebURL):
+        * UIProcess/API/C/WKAPICast.h:
+        (WebKit::ProxyingRefPtr::ProxyingRefPtr):
+        (WebKit::ProxyingRefPtr::operator APIType):
+        (toRef):
+        (toURLRef):
+        (toCopiedURLRef):
+        * UIProcess/API/C/WKArray.cpp:
+        (WKArrayGetTypeID):
+        * UIProcess/API/C/WKArray.h:
+        * UIProcess/API/C/WKBackForwardList.cpp:
+        (WKBackForwardListGetTypeID):
+        * UIProcess/API/C/WKBackForwardList.h:
+        * UIProcess/API/C/WKBackForwardListItem.cpp:
+        (WKBackForwardListItemGetTypeID):
+        * UIProcess/API/C/WKBackForwardListItem.h:
+        * UIProcess/API/C/WKBase.h:
+        * UIProcess/API/C/WKContext.cpp:
+        (WKContextGetTypeID):
+        * UIProcess/API/C/WKContext.h:
+        * UIProcess/API/C/WKFrame.cpp:
+        (WKFrameGetTypeID):
+        * UIProcess/API/C/WKFrame.h:
+        * UIProcess/API/C/WKFramePolicyListener.cpp:
+        (WKFramePolicyListenerGetTypeID):
+        * UIProcess/API/C/WKFramePolicyListener.h:
+        * UIProcess/API/C/WKNavigationData.cpp:
+        (WKNavigationDataGetTypeID):
+        * UIProcess/API/C/WKNavigationData.h:
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageGetTypeID):
+        * UIProcess/API/C/WKPage.h:
+        * UIProcess/API/C/WKPageNamespace.cpp:
+        (WKPageNamespaceGetTypeID):
+        * UIProcess/API/C/WKPageNamespace.h:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesGetTypeID):
+        * UIProcess/API/C/WKPreferences.h:
+        * UIProcess/API/C/WKString.cpp:
+        (WKStringGetTypeID):
+        * UIProcess/API/C/WKString.h:
+        * UIProcess/API/C/WKType.cpp: Added.
+        (WKGetTypeID):
+        * UIProcess/API/C/WKType.h: Added.
+        * UIProcess/API/C/WKURL.cpp:
+        (WKURLGetTypeID):
+        * UIProcess/API/C/WKURL.h:
+        * UIProcess/API/win/WKView.cpp:
+        (WKViewGetTypeID):
+        * UIProcess/API/win/WKView.h:
+        * UIProcess/WebBackForwardList.h:
+        (WebKit::WebBackForwardList::type):
+        * UIProcess/WebBackForwardListItem.h:
+        (WebKit::WebBackForwardListItem::type):
+        * UIProcess/WebContext.h:
+        (WebKit::WebContext::type):
+        * UIProcess/WebFramePolicyListenerProxy.h:
+        (WebKit::WebFramePolicyListenerProxy::type):
+        * UIProcess/WebFrameProxy.h:
+        (WebKit::WebFrameProxy::type):
+        * UIProcess/WebNavigationData.h:
+        (WebKit::WebNavigationData::type):
+        * UIProcess/WebPageNamespace.h:
+        (WebKit::WebPageNamespace::type):
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::type):
+        * UIProcess/WebPreferences.h:
+        (WebKit::WebPreferences::type):
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+        (WKBundleGetTypeID):
+        * WebProcess/InjectedBundle/API/c/WKBundle.h:
+        * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
+        (WKBundleFrameGetTypeID):
+        * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageGetTypeID):
+        (WKBundlePageSetEditorClient):
+        (WKBundlePageSetLoaderClient):
+        (WKBundlePageSetUIClient):
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+        * WebProcess/WebPage/WebFrame.h:
+        (WebKit::WebFrame::type):
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::type):
+        * win/WebKit2.vcproj:
+
 2010-07-28  Darin Adler  <darin at apple.com>
 
         Reviewed by Sam Weinig.
@@ -194,10 +305,10 @@
         Patch for https://bugs.webkit.org/show_bug.cgi?id=43097
         Make all objects in the WebKit2 API inherit from a single base class
 
-        - Adds an APIObject base class for all objects which can get vender through
+        - Adds an APIObject base class for all objects which one can get through
           the C API to inherit from.
         - Adds a WebString class which wraps WebCore::String for now. I am not too fond of
-          this solution, so we continue should iterate on it.
+          this solution, so we should continue to iterate on it.
         - This is a first step toward make a CF-style base type (eg. CFTypeRef) for the C-API.
 
         * Shared/APIObject.h: Added.
diff --git a/WebKit2/Shared/APIObject.h b/WebKit2/Shared/APIObject.h
index cb45b2d..3825c11 100644
--- a/WebKit2/Shared/APIObject.h
+++ b/WebKit2/Shared/APIObject.h
@@ -31,6 +31,39 @@
 namespace WebKit {
 
 class APIObject : public RefCounted<APIObject> {
+public:
+    enum Type {
+        // Base types
+        TypeArray,
+        TypeString,
+        TypeURL,
+        
+        // UIProcess types
+        TypeBackForwardList,
+        TypeBackForwardListItem,
+        TypeContext,
+        TypeFrame,
+        TypeFramePolicyListener,
+        TypeNavigationData,
+        TypePage,
+        TypePageNamespace,
+        TypePreferences,
+
+        // Bundle types
+        TypeBundle,
+        TypeBundleFrame,
+        TypeBundlePage,
+        
+        // Platform specific
+        TypeView
+    };
+
+    virtual ~APIObject()
+    {
+    }
+
+    virtual Type type() const = 0;
+
 protected:
     APIObject()
     {
diff --git a/WebKit2/Shared/ImmutableArray.h b/WebKit2/Shared/ImmutableArray.h
index 3382ec6..536e0ab 100644
--- a/WebKit2/Shared/ImmutableArray.h
+++ b/WebKit2/Shared/ImmutableArray.h
@@ -65,6 +65,8 @@ private:
     enum AdoptTag { Adopt };
     ImmutableArray(void** entries, size_t size, const ImmutableArrayCallbacks*, AdoptTag);
 
+    virtual Type type() const { return TypeArray; }
+
     void** m_entries;
     size_t m_size;
     ImmutableArrayCallbacks m_callbacks;
diff --git a/WebKit2/Shared/WebString.h b/WebKit2/Shared/WebString.h
index b6764b6..92ccd1d 100644
--- a/WebKit2/Shared/WebString.h
+++ b/WebKit2/Shared/WebString.h
@@ -52,6 +52,8 @@ private:
     {
     }
 
+    virtual Type type() const { return TypeString; }
+
     WebCore::String m_string;
 };
 
diff --git a/WebKit2/Shared/WebURL.h b/WebKit2/Shared/WebURL.h
new file mode 100644
index 0000000..08dd085
--- /dev/null
+++ b/WebKit2/Shared/WebURL.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebURL_h
+#define WebURL_h
+
+#include "APIObject.h"
+#include <WebCore/PlatformString.h>
+#include <wtf/PassRefPtr.h>
+
+namespace WebKit {
+
+// WebURL - An string array type suitable for vending to an API.
+
+class WebURL : public APIObject {
+public:
+    static PassRefPtr<WebURL> create(const WebCore::String& string)
+    {
+        return adoptRef(new WebURL(string));
+    }
+
+    bool isNull() const { return m_string.isNull(); }
+    bool isEmpty() const { return m_string.isEmpty(); }
+
+    const WebCore::String& string() const { return m_string; }
+
+private:
+    WebURL(const WebCore::String& string)
+        : m_string(string)
+    {
+    }
+
+    virtual Type type() const { return TypeURL; }
+
+    WebCore::String m_string;
+};
+
+} // namespace WebKit
+
+#endif // WebURL_h
diff --git a/WebKit2/UIProcess/API/C/WKAPICast.h b/WebKit2/UIProcess/API/C/WKAPICast.h
index dd591e0..d1e9e59 100644
--- a/WebKit2/UIProcess/API/C/WKAPICast.h
+++ b/WebKit2/UIProcess/API/C/WKAPICast.h
@@ -29,6 +29,7 @@
 #include "WKBase.h"
 #include "WKPage.h"
 #include "WebString.h"
+#include "WebURL.h"
 #include <WebCore/FrameLoaderTypes.h>
 
 #if defined(WIN32) || defined(_WIN32)
@@ -50,20 +51,22 @@ class WebPreferences;
 class WebString;
 
 template<typename APIType> struct APITypeInfo { };
+template<> struct APITypeInfo<WKTypeRef>                        { typedef APIObject* ImplType; };
 template<> struct APITypeInfo<WKFrameRef>                       { typedef WebFrameProxy* ImplType; };
 template<> struct APITypeInfo<WKPageRef>                        { typedef WebPageProxy* ImplType; };
 template<> struct APITypeInfo<WKContextRef>                     { typedef WebContext* ImplType; };
 template<> struct APITypeInfo<WKPageNamespaceRef>               { typedef WebPageNamespace* ImplType; };
 template<> struct APITypeInfo<WKFramePolicyListenerRef>         { typedef WebFramePolicyListenerProxy* ImplType; };
 template<> struct APITypeInfo<WKPreferencesRef>                 { typedef WebPreferences* ImplType; };
-template<> struct APITypeInfo<WKStringRef>                      { typedef WebKit::WebString* ImplType; };
-template<> struct APITypeInfo<WKURLRef>                         { typedef WebKit::WebString* ImplType; };
+template<> struct APITypeInfo<WKStringRef>                      { typedef WebString* ImplType; };
+template<> struct APITypeInfo<WKURLRef>                         { typedef WebURL* ImplType; };
 template<> struct APITypeInfo<WKNavigationDataRef>              { typedef WebNavigationData* ImplType; };
 template<> struct APITypeInfo<WKArrayRef>                       { typedef ImmutableArray* ImplType; };
 template<> struct APITypeInfo<WKBackForwardListItemRef>         { typedef WebBackForwardListItem* ImplType; };
 template<> struct APITypeInfo<WKBackForwardListRef>             { typedef WebBackForwardList* ImplType; };
 
 template<typename ImplType> struct ImplTypeInfo { };
+template<> struct ImplTypeInfo<APIObject*>                      { typedef WKTypeRef APIType; };
 template<> struct ImplTypeInfo<WebFrameProxy*>                  { typedef WKFrameRef APIType; };
 template<> struct ImplTypeInfo<WebPageProxy*>                   { typedef WKPageRef APIType; };
 template<> struct ImplTypeInfo<WebContext*>                     { typedef WKContextRef APIType; };
@@ -71,23 +74,24 @@ template<> struct ImplTypeInfo<WebPageNamespace*>               { typedef WKPage
 template<> struct ImplTypeInfo<WebFramePolicyListenerProxy*>    { typedef WKFramePolicyListenerRef APIType; };
 template<> struct ImplTypeInfo<WebPreferences*>                 { typedef WKPreferencesRef APIType; };
 template<> struct ImplTypeInfo<WebString*>                      { typedef WKStringRef APIType; };
+template<> struct ImplTypeInfo<WebURL*>                         { typedef WKURLRef APIType; };
 template<> struct ImplTypeInfo<WebNavigationData*>              { typedef WKNavigationDataRef APIType; };
 template<> struct ImplTypeInfo<ImmutableArray*>                 { typedef WKArrayRef APIType; };
 template<> struct ImplTypeInfo<WebBackForwardListItem*>         { typedef WKBackForwardListItemRef APIType; };
 template<> struct ImplTypeInfo<WebBackForwardList*>             { typedef WKBackForwardListRef APIType; };
 
-class WebStringAdaptor {
+template<typename ImplType, typename APIType = typename ImplTypeInfo<ImplType*>::APIType>
+class ProxyingRefPtr {
 public:
-    WebStringAdaptor(PassRefPtr<WebString> impl)
+    ProxyingRefPtr(PassRefPtr<ImplType> impl)
         : m_impl(impl)
     {
     }
 
-    operator WKStringRef() { return reinterpret_cast<WKStringRef>(m_impl.get()); }
-    operator WKURLRef() { return reinterpret_cast<WKURLRef>(m_impl.get()); }
+    operator APIType() { return reinterpret_cast<APIType>(m_impl.get()); }
 
 private:
-    RefPtr<WebString> m_impl;
+    RefPtr<ImplType> m_impl;
 };
 
 } // namespace WebKit
@@ -108,16 +112,16 @@ inline typename WebKit::ImplTypeInfo<T>::APIType toRef(T t)
 
 /* Special cases. */
 
-inline WebKit::WebStringAdaptor toRef(WebCore::StringImpl* string)
+inline WebKit::ProxyingRefPtr<WebKit::WebString> toRef(WebCore::StringImpl* string)
 {
     WebCore::StringImpl* impl = string ? string : WebCore::StringImpl::empty();
-    return WebKit::WebStringAdaptor(WebKit::WebString::create(WebCore::String(impl)));
+    return WebKit::ProxyingRefPtr<WebKit::WebString>(WebKit::WebString::create(WebCore::String(impl)));
 }
 
-inline WebKit::WebStringAdaptor toURLRef(WebCore::StringImpl* string)
+inline WebKit::ProxyingRefPtr<WebKit::WebURL> toURLRef(WebCore::StringImpl* string)
 {
     WebCore::StringImpl* impl = string ? string : WebCore::StringImpl::empty();
-    return WebKit::WebStringAdaptor(WebKit::WebString::create(WebCore::String(impl)))   ;
+    return WebKit::ProxyingRefPtr<WebKit::WebURL>(WebKit::WebURL::create(WebCore::String(impl)))   ;
 }
 
 inline WKStringRef toCopiedRef(const WebCore::String& string)
@@ -130,8 +134,13 @@ inline WKStringRef toCopiedRef(const WebCore::String& string)
 inline WKURLRef toCopiedURLRef(const WebCore::String& string)
 {
     WebCore::StringImpl* impl = string.impl() ? string.impl() : WebCore::StringImpl::empty();
-    RefPtr<WebKit::WebString> webString = WebKit::WebString::create(WebCore::String(impl));
-    return reinterpret_cast<WKURLRef>(webString.release().releaseRef());
+    RefPtr<WebKit::WebURL> webURL = WebKit::WebURL::create(WebCore::String(impl));
+    return reinterpret_cast<WKURLRef>(webURL.release().releaseRef());
+}
+
+inline WKTypeID toRef(WebKit::APIObject::Type type)
+{
+    return static_cast<WKTypeID>(type);
 }
 
 inline WKFrameNavigationType toWK(WebCore::NavigationType type)
diff --git a/WebKit2/UIProcess/API/C/WKArray.cpp b/WebKit2/UIProcess/API/C/WKArray.cpp
index 25b07a9..59be076 100644
--- a/WebKit2/UIProcess/API/C/WKArray.cpp
+++ b/WebKit2/UIProcess/API/C/WKArray.cpp
@@ -30,6 +30,11 @@
 
 using namespace WebKit;
 
+WKTypeID WKArrayGetTypeID()
+{
+    return toRef(APIObject::TypeArray);
+}
+
 const void* WKArrayGetItemAtIndex(WKArrayRef arrayRef, size_t index)
 {
     return toWK(arrayRef)->at(index);
diff --git a/WebKit2/UIProcess/API/C/WKArray.h b/WebKit2/UIProcess/API/C/WKArray.h
index 6dc2e1b..3bb0002 100644
--- a/WebKit2/UIProcess/API/C/WKArray.h
+++ b/WebKit2/UIProcess/API/C/WKArray.h
@@ -32,6 +32,8 @@
 extern "C" {
 #endif
 
+WK_EXPORT WKTypeID WKArrayGetTypeID();
+
 WK_EXPORT const void* WKArrayGetItemAtIndex(WKArrayRef array, size_t index);
 WK_EXPORT size_t WKArrayGetSize(WKArrayRef array);
 
diff --git a/WebKit2/UIProcess/API/C/WKBackForwardList.cpp b/WebKit2/UIProcess/API/C/WKBackForwardList.cpp
index 8ffc3cc..9bcb6c1 100644
--- a/WebKit2/UIProcess/API/C/WKBackForwardList.cpp
+++ b/WebKit2/UIProcess/API/C/WKBackForwardList.cpp
@@ -30,6 +30,11 @@
 
 using namespace WebKit;
 
+WKTypeID WKBackForwardListGetTypeID()
+{
+    return toRef(APIObject::TypeBackForwardList);
+}
+
 WKBackForwardListItemRef WKBackForwardListGetCurrentItem(WKBackForwardListRef listRef)
 {
     return toRef(toWK(listRef)->currentItem());
diff --git a/WebKit2/UIProcess/API/C/WKBackForwardList.h b/WebKit2/UIProcess/API/C/WKBackForwardList.h
index 55f75fa..45a4153 100644
--- a/WebKit2/UIProcess/API/C/WKBackForwardList.h
+++ b/WebKit2/UIProcess/API/C/WKBackForwardList.h
@@ -32,6 +32,8 @@
 extern "C" {
 #endif
 
+WK_EXPORT WKTypeID WKBackForwardListGetTypeID();
+
 WK_EXPORT WKBackForwardListItemRef WKBackForwardListGetCurrentItem(WKBackForwardListRef list);
 WK_EXPORT WKBackForwardListItemRef WKBackForwardListGetBackItem(WKBackForwardListRef list);
 WK_EXPORT WKBackForwardListItemRef WKBackForwardListGetForwardItem(WKBackForwardListRef list);
diff --git a/WebKit2/UIProcess/API/C/WKBackForwardListItem.cpp b/WebKit2/UIProcess/API/C/WKBackForwardListItem.cpp
index 0c28fa1..62e3a41 100644
--- a/WebKit2/UIProcess/API/C/WKBackForwardListItem.cpp
+++ b/WebKit2/UIProcess/API/C/WKBackForwardListItem.cpp
@@ -30,6 +30,11 @@
 
 using namespace WebKit;
 
+WKTypeID WKBackForwardListItemGetTypeID()
+{
+    return toRef(APIObject::TypeBackForwardListItem);
+}
+
 WKURLRef WKBackForwardListItemCopyOriginalURL(WKBackForwardListItemRef itemRef)
 {
     return toCopiedURLRef(toWK(itemRef)->originalURL());
diff --git a/WebKit2/UIProcess/API/C/WKBackForwardListItem.h b/WebKit2/UIProcess/API/C/WKBackForwardListItem.h
index 8f8e263..c37b889 100644
--- a/WebKit2/UIProcess/API/C/WKBackForwardListItem.h
+++ b/WebKit2/UIProcess/API/C/WKBackForwardListItem.h
@@ -32,6 +32,8 @@
 extern "C" {
 #endif
 
+WK_EXPORT WKTypeID WKBackForwardListItemGetTypeID();
+
 WK_EXPORT WKURLRef WKBackForwardListItemCopyOriginalURL(WKBackForwardListItemRef item);
 WK_EXPORT WKURLRef WKBackForwardListItemCopyURL(WKBackForwardListItemRef item);
 WK_EXPORT WKStringRef WKBackForwardListItemCopyTitle(WKBackForwardListItemRef item);
diff --git a/WebKit2/UIProcess/API/C/WKBase.h b/WebKit2/UIProcess/API/C/WKBase.h
index 4cc3699..deb7f1d 100644
--- a/WebKit2/UIProcess/API/C/WKBase.h
+++ b/WebKit2/UIProcess/API/C/WKBase.h
@@ -30,6 +30,9 @@
 #include <WebKit2/WKBaseWin.h>
 #endif
 
+typedef uint32_t WKTypeID;
+
+typedef struct OpaqueWKTypeRef* WKTypeRef;
 typedef struct OpaqueWKArrayRef* WKArrayRef;
 typedef struct OpaqueWKBackForwardListItemRef* WKBackForwardListItemRef;
 typedef struct OpaqueWKBackForwardListRef* WKBackForwardListRef;
diff --git a/WebKit2/UIProcess/API/C/WKContext.cpp b/WebKit2/UIProcess/API/C/WKContext.cpp
index 9f1a3bb..7d63781 100644
--- a/WebKit2/UIProcess/API/C/WKContext.cpp
+++ b/WebKit2/UIProcess/API/C/WKContext.cpp
@@ -35,6 +35,11 @@
 
 using namespace WebKit;
 
+WKTypeID WKContextGetTypeID()
+{
+    return toRef(APIObject::TypeContext);
+}
+
 WKContextRef WKContextCreate()
 {
     RefPtr<WebContext> context = WebContext::create(WebCore::String());
diff --git a/WebKit2/UIProcess/API/C/WKContext.h b/WebKit2/UIProcess/API/C/WKContext.h
index ff90d20..1dccb2e 100644
--- a/WebKit2/UIProcess/API/C/WKContext.h
+++ b/WebKit2/UIProcess/API/C/WKContext.h
@@ -32,7 +32,7 @@
 extern "C" {
 #endif
 
-// Policy Client.
+// Injected Bundle Client
 typedef void (*WKContextDidReceiveMessageFromInjectedBundleCallback)(WKContextRef page, WKStringRef message, const void *clientInfo);
 
 struct WKContextInjectedBundleClient {
@@ -60,6 +60,8 @@ struct WKContextHistoryClient {
 };
 typedef struct WKContextHistoryClient WKContextHistoryClient;
 
+WK_EXPORT WKTypeID WKContextGetTypeID();
+
 WK_EXPORT WKContextRef WKContextCreate();
 WK_EXPORT WKContextRef WKContextCreateWithInjectedBundlePath(WKStringRef path);
 WK_EXPORT WKContextRef WKContextGetSharedProcessContext();
diff --git a/WebKit2/UIProcess/API/C/WKFrame.cpp b/WebKit2/UIProcess/API/C/WKFrame.cpp
index 1fc92fa..8f83d6a 100644
--- a/WebKit2/UIProcess/API/C/WKFrame.cpp
+++ b/WebKit2/UIProcess/API/C/WKFrame.cpp
@@ -30,6 +30,11 @@
 
 using namespace WebKit;
 
+WKTypeID WKFrameGetTypeID()
+{
+    return toRef(APIObject::TypeFrame);
+}
+
 bool WKFrameIsMainFrame(WKFrameRef frameRef)
 {
     return toWK(frameRef)->isMainFrame();
diff --git a/WebKit2/UIProcess/API/C/WKFrame.h b/WebKit2/UIProcess/API/C/WKFrame.h
index 8c9df16..3da22ca 100644
--- a/WebKit2/UIProcess/API/C/WKFrame.h
+++ b/WebKit2/UIProcess/API/C/WKFrame.h
@@ -43,6 +43,8 @@ enum WKFrameLoadState {
 };
 typedef enum WKFrameLoadState WKFrameLoadState;
 
+WK_EXPORT WKTypeID WKFrameGetTypeID();
+ 
 WK_EXPORT bool WKFrameIsMainFrame(WKFrameRef frame);
 WK_EXPORT WKFrameLoadState WKFrameGetFrameLoadState(WKFrameRef frame);
 WK_EXPORT WKURLRef WKFrameCopyProvisionalURL(WKFrameRef frame);
diff --git a/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp b/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp
index d82277e..3630fb4 100644
--- a/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp
+++ b/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp
@@ -31,6 +31,11 @@
 
 using namespace WebKit;
 
+WKTypeID WKFramePolicyListenerGetTypeID()
+{
+    return toRef(APIObject::TypeFramePolicyListener);
+}
+
 void WKFramePolicyListenerUse(WKFramePolicyListenerRef policyListenerRef)
 {
     toWK(policyListenerRef)->use();
diff --git a/WebKit2/UIProcess/API/C/WKFramePolicyListener.h b/WebKit2/UIProcess/API/C/WKFramePolicyListener.h
index 4f5b836..32295c6 100644
--- a/WebKit2/UIProcess/API/C/WKFramePolicyListener.h
+++ b/WebKit2/UIProcess/API/C/WKFramePolicyListener.h
@@ -32,6 +32,8 @@
 extern "C" {
 #endif
 
+WK_EXPORT WKTypeID WKFramePolicyListenerGetTypeID();
+
 WK_EXPORT void WKFramePolicyListenerUse(WKFramePolicyListenerRef policyListener);
 WK_EXPORT void WKFramePolicyListenerDownload(WKFramePolicyListenerRef policyListener);
 WK_EXPORT void WKFramePolicyListenerIgnore(WKFramePolicyListenerRef policyListener);
diff --git a/WebKit2/UIProcess/API/C/WKNavigationData.cpp b/WebKit2/UIProcess/API/C/WKNavigationData.cpp
index 0671955..c16c119 100644
--- a/WebKit2/UIProcess/API/C/WKNavigationData.cpp
+++ b/WebKit2/UIProcess/API/C/WKNavigationData.cpp
@@ -30,6 +30,11 @@
 
 using namespace WebKit;
 
+WKTypeID WKNavigationDataGetTypeID()
+{
+    return toRef(APIObject::TypeNavigationData);
+}
+
 WKStringRef WKNavigationDataCopyTitle(WKNavigationDataRef navigationDataRef)
 {
     return toCopiedRef(toWK(navigationDataRef)->title());
diff --git a/WebKit2/UIProcess/API/C/WKNavigationData.h b/WebKit2/UIProcess/API/C/WKNavigationData.h
index 46be875..b35a260 100644
--- a/WebKit2/UIProcess/API/C/WKNavigationData.h
+++ b/WebKit2/UIProcess/API/C/WKNavigationData.h
@@ -32,6 +32,8 @@
 extern "C" {
 #endif
 
+WK_EXPORT WKTypeID WKNavigationDataGetTypeID();
+
 WK_EXPORT WKStringRef WKNavigationDataCopyTitle(WKNavigationDataRef navigationData);
 WK_EXPORT WKURLRef WKNavigationDataCopyURL(WKNavigationDataRef navigationData);
 
diff --git a/WebKit2/UIProcess/API/C/WKPage.cpp b/WebKit2/UIProcess/API/C/WKPage.cpp
index 82ec002..d8e2d5c 100644
--- a/WebKit2/UIProcess/API/C/WKPage.cpp
+++ b/WebKit2/UIProcess/API/C/WKPage.cpp
@@ -36,6 +36,11 @@
 
 using namespace WebKit;
 
+WKTypeID WKPageGetTypeID()
+{
+    return toRef(APIObject::TypePage);
+}
+
 WKPageNamespaceRef WKPageGetPageNamespace(WKPageRef pageRef)
 {
     return toRef(toWK(pageRef)->pageNamespace());
diff --git a/WebKit2/UIProcess/API/C/WKPage.h b/WebKit2/UIProcess/API/C/WKPage.h
index 4e047c6..dd4d381 100644
--- a/WebKit2/UIProcess/API/C/WKPage.h
+++ b/WebKit2/UIProcess/API/C/WKPage.h
@@ -133,6 +133,8 @@ struct WKPageUIClient {
 };
 typedef struct WKPageUIClient WKPageUIClient;
 
+WK_EXPORT WKTypeID WKPageGetTypeID();
+
 WK_EXPORT WKPageNamespaceRef WKPageGetPageNamespace(WKPageRef page);
 
 WK_EXPORT void WKPageLoadURL(WKPageRef page, WKURLRef url);
diff --git a/WebKit2/UIProcess/API/C/WKPageNamespace.cpp b/WebKit2/UIProcess/API/C/WKPageNamespace.cpp
index bf43471..008e66d 100644
--- a/WebKit2/UIProcess/API/C/WKPageNamespace.cpp
+++ b/WebKit2/UIProcess/API/C/WKPageNamespace.cpp
@@ -32,6 +32,11 @@
 
 using namespace WebKit;
 
+WKTypeID WKPageNamespaceGetTypeID()
+{
+    return toRef(APIObject::TypePageNamespace);
+}
+
 WKPageNamespaceRef WKPageNamespaceCreate(WKContextRef ownerContextRef)
 {
     return toRef(toWK(ownerContextRef)->createPageNamespace());
diff --git a/WebKit2/UIProcess/API/C/WKPageNamespace.h b/WebKit2/UIProcess/API/C/WKPageNamespace.h
index 65ef4c2..f83f7dd 100644
--- a/WebKit2/UIProcess/API/C/WKPageNamespace.h
+++ b/WebKit2/UIProcess/API/C/WKPageNamespace.h
@@ -32,6 +32,8 @@
 extern "C" {
 #endif
 
+WK_EXPORT WKTypeID WKPageNamespaceGetTypeID();
+
 WK_EXPORT WKPageNamespaceRef WKPageNamespaceCreate(WKContextRef ownerContext);
 
 WK_EXPORT WKContextRef WKPageNamespaceGetContext(WKPageNamespaceRef pageNamespace);
diff --git a/WebKit2/UIProcess/API/C/WKPreferences.cpp b/WebKit2/UIProcess/API/C/WKPreferences.cpp
index dcffe00..1f6e6be 100644
--- a/WebKit2/UIProcess/API/C/WKPreferences.cpp
+++ b/WebKit2/UIProcess/API/C/WKPreferences.cpp
@@ -32,6 +32,11 @@
 
 using namespace WebKit;
 
+WKTypeID WKPreferencesGetTypeID()
+{
+    return toRef(APIObject::TypePreferences);
+}
+
 WKPreferencesRef WKPreferencesCreate()
 {
     RefPtr<WebPreferences> preferences = WebPreferences::create();
diff --git a/WebKit2/UIProcess/API/C/WKPreferences.h b/WebKit2/UIProcess/API/C/WKPreferences.h
index c8fa1cf..fbde917 100644
--- a/WebKit2/UIProcess/API/C/WKPreferences.h
+++ b/WebKit2/UIProcess/API/C/WKPreferences.h
@@ -36,6 +36,8 @@
 extern "C" {
 #endif
 
+WK_EXPORT WKTypeID WKPreferencesGetTypeID();
+
 WK_EXPORT WKPreferencesRef WKPreferencesCreate();
 WK_EXPORT WKPreferencesRef WKPreferencesCreateCopy(WKPreferencesRef);
 
diff --git a/WebKit2/UIProcess/API/C/WKString.cpp b/WebKit2/UIProcess/API/C/WKString.cpp
index cc53d36..21bd4b7 100644
--- a/WebKit2/UIProcess/API/C/WKString.cpp
+++ b/WebKit2/UIProcess/API/C/WKString.cpp
@@ -27,6 +27,13 @@
 
 #include "WKAPICast.h"
 
+using namespace WebKit;
+
+WKTypeID WKStringGetTypeID()
+{
+    return toRef(APIObject::TypeString);
+}
+
 WKStringRef WKStringRetain(WKStringRef stringRef)
 {
     toWK(stringRef)->ref();
diff --git a/WebKit2/UIProcess/API/C/WKString.h b/WebKit2/UIProcess/API/C/WKString.h
index 89511bc..dab854f 100644
--- a/WebKit2/UIProcess/API/C/WKString.h
+++ b/WebKit2/UIProcess/API/C/WKString.h
@@ -36,6 +36,8 @@
 extern "C" {
 #endif
 
+WK_EXPORT WKTypeID WKStringGetTypeID();
+
 WK_EXPORT WKStringRef WKStringRetain(WKStringRef string);
 WK_EXPORT void WKStringRelease(WKStringRef string);
 
diff --git a/WebKit2/UIProcess/API/C/WKType.cpp b/WebKit2/UIProcess/API/C/WKType.cpp
new file mode 100644
index 0000000..919fa3f
--- /dev/null
+++ b/WebKit2/UIProcess/API/C/WKType.cpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "WKType.h"
+
+#include "APIObject.h"
+#include "WKAPICast.h"
+
+using namespace WebKit;
+
+WKTypeID WKGetTypeID(WKTypeRef typeRef)
+{
+    return toRef(toWK(typeRef)->type());
+}
diff --git a/WebKit2/UIProcess/API/C/WKType.h b/WebKit2/UIProcess/API/C/WKType.h
new file mode 100644
index 0000000..c012f05
--- /dev/null
+++ b/WebKit2/UIProcess/API/C/WKType.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKType_h
+#define WKType_h
+
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKGetTypeID(WKTypeRef type);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKType_h */
diff --git a/WebKit2/UIProcess/API/C/WKURL.cpp b/WebKit2/UIProcess/API/C/WKURL.cpp
index bb4b47d..5ca44cc 100644
--- a/WebKit2/UIProcess/API/C/WKURL.cpp
+++ b/WebKit2/UIProcess/API/C/WKURL.cpp
@@ -27,6 +27,13 @@
 
 #include "WKAPICast.h"
 
+using namespace WebKit;
+
+WKTypeID WKURLGetTypeID()
+{
+    return toRef(APIObject::TypeURL);
+}
+
 WKURLRef WKURLRetain(WKURLRef URLRef)
 {
     toWK(URLRef)->ref();
diff --git a/WebKit2/UIProcess/API/C/WKURL.h b/WebKit2/UIProcess/API/C/WKURL.h
index d2190aa..b759a66 100644
--- a/WebKit2/UIProcess/API/C/WKURL.h
+++ b/WebKit2/UIProcess/API/C/WKURL.h
@@ -32,6 +32,8 @@
 extern "C" {
 #endif
 
+WK_EXPORT WKTypeID WKURLGetTypeID();
+
 WK_EXPORT WKURLRef WKURLRetain(WKURLRef URL);
 WK_EXPORT void WKURLRelease(WKURLRef URL);
 
diff --git a/WebKit2/UIProcess/API/win/WKView.cpp b/WebKit2/UIProcess/API/win/WKView.cpp
index a974aa7..ed48eac 100644
--- a/WebKit2/UIProcess/API/win/WKView.cpp
+++ b/WebKit2/UIProcess/API/win/WKView.cpp
@@ -30,6 +30,11 @@
 
 using namespace WebKit;
 
+WKTypeID WKViewGetTypeID()
+{
+    return toRef(APIObject::TypeView);
+}
+
 WKViewRef WKViewCreate(RECT rect, WKPageNamespaceRef pageNamespaceRef, HWND hostWindow)
 {
     RefPtr<WebView> view = WebView::create(rect, toWK(pageNamespaceRef), hostWindow);
diff --git a/WebKit2/UIProcess/API/win/WKView.h b/WebKit2/UIProcess/API/win/WKView.h
index d539c55..2465c32 100644
--- a/WebKit2/UIProcess/API/win/WKView.h
+++ b/WebKit2/UIProcess/API/win/WKView.h
@@ -33,6 +33,8 @@
 extern "C" {
 #endif
 
+WK_EXPORT WKTypeID WKViewGetTypeID();
+
 WK_EXPORT WKViewRef WKViewCreate(RECT rect, WKPageNamespaceRef pageNamespace, HWND hostWindow);
 
 WK_EXPORT HWND WKViewGetWindow(WKViewRef view);
diff --git a/WebKit2/UIProcess/WebBackForwardList.h b/WebKit2/UIProcess/WebBackForwardList.h
index 6530410..b74e877 100644
--- a/WebKit2/UIProcess/WebBackForwardList.h
+++ b/WebKit2/UIProcess/WebBackForwardList.h
@@ -73,6 +73,8 @@ public:
 private:
     WebBackForwardList(WebPageProxy*);
 
+    virtual Type type() const { return TypeBackForwardList; }
+
     WebPageProxy* m_page;
     BackForwardListItemVector m_entries;
     unsigned m_current;
diff --git a/WebKit2/UIProcess/WebBackForwardListItem.h b/WebKit2/UIProcess/WebBackForwardListItem.h
index 5d422a4..1d59f45 100644
--- a/WebKit2/UIProcess/WebBackForwardListItem.h
+++ b/WebKit2/UIProcess/WebBackForwardListItem.h
@@ -56,6 +56,8 @@ public:
 private:
     WebBackForwardListItem(const WebCore::String& originalURL, const WebCore::String& url, const WebCore::String& title, uint64_t itemID);
 
+    virtual Type type() const { return TypeBackForwardListItem; }
+
     WebCore::String m_originalURL;
     WebCore::String m_url;
     WebCore::String m_title;
diff --git a/WebKit2/UIProcess/WebContext.h b/WebKit2/UIProcess/WebContext.h
index 72a5595..19080e3 100644
--- a/WebKit2/UIProcess/WebContext.h
+++ b/WebKit2/UIProcess/WebContext.h
@@ -99,6 +99,8 @@ public:
 private:
     WebContext(ProcessModel, const WebCore::String& injectedBundlePath);
 
+    virtual Type type() const { return TypeContext; }
+
     void ensureWebProcess();
     bool hasValidProcess() const { return m_process && m_process->isValid(); }
 
diff --git a/WebKit2/UIProcess/WebFramePolicyListenerProxy.h b/WebKit2/UIProcess/WebFramePolicyListenerProxy.h
index 9419d75..341af2e 100644
--- a/WebKit2/UIProcess/WebFramePolicyListenerProxy.h
+++ b/WebKit2/UIProcess/WebFramePolicyListenerProxy.h
@@ -54,6 +54,8 @@ public:
 private:
     WebFramePolicyListenerProxy(WebFrameProxy*, uint64_t listenerID);
 
+    virtual Type type() const { return TypeFramePolicyListener; }
+
     void receivedPolicyDecision(WebCore::PolicyAction);
 
     RefPtr<WebFrameProxy> m_frame;
diff --git a/WebKit2/UIProcess/WebFrameProxy.h b/WebKit2/UIProcess/WebFrameProxy.h
index d0b5bf1..5e8fd32 100644
--- a/WebKit2/UIProcess/WebFrameProxy.h
+++ b/WebKit2/UIProcess/WebFrameProxy.h
@@ -82,6 +82,8 @@ public:
 private:
     WebFrameProxy(WebPageProxy* page, uint64_t frameID);
 
+    virtual Type type() const { return TypeFrame; }
+
     WebPageProxy* m_page;
     LoadState m_loadState;
     WebCore::String m_url;
diff --git a/WebKit2/UIProcess/WebNavigationData.h b/WebKit2/UIProcess/WebNavigationData.h
index a425ba6..86e1642 100644
--- a/WebKit2/UIProcess/WebNavigationData.h
+++ b/WebKit2/UIProcess/WebNavigationData.h
@@ -46,6 +46,8 @@ public:
 private:
     WebNavigationData(const WebNavigationDataStore&);
 
+    virtual Type type() const { return TypeNavigationData; }
+
     WebNavigationDataStore m_store;
 };
 
diff --git a/WebKit2/UIProcess/WebPageNamespace.h b/WebKit2/UIProcess/WebPageNamespace.h
index 6cba399..27cf715 100644
--- a/WebKit2/UIProcess/WebPageNamespace.h
+++ b/WebKit2/UIProcess/WebPageNamespace.h
@@ -59,6 +59,8 @@ public:
 private:
     WebPageNamespace(WebContext*);
 
+    virtual Type type() const { return TypePageNamespace; }
+
     RefPtr<WebContext> m_context;
 };
 
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index a428d12..393cb82 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -162,6 +162,8 @@ public:
 private:
     WebPageProxy(WebPageNamespace*, uint64_t pageID);
 
+    virtual Type type() const { return TypePage; }
+
     void didCreateMainFrame(uint64_t frameID);
     void didCreateSubFrame(uint64_t frameID);
 
diff --git a/WebKit2/UIProcess/WebPreferences.h b/WebKit2/UIProcess/WebPreferences.h
index 1ce5b14..fda8ddf 100644
--- a/WebKit2/UIProcess/WebPreferences.h
+++ b/WebKit2/UIProcess/WebPreferences.h
@@ -71,6 +71,8 @@ private:
     WebPreferences();
     WebPreferences(WebPreferences*);
 
+    virtual Type type() const { return TypePreferences; }
+
     void update();
 
     HashSet<WebContext*> m_contexts;
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index d715ad7..5ba4533 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -244,6 +244,9 @@
 		BCD59800112B57BE00EC8C23 /* WebPreferences.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD597FE112B57BE00EC8C23 /* WebPreferences.cpp */; };
 		BCD598AC112B7FDF00EC8C23 /* WebPreferencesStore.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD598AA112B7FDF00EC8C23 /* WebPreferencesStore.h */; };
 		BCD598AD112B7FDF00EC8C23 /* WebPreferencesStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD598AB112B7FDF00EC8C23 /* WebPreferencesStore.cpp */; };
+		BCDB85821200EC57007254BE /* WKType.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDB85801200EC57007254BE /* WKType.h */; };
+		BCDB85831200EC57007254BE /* WKType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDB85811200EC57007254BE /* WKType.cpp */; };
+		BCDB86C11200FB97007254BE /* WebURL.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDB86C01200FB97007254BE /* WebURL.h */; };
 		BCDE059B11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDE059911CDA8AE00E41AF1 /* WebContextInjectedBundleClient.h */; };
 		BCDE059C11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDE059A11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp */; };
 		BCEE966C112FAF57006BCC24 /* Attachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEE966A112FAF57006BCC24 /* Attachment.cpp */; };
@@ -537,6 +540,9 @@
 		BCD597FE112B57BE00EC8C23 /* WebPreferences.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPreferences.cpp; sourceTree = "<group>"; };
 		BCD598AA112B7FDF00EC8C23 /* WebPreferencesStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPreferencesStore.h; sourceTree = "<group>"; };
 		BCD598AB112B7FDF00EC8C23 /* WebPreferencesStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPreferencesStore.cpp; sourceTree = "<group>"; };
+		BCDB85801200EC57007254BE /* WKType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKType.h; sourceTree = "<group>"; };
+		BCDB85811200EC57007254BE /* WKType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKType.cpp; sourceTree = "<group>"; };
+		BCDB86C01200FB97007254BE /* WebURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebURL.h; sourceTree = "<group>"; };
 		BCDE059911CDA8AE00E41AF1 /* WebContextInjectedBundleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextInjectedBundleClient.h; sourceTree = "<group>"; };
 		BCDE059A11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextInjectedBundleClient.cpp; sourceTree = "<group>"; };
 		BCEE966A112FAF57006BCC24 /* Attachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Attachment.cpp; sourceTree = "<group>"; };
@@ -749,6 +755,7 @@
 				BC111B5A112F628200337BAB /* mac */,
 				BCF04C8C11FF9B7D00F86A58 /* APIObject.h */,
 				BCF04C8E11FF9F6E00F86A58 /* WebString.h */,
+				BCDB86C01200FB97007254BE /* WebURL.h */,
 				1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */,
 				BC64696D11DBE603006455B0 /* ImmutableArray.cpp */,
 				BC64696E11DBE603006455B0 /* ImmutableArray.h */,
@@ -968,6 +975,8 @@
 				BCD597CE112B56AC00EC8C23 /* WKPreferences.h */,
 				BC20EBAF116EEB0800094A50 /* WKString.cpp */,
 				BC20EBAE116EEB0800094A50 /* WKString.h */,
+				BCDB85811200EC57007254BE /* WKType.cpp */,
+				BCDB85801200EC57007254BE /* WKType.h */,
 				BC20EBB3116EEF7A00094A50 /* WKURL.cpp */,
 				BC20EBB2116EEF7A00094A50 /* WKURL.h */,
 			);
@@ -1306,6 +1315,8 @@
 				1AE4976811FF658E0048B464 /* NPJSObject.h in Headers */,
 				1AE4987811FF7FAA0048B464 /* JSNPObject.h in Headers */,
 				1AE49A4911FFA8CE0048B464 /* JSNPMethod.h in Headers */,
+				BCDB85821200EC57007254BE /* WKType.h in Headers */,
+				BCDB86C11200FB97007254BE /* WebURL.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1506,6 +1517,7 @@
 				1AE4976911FF658E0048B464 /* NPJSObject.cpp in Sources */,
 				1AE4987911FF7FAA0048B464 /* JSNPObject.cpp in Sources */,
 				1AE49A4A11FFA8CE0048B464 /* JSNPMethod.cpp in Sources */,
+				BCDB85831200EC57007254BE /* WKType.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
index 435b905..d72de2b 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
@@ -32,6 +32,11 @@
 
 using namespace WebKit;
 
+WKTypeID WKBundleGetTypeID()
+{
+    return toRef(APIObject::TypeBundle);
+}
+
 void WKBundleSetClient(WKBundleRef bundleRef, WKBundleClient * wkClient)
 {
     if (wkClient && !wkClient->version)
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.h
index db62221..a94ed56 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.h
@@ -47,6 +47,8 @@ struct WKBundleClient {
 };
 typedef struct WKBundleClient WKBundleClient;
 
+WK_EXPORT WKTypeID WKBundleGetTypeID();
+
 WK_EXPORT void WKBundleSetClient(WKBundleRef bundle, WKBundleClient * client);
 
 WK_EXPORT void WKBundlePostMessage(WKBundleRef bundle, WKStringRef message);
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
index 98aa147..d88a965 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
@@ -34,6 +34,11 @@
 using namespace WebCore;
 using namespace WebKit;
 
+WKTypeID WKBundleFrameGetTypeID()
+{
+    return toRef(APIObject::TypeBundleFrame);
+}
+
 bool WKBundleFrameIsMainFrame(WKBundleFrameRef frameRef)
 {
     return toWK(frameRef)->isMainFrame();
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h
index 1b0ef20..b271596 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h
@@ -34,6 +34,8 @@
 extern "C" {
 #endif
 
+WK_EXPORT WKTypeID WKBundleFrameGetTypeID();
+
 WK_EXPORT bool WKBundleFrameIsMainFrame(WKBundleFrameRef frame);
 WK_EXPORT WKArrayRef WKBundleFrameCopyChildFrames(WKBundleFrameRef frame);
 
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
index fe6b314..1f25b0a 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
@@ -33,19 +33,24 @@
 
 using namespace WebKit;
 
-void WKBundlePageSetEditorClient(WKBundlePageRef pageRef, WKBundlePageEditorClient * wkClient)
+WKTypeID WKBundlePageGetTypeID()
+{
+    return toRef(APIObject::TypeBundlePage);
+}
+
+void WKBundlePageSetEditorClient(WKBundlePageRef pageRef, WKBundlePageEditorClient* wkClient)
 {
     if (wkClient && !wkClient->version)
         toWK(pageRef)->initializeInjectedBundleEditorClient(wkClient);
 }
 
-void WKBundlePageSetLoaderClient(WKBundlePageRef pageRef, WKBundlePageLoaderClient * wkClient)
+void WKBundlePageSetLoaderClient(WKBundlePageRef pageRef, WKBundlePageLoaderClient* wkClient)
 {
     if (wkClient && !wkClient->version)
         toWK(pageRef)->initializeInjectedBundleLoaderClient(wkClient);
 }
 
-void WKBundlePageSetUIClient(WKBundlePageRef pageRef, WKBundlePageUIClient * wkClient)
+void WKBundlePageSetUIClient(WKBundlePageRef pageRef, WKBundlePageUIClient* wkClient)
 {
     if (wkClient && !wkClient->version)
         toWK(pageRef)->initializeInjectedBundleUIClient(wkClient);
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
index 04b8e5c..4da5033 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
@@ -118,6 +118,8 @@ struct WKBundlePageEditorClient {
 };
 typedef struct WKBundlePageEditorClient WKBundlePageEditorClient;
 
+WK_EXPORT WKTypeID WKBundlePageGetTypeID();
+
 WK_EXPORT void WKBundlePageSetEditorClient(WKBundlePageRef page, WKBundlePageEditorClient* client);
 WK_EXPORT void WKBundlePageSetLoaderClient(WKBundlePageRef page, WKBundlePageLoaderClient* client);
 WK_EXPORT void WKBundlePageSetUIClient(WKBundlePageRef page, WKBundlePageUIClient* client);
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h b/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
index 6f5ecca..8e0eecf 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
@@ -26,10 +26,10 @@
 #ifndef InjectedBundle_h
 #define InjectedBundle_h
 
+#include "APIObject.h"
 #include "WKBundle.h"
 #include <WebCore/PlatformString.h>
 #include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
 
 namespace WebKit {
 
@@ -43,7 +43,7 @@ typedef void* PlatformBundle;
 
 class WebPage;
 
-class InjectedBundle : public RefCounted<InjectedBundle> {
+class InjectedBundle : public APIObject {
 public:
     static PassRefPtr<InjectedBundle> create(const WebCore::String& path)
     {
@@ -71,6 +71,8 @@ public:
 private:
     InjectedBundle(const WebCore::String&);
 
+    virtual Type type() const { return TypeBundle; }
+
     WebCore::String m_path;
     PlatformBundle m_platformBundle; // This is leaked right now, since we never unload the bundle/module.
 
diff --git a/WebKit2/WebProcess/WebPage/WebFrame.h b/WebKit2/WebProcess/WebPage/WebFrame.h
index 1468095..c998231 100644
--- a/WebKit2/WebProcess/WebPage/WebFrame.h
+++ b/WebKit2/WebProcess/WebPage/WebFrame.h
@@ -92,6 +92,8 @@ private:
     static PassRefPtr<WebFrame> create(WebPage*, const WebCore::String& frameName, WebCore::HTMLFrameOwnerElement*);
     WebFrame(WebPage*, const WebCore::String& frameName, WebCore::HTMLFrameOwnerElement*);
 
+    virtual Type type() const { return TypeBundleFrame; }
+
     WebPage* m_page;
     WebCore::Frame* m_coreFrame;
 
diff --git a/WebKit2/WebProcess/WebPage/WebPage.h b/WebKit2/WebProcess/WebPage/WebPage.h
index 2fe25d3..2c9c754 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/WebKit2/WebProcess/WebPage/WebPage.h
@@ -118,6 +118,8 @@ public:
 private:
     WebPage(uint64_t pageID, const WebCore::IntSize& viewSize, const WebPreferencesStore&, DrawingArea::Type);
 
+    virtual Type type() const { return TypeBundlePage; }
+
     void platformInitialize();
     static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
     void performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index edd9128..6b075e6 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -440,6 +440,10 @@
 				RelativePath="..\Shared\WebString.h"
 				>
 			</File>
+			<File
+				RelativePath="..\Shared\WebURL.h"
+				>
+			</File>
 			<Filter
 				Name="CoreIPCSupport"
 				>
@@ -1135,6 +1139,14 @@
 						>
 					</File>
 					<File
+						RelativePath="..\UIProcess\API\C\WKType.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\UIProcess\API\C\WKType.h"
+						>
+					</File>
+					<File
 						RelativePath="..\UIProcess\API\C\WKURL.cpp"
 						>
 					</File>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list