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

andersca at apple.com andersca at apple.com
Wed Dec 22 14:19:12 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 0053508a7d607600c355ed1e4208de99ee2a1a75
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 6 18:16:32 2010 +0000

    Rename toRef/toWK to toAPI/toImpl
    https://bugs.webkit.org/show_bug.cgi?id=47281
    
    Reviewed by Sam Weinig.
    
    * Shared/API/c/WKArray.cpp:
    * Shared/API/c/WKCertificateInfo.cpp:
    * Shared/API/c/WKData.cpp:
    * Shared/API/c/WKDictionary.cpp:
    * Shared/API/c/WKError.cpp:
    * Shared/API/c/WKMutableArray.cpp:
    * Shared/API/c/WKMutableDictionary.cpp:
    * Shared/API/c/WKNumber.cpp:
    * Shared/API/c/WKSerializedScriptValue.cpp:
    * Shared/API/c/WKSharedAPICast.h:
    * Shared/API/c/WKString.cpp:
    * Shared/API/c/WKType.cpp:
    * Shared/API/c/WKURL.cpp:
    * Shared/API/c/WKURLRequest.cpp:
    * Shared/API/c/WKURLResponse.cpp:
    * Shared/API/c/cf/WKStringCF.cpp:
    * Shared/API/c/cf/WKURLCF.cpp:
    * Shared/API/c/cf/WKURLRequestCF.cpp:
    * Shared/API/c/cf/WKURLResponseCF.cpp:
    * Shared/API/c/mac/WKCertificateInfoMac.mm:
    * Shared/API/c/mac/WKURLRequestNS.mm:
    * Shared/API/c/mac/WKURLResponseNS.mm:
    * Shared/API/c/win/WKCertificateInfoWin.cpp:
    * UIProcess/API/C/WKAPICast.h:
    * UIProcess/API/C/WKBackForwardList.cpp:
    * UIProcess/API/C/WKBackForwardListItem.cpp:
    * UIProcess/API/C/WKContext.cpp:
    * UIProcess/API/C/WKFormSubmissionListener.cpp:
    * UIProcess/API/C/WKFrame.cpp:
    * UIProcess/API/C/WKFramePolicyListener.cpp:
    * UIProcess/API/C/WKNavigationData.cpp:
    * UIProcess/API/C/WKPage.cpp:
    * UIProcess/API/C/WKPageNamespace.cpp:
    * UIProcess/API/C/WKPreferences.cpp:
    * UIProcess/API/C/WKPreferencesPrivate.cpp:
    * UIProcess/API/C/win/WKContextWin.cpp:
    * UIProcess/API/C/win/WKView.cpp:
    * UIProcess/API/cpp/qt/WKStringQt.cpp:
    * UIProcess/API/cpp/qt/WKURLQt.cpp:
    * UIProcess/API/mac/PageClientImpl.mm:
    * UIProcess/API/mac/WKView.mm:
    * UIProcess/API/qt/ClientImpl.cpp:
    * UIProcess/API/qt/qwkpage.cpp:
    * UIProcess/GenericCallback.h:
    * UIProcess/WebContextInjectedBundleClient.cpp:
    * UIProcess/WebFormClient.cpp:
    * UIProcess/WebHistoryClient.cpp:
    * UIProcess/WebLoaderClient.cpp:
    * UIProcess/WebPolicyClient.cpp:
    * UIProcess/WebUIClient.cpp:
    * UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm:
    * UIProcess/mac/LayerBackedDrawingAreaProxyMac.mm:
    * UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp:
    * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
    * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
    * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
    * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
    * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
    * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
    * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp:
    * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
    * WebProcess/InjectedBundle/InjectedBundle.cpp:
    * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
    * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
    * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
    * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
    * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp:
    * WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp:
    * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69214 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 477b259..1704832 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,80 @@
+2010-10-06  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Rename toRef/toWK to toAPI/toImpl
+        https://bugs.webkit.org/show_bug.cgi?id=47281
+
+        * Shared/API/c/WKArray.cpp:
+        * Shared/API/c/WKCertificateInfo.cpp:
+        * Shared/API/c/WKData.cpp:
+        * Shared/API/c/WKDictionary.cpp:
+        * Shared/API/c/WKError.cpp:
+        * Shared/API/c/WKMutableArray.cpp:
+        * Shared/API/c/WKMutableDictionary.cpp:
+        * Shared/API/c/WKNumber.cpp:
+        * Shared/API/c/WKSerializedScriptValue.cpp:
+        * Shared/API/c/WKSharedAPICast.h:
+        * Shared/API/c/WKString.cpp:
+        * Shared/API/c/WKType.cpp:
+        * Shared/API/c/WKURL.cpp:
+        * Shared/API/c/WKURLRequest.cpp:
+        * Shared/API/c/WKURLResponse.cpp:
+        * Shared/API/c/cf/WKStringCF.cpp:
+        * Shared/API/c/cf/WKURLCF.cpp:
+        * Shared/API/c/cf/WKURLRequestCF.cpp:
+        * Shared/API/c/cf/WKURLResponseCF.cpp:
+        * Shared/API/c/mac/WKCertificateInfoMac.mm:
+        * Shared/API/c/mac/WKURLRequestNS.mm:
+        * Shared/API/c/mac/WKURLResponseNS.mm:
+        * Shared/API/c/win/WKCertificateInfoWin.cpp:
+        * UIProcess/API/C/WKAPICast.h:
+        * UIProcess/API/C/WKBackForwardList.cpp:
+        * UIProcess/API/C/WKBackForwardListItem.cpp:
+        * UIProcess/API/C/WKContext.cpp:
+        * UIProcess/API/C/WKFormSubmissionListener.cpp:
+        * UIProcess/API/C/WKFrame.cpp:
+        * UIProcess/API/C/WKFramePolicyListener.cpp:
+        * UIProcess/API/C/WKNavigationData.cpp:
+        * UIProcess/API/C/WKPage.cpp:
+        * UIProcess/API/C/WKPageNamespace.cpp:
+        * UIProcess/API/C/WKPreferences.cpp:
+        * UIProcess/API/C/WKPreferencesPrivate.cpp:
+        * UIProcess/API/C/win/WKContextWin.cpp:
+        * UIProcess/API/C/win/WKView.cpp:
+        * UIProcess/API/cpp/qt/WKStringQt.cpp:
+        * UIProcess/API/cpp/qt/WKURLQt.cpp:
+        * UIProcess/API/mac/PageClientImpl.mm:
+        * UIProcess/API/mac/WKView.mm:
+        * UIProcess/API/qt/ClientImpl.cpp:
+        * UIProcess/API/qt/qwkpage.cpp:
+        * UIProcess/GenericCallback.h:
+        * UIProcess/WebContextInjectedBundleClient.cpp:
+        * UIProcess/WebFormClient.cpp:
+        * UIProcess/WebHistoryClient.cpp:
+        * UIProcess/WebLoaderClient.cpp:
+        * UIProcess/WebPolicyClient.cpp:
+        * UIProcess/WebUIClient.cpp:
+        * UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm:
+        * UIProcess/mac/LayerBackedDrawingAreaProxyMac.mm:
+        * UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp:
+        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+        * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
+        * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
+        * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
+        * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp:
+        * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
+        * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
+        * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
+        * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
+        * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp:
+        * WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp:
+        * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
+
 2010-10-06  Luiz Agostini  <luiz.agostini at openbossa.org>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit2/Shared/API/c/WKArray.cpp b/WebKit2/Shared/API/c/WKArray.cpp
index 656a4cc..9e20b7e 100644
--- a/WebKit2/Shared/API/c/WKArray.cpp
+++ b/WebKit2/Shared/API/c/WKArray.cpp
@@ -32,21 +32,21 @@ using namespace WebKit;
 
 WKTypeID WKArrayGetTypeID()
 {
-    return toRef(ImmutableArray::APIType);
+    return toAPI(ImmutableArray::APIType);
 }
 
 WKArrayRef WKArrayCreate(WKTypeRef* values, size_t numberOfValues)
 {
     RefPtr<ImmutableArray> array = ImmutableArray::create(reinterpret_cast<APIObject**>(const_cast<void**>(values)), numberOfValues);
-    return toRef(array.release().releaseRef());
+    return toAPI(array.release().releaseRef());
 }
 
 WKTypeRef WKArrayGetItemAtIndex(WKArrayRef arrayRef, size_t index)
 {
-    return toWK(arrayRef)->at(index);
+    return toImpl(arrayRef)->at(index);
 }
 
 size_t WKArrayGetSize(WKArrayRef arrayRef)
 {
-    return toWK(arrayRef)->size();
+    return toImpl(arrayRef)->size();
 }
diff --git a/WebKit2/Shared/API/c/WKCertificateInfo.cpp b/WebKit2/Shared/API/c/WKCertificateInfo.cpp
index 94ded70..c5a3ad9 100644
--- a/WebKit2/Shared/API/c/WKCertificateInfo.cpp
+++ b/WebKit2/Shared/API/c/WKCertificateInfo.cpp
@@ -32,5 +32,5 @@ using namespace WebKit;
 
 WKTypeID WKCertificateInfoGetTypeID()
 {
-    return toRef(WebCertificateInfo::APIType);
+    return toAPI(WebCertificateInfo::APIType);
 }
diff --git a/WebKit2/Shared/API/c/WKData.cpp b/WebKit2/Shared/API/c/WKData.cpp
index 1196a55..aefe795 100644
--- a/WebKit2/Shared/API/c/WKData.cpp
+++ b/WebKit2/Shared/API/c/WKData.cpp
@@ -32,21 +32,21 @@ using namespace WebKit;
 
 WKTypeID WKDataGetTypeID()
 {
-    return toRef(WebData::APIType);
+    return toAPI(WebData::APIType);
 }
 
 WKDataRef WKDataCreate(const unsigned char* bytes, size_t size)
 {
     RefPtr<WebData> data = WebData::create(bytes, size);
-    return toRef(data.release().releaseRef());
+    return toAPI(data.release().releaseRef());
 }
 
 const unsigned char* WKDataGetBytes(WKDataRef dataRef)
 {
-    return toWK(dataRef)->bytes();
+    return toImpl(dataRef)->bytes();
 }
 
 size_t WKDataGetSize(WKDataRef dataRef)
 {
-    return toWK(dataRef)->size();
+    return toImpl(dataRef)->size();
 }
diff --git a/WebKit2/Shared/API/c/WKDictionary.cpp b/WebKit2/Shared/API/c/WKDictionary.cpp
index 180729d..6b336bf 100644
--- a/WebKit2/Shared/API/c/WKDictionary.cpp
+++ b/WebKit2/Shared/API/c/WKDictionary.cpp
@@ -33,21 +33,21 @@ using namespace WebKit;
 
 WKTypeID WKDictionaryGetTypeID()
 {
-    return toRef(ImmutableDictionary::APIType);
+    return toAPI(ImmutableDictionary::APIType);
 }
 
 WKTypeRef WKDictionaryGetItemForKey(WKDictionaryRef dictionaryRef, WKStringRef key)
 {
-    return toWK(dictionaryRef)->get(toWK(key)->string());
+    return toImpl(dictionaryRef)->get(toImpl(key)->string());
 }
 
 size_t WKDictionaryGetSize(WKDictionaryRef dictionaryRef)
 {
-    return toWK(dictionaryRef)->size();
+    return toImpl(dictionaryRef)->size();
 }
 
 WKArrayRef WKDictionaryCopyKeys(WKDictionaryRef dictionaryRef)
 {
-    RefPtr<ImmutableArray> keys = toWK(dictionaryRef)->keys();
-    return toRef(keys.release().releaseRef());
+    RefPtr<ImmutableArray> keys = toImpl(dictionaryRef)->keys();
+    return toAPI(keys.release().releaseRef());
 }
diff --git a/WebKit2/Shared/API/c/WKError.cpp b/WebKit2/Shared/API/c/WKError.cpp
index 2f47c3e..aa8432b 100644
--- a/WebKit2/Shared/API/c/WKError.cpp
+++ b/WebKit2/Shared/API/c/WKError.cpp
@@ -32,5 +32,5 @@ using namespace WebKit;
 
 WKTypeID WKErrorGetTypeID()
 {
-    return toRef(WebError::APIType);
+    return toAPI(WebError::APIType);
 }
diff --git a/WebKit2/Shared/API/c/WKMutableArray.cpp b/WebKit2/Shared/API/c/WKMutableArray.cpp
index 9d121e0..48f557b 100644
--- a/WebKit2/Shared/API/c/WKMutableArray.cpp
+++ b/WebKit2/Shared/API/c/WKMutableArray.cpp
@@ -33,15 +33,15 @@ using namespace WebKit;
 WKMutableArrayRef WKMutableArrayCreate()
 {
     RefPtr<MutableArray> array = MutableArray::create();
-    return toRef(array.release().releaseRef());
+    return toAPI(array.release().releaseRef());
 }
 
 bool WKArrayIsMutable(WKArrayRef arrayRef)
 {
-    return toWK(arrayRef)->isMutable();
+    return toImpl(arrayRef)->isMutable();
 }
 
 void WKArrayAppendItem(WKMutableArrayRef arrayRef, WKTypeRef itemRef)
 {
-    toWK(arrayRef)->append(toWK(itemRef));
+    toImpl(arrayRef)->append(toImpl(itemRef));
 }
diff --git a/WebKit2/Shared/API/c/WKMutableDictionary.cpp b/WebKit2/Shared/API/c/WKMutableDictionary.cpp
index 222260c..df9f5a7 100644
--- a/WebKit2/Shared/API/c/WKMutableDictionary.cpp
+++ b/WebKit2/Shared/API/c/WKMutableDictionary.cpp
@@ -33,20 +33,20 @@ using namespace WebKit;
 WKMutableDictionaryRef WKMutableDictionaryCreate()
 {
     RefPtr<MutableDictionary> dictionary = MutableDictionary::create();
-    return toRef(dictionary.release().releaseRef());
+    return toAPI(dictionary.release().releaseRef());
 }
 
 bool WKDictionaryIsMutable(WKDictionaryRef dictionaryRef)
 {
-    return toWK(dictionaryRef)->isMutable();
+    return toImpl(dictionaryRef)->isMutable();
 }
 
 bool WKDictionaryAddItem(WKMutableDictionaryRef dictionaryRef, WKStringRef keyRef, WKTypeRef itemRef)
 {
-    return toWK(dictionaryRef)->add(toWK(keyRef)->string(), toWK(itemRef));
+    return toImpl(dictionaryRef)->add(toImpl(keyRef)->string(), toImpl(itemRef));
 }
 
 bool WKDictionarySetItem(WKMutableDictionaryRef dictionaryRef, WKStringRef keyRef, WKTypeRef itemRef)
 {
-    return toWK(dictionaryRef)->set(toWK(keyRef)->string(), toWK(itemRef));
+    return toImpl(dictionaryRef)->set(toImpl(keyRef)->string(), toImpl(itemRef));
 }
diff --git a/WebKit2/Shared/API/c/WKNumber.cpp b/WebKit2/Shared/API/c/WKNumber.cpp
index 797db79..4a413e1 100644
--- a/WebKit2/Shared/API/c/WKNumber.cpp
+++ b/WebKit2/Shared/API/c/WKNumber.cpp
@@ -32,48 +32,48 @@ using namespace WebKit;
 
 WKTypeID WKBooleanGetTypeID()
 {
-    return toRef(WebBoolean::APIType);
+    return toAPI(WebBoolean::APIType);
 }
 
 WKBooleanRef WKBooleanCreate(bool value)
 {
     RefPtr<WebBoolean> booleanObject = WebBoolean::create(value);
-    return toRef(booleanObject.release().releaseRef());
+    return toAPI(booleanObject.release().releaseRef());
 }
 
 bool WKBooleanGetValue(WKBooleanRef booleanRef)
 {
-    return toWK(booleanRef)->value();
+    return toImpl(booleanRef)->value();
 }
 
 WKTypeID WKDoubleGetTypeID()
 {
-    return toRef(WebDouble::APIType);
+    return toAPI(WebDouble::APIType);
 }
 
 WKDoubleRef WKDoubleCreate(double value)
 {
     RefPtr<WebDouble> doubleObject = WebDouble::create(value);
-    return toRef(doubleObject.release().releaseRef());
+    return toAPI(doubleObject.release().releaseRef());
 }
 
 double WKDoubleGetValue(WKDoubleRef doubleRef)
 {
-    return toWK(doubleRef)->value();
+    return toImpl(doubleRef)->value();
 }
 
 WKTypeID WKUInt64GetTypeID()
 {
-    return toRef(WebUInt64::APIType);
+    return toAPI(WebUInt64::APIType);
 }
 
 WKUInt64Ref WKUInt64Create(uint64_t value)
 {
     RefPtr<WebUInt64> uint64Object = WebUInt64::create(value);
-    return toRef(uint64Object.release().releaseRef());
+    return toAPI(uint64Object.release().releaseRef());
 }
 
 uint64_t WKUInt64GetValue(WKUInt64Ref uint64Ref)
 {
-    return toWK(uint64Ref)->value();
+    return toImpl(uint64Ref)->value();
 }
diff --git a/WebKit2/Shared/API/c/WKSerializedScriptValue.cpp b/WebKit2/Shared/API/c/WKSerializedScriptValue.cpp
index 4298e85..e3940a8 100644
--- a/WebKit2/Shared/API/c/WKSerializedScriptValue.cpp
+++ b/WebKit2/Shared/API/c/WKSerializedScriptValue.cpp
@@ -32,16 +32,16 @@ using namespace WebKit;
 
 WKTypeID WKSerializedScriptValueGetTypeID()
 {
-    return toRef(WebSerializedScriptValue::APIType);
+    return toAPI(WebSerializedScriptValue::APIType);
 }
 
 WKSerializedScriptValueRef WKSerializedScriptValueCreate(JSContextRef context, JSValueRef value, JSValueRef* exception)
 {
     RefPtr<WebSerializedScriptValue> serializedValue = WebSerializedScriptValue::create(context, value, exception);
-    return toRef(serializedValue.release().leakRef());
+    return toAPI(serializedValue.release().leakRef());
 }
 
 JSValueRef WKSerializedScriptValueDeserialize(WKSerializedScriptValueRef scriptValueRef, JSContextRef contextRef, JSValueRef* exception)
 {
-    return toWK(scriptValueRef)->deserialize(contextRef, exception);
+    return toImpl(scriptValueRef)->deserialize(contextRef, exception);
 }
diff --git a/WebKit2/Shared/API/c/WKSharedAPICast.h b/WebKit2/Shared/API/c/WKSharedAPICast.h
index aaf5fe4..30f5f96 100644
--- a/WebKit2/Shared/API/c/WKSharedAPICast.h
+++ b/WebKit2/Shared/API/c/WKSharedAPICast.h
@@ -79,7 +79,7 @@ public:
     {
     }
 
-    operator APIType() { return toRef(m_impl.get()); }
+    operator APIType() { return toAPI(m_impl.get()); }
 
 private:
     RefPtr<ImplType> m_impl;
@@ -88,7 +88,7 @@ private:
 /* Opaque typing convenience methods */
 
 template<typename T>
-inline typename APITypeInfo<T>::ImplType toWK(T t)
+inline typename APITypeInfo<T>::ImplType toImpl(T t)
 {
     // An example of the conversions that take place:
     // const struct OpaqueWKArray* -> const struct OpaqueWKArray -> struct OpaqueWKArray -> struct OpaqueWKArray* -> ImmutableArray*
@@ -100,14 +100,14 @@ inline typename APITypeInfo<T>::ImplType toWK(T t)
 }
 
 template<typename T>
-inline typename ImplTypeInfo<T>::APIType toRef(T t)
+inline typename ImplTypeInfo<T>::APIType toAPI(T t)
 {
     return reinterpret_cast<typename ImplTypeInfo<T>::APIType>(t);
 }
 
 /* Special cases. */
 
-inline ProxyingRefPtr<WebString> toRef(StringImpl* string)
+inline ProxyingRefPtr<WebString> toAPI(StringImpl* string)
 {
     StringImpl* impl = string ? string : StringImpl::empty();
     return ProxyingRefPtr<WebString>(WebString::create(String(impl)));
@@ -119,42 +119,42 @@ inline ProxyingRefPtr<WebURL> toURLRef(StringImpl* string)
     return ProxyingRefPtr<WebURL>(WebURL::create(String(impl)));
 }
 
-inline WKStringRef toCopiedRef(const String& string)
+inline WKStringRef toCopiedAPI(const String& string)
 {
     StringImpl* impl = string.impl() ? string.impl() : StringImpl::empty();
     RefPtr<WebString> webString = WebString::create(String(impl));
-    return toRef(webString.release().releaseRef());
+    return toAPI(webString.release().releaseRef());
 }
 
-inline WKURLRef toCopiedURLRef(const String& string)
+inline WKURLRef toCopiedURLAPI(const String& string)
 {
     StringImpl* impl = string.impl() ? string.impl() : StringImpl::empty();
     RefPtr<WebURL> webURL = WebURL::create(String(impl));
-    return toRef(webURL.release().releaseRef());
+    return toAPI(webURL.release().releaseRef());
 }
 
 inline String toWTFString(WKStringRef stringRef)
 {
     if (!stringRef)
         return String();
-    return toWK(stringRef)->string();
+    return toImpl(stringRef)->string();
 }
 
 inline String toWTFString(WKURLRef urlRef)
 {
     if (!urlRef)
         return String();
-    return toWK(urlRef)->string();
+    return toImpl(urlRef)->string();
 }
 
 /* Enum conversions */
 
-inline WKTypeID toRef(APIObject::Type type)
+inline WKTypeID toAPI(APIObject::Type type)
 {
     return static_cast<WKTypeID>(type);
 }
 
-inline WKEventModifiers toRef(WebEvent::Modifiers modifiers)
+inline WKEventModifiers toAPI(WebEvent::Modifiers modifiers)
 {
     WKEventModifiers wkModifiers = 0;
     if (modifiers & WebEvent::ShiftKey)
@@ -168,7 +168,7 @@ inline WKEventModifiers toRef(WebEvent::Modifiers modifiers)
     return wkModifiers;
 }
 
-inline WKEventMouseButton toRef(WebMouseEvent::Button mouseButton)
+inline WKEventMouseButton toAPI(WebMouseEvent::Button mouseButton)
 {
     WKEventMouseButton wkMouseButton = kWKEventMouseButtonNoButton;
 
diff --git a/WebKit2/Shared/API/c/WKString.cpp b/WebKit2/Shared/API/c/WKString.cpp
index bf484e2..14f40fa 100644
--- a/WebKit2/Shared/API/c/WKString.cpp
+++ b/WebKit2/Shared/API/c/WKString.cpp
@@ -32,47 +32,47 @@ using namespace WebKit;
 
 WKTypeID WKStringGetTypeID()
 {
-    return toRef(WebString::APIType);
+    return toAPI(WebString::APIType);
 }
 
 WKStringRef WKStringCreateWithUTF8CString(const char* string)
 {
     RefPtr<WebString> webString = WebString::createFromUTF8String(string);
-    return toRef(webString.release().leakRef());
+    return toAPI(webString.release().leakRef());
 }
 
 bool WKStringIsEmpty(WKStringRef stringRef)
 {
-    return toWK(stringRef)->isEmpty();
+    return toImpl(stringRef)->isEmpty();
 }
 
 size_t WKStringGetMaximumUTF8CStringSize(WKStringRef stringRef)
 {
-    return toWK(stringRef)->maximumUTF8CStringSize();
+    return toImpl(stringRef)->maximumUTF8CStringSize();
 }
 
 size_t WKStringGetUTF8CString(WKStringRef stringRef, char* buffer, size_t bufferSize)
 {
-    return toWK(stringRef)->getUTF8CString(buffer, bufferSize);
+    return toImpl(stringRef)->getUTF8CString(buffer, bufferSize);
 }
 
 bool WKStringIsEqual(WKStringRef aRef, WKStringRef bRef)
 {
-    return toWK(aRef)->equal(toWK(bRef));
+    return toImpl(aRef)->equal(toImpl(bRef));
 }
 
 bool WKStringIsEqualToUTF8CString(WKStringRef aRef, const char* b)
 {
-    return toWK(aRef)->equalToUTF8String(b);
+    return toImpl(aRef)->equalToUTF8String(b);
 }
 
 WKStringRef WKStringCreateWithJSString(JSStringRef jsStringRef)
 {
     RefPtr<WebString> webString = WebString::create(jsStringRef);
-    return toRef(webString.release().leakRef());
+    return toAPI(webString.release().leakRef());
 }
 
 JSStringRef WKStringCopyJSString(WKStringRef stringRef)
 {
-    return toWK(stringRef)->createJSString();
+    return toImpl(stringRef)->createJSString();
 }
diff --git a/WebKit2/Shared/API/c/WKType.cpp b/WebKit2/Shared/API/c/WKType.cpp
index 00a3d52..a499737 100644
--- a/WebKit2/Shared/API/c/WKType.cpp
+++ b/WebKit2/Shared/API/c/WKType.cpp
@@ -32,7 +32,7 @@ using namespace WebKit;
 
 WKTypeID WKGetTypeID(WKTypeRef typeRef)
 {
-    return toRef(static_cast<APIObject*>(const_cast<void*>(typeRef))->type());
+    return toAPI(static_cast<APIObject*>(const_cast<void*>(typeRef))->type());
 }
 
 WKTypeRef WKRetain(WKTypeRef typeRef)
diff --git a/WebKit2/Shared/API/c/WKURL.cpp b/WebKit2/Shared/API/c/WKURL.cpp
index b525833..0176223 100644
--- a/WebKit2/Shared/API/c/WKURL.cpp
+++ b/WebKit2/Shared/API/c/WKURL.cpp
@@ -31,5 +31,5 @@ using namespace WebKit;
 
 WKTypeID WKURLGetTypeID()
 {
-    return toRef(WebURL::APIType);
+    return toAPI(WebURL::APIType);
 }
diff --git a/WebKit2/Shared/API/c/WKURLRequest.cpp b/WebKit2/Shared/API/c/WKURLRequest.cpp
index dc07730..060627b 100644
--- a/WebKit2/Shared/API/c/WKURLRequest.cpp
+++ b/WebKit2/Shared/API/c/WKURLRequest.cpp
@@ -32,5 +32,5 @@ using namespace WebKit;
 
 WKTypeID WKURLRequestGetTypeID()
 {
-    return toRef(WebURLRequest::APIType);
+    return toAPI(WebURLRequest::APIType);
 }
diff --git a/WebKit2/Shared/API/c/WKURLResponse.cpp b/WebKit2/Shared/API/c/WKURLResponse.cpp
index 285c127..12537bd 100644
--- a/WebKit2/Shared/API/c/WKURLResponse.cpp
+++ b/WebKit2/Shared/API/c/WKURLResponse.cpp
@@ -32,6 +32,6 @@ using namespace WebKit;
 
 WKTypeID WKURLResponseGetTypeID()
 {
-    return toRef(WebURLResponse::APIType);
+    return toAPI(WebURLResponse::APIType);
 }
 
diff --git a/WebKit2/Shared/API/c/cf/WKStringCF.cpp b/WebKit2/Shared/API/c/cf/WKStringCF.cpp
index 1bb3b69..b89110e 100644
--- a/WebKit2/Shared/API/c/cf/WKStringCF.cpp
+++ b/WebKit2/Shared/API/c/cf/WKStringCF.cpp
@@ -34,14 +34,14 @@ using namespace WebKit;
 WKStringRef WKStringCreateWithCFString(CFStringRef cfString)
 {
     String string(cfString);
-    return toCopiedRef(string);
+    return toCopiedAPI(string);
 }
 
 CFStringRef WKStringCopyCFString(CFAllocatorRef allocatorRef, WKStringRef stringRef)
 {
-    ASSERT(!toWK(stringRef)->string().isNull());
+    ASSERT(!toImpl(stringRef)->string().isNull());
 
     // NOTE: This does not use StringImpl::createCFString() since that function
     // expects to be called on the thread running WebCore.
-    return CFStringCreateWithCharacters(allocatorRef, reinterpret_cast<const UniChar*>(toWK(stringRef)->string().characters()), toWK(stringRef)->string().length());
+    return CFStringCreateWithCharacters(allocatorRef, reinterpret_cast<const UniChar*>(toImpl(stringRef)->string().characters()), toImpl(stringRef)->string().length());
 }
diff --git a/WebKit2/Shared/API/c/cf/WKURLCF.cpp b/WebKit2/Shared/API/c/cf/WKURLCF.cpp
index 3f4cf51..a4627ce 100644
--- a/WebKit2/Shared/API/c/cf/WKURLCF.cpp
+++ b/WebKit2/Shared/API/c/cf/WKURLCF.cpp
@@ -38,12 +38,12 @@ using namespace WebKit;
 WKURLRef WKURLCreateWithCFURL(CFURLRef cfURL)
 {
     String urlString(CFURLGetString(cfURL));
-    return toCopiedURLRef(urlString);
+    return toCopiedURLAPI(urlString);
 }
 
 CFURLRef WKURLCopyCFURL(CFAllocatorRef allocatorRef, WKURLRef URLRef)
 {
-    ASSERT(!toWK(URLRef)->string().isNull());
+    ASSERT(!toImpl(URLRef)->string().isNull());
 
     // We first create a CString and then create the CFURL from it. This will ensure that the CFURL is stored in 
     // UTF-8 which uses less memory and is what WebKit clients might expect.
@@ -52,7 +52,7 @@ CFURLRef WKURLCopyCFURL(CFAllocatorRef allocatorRef, WKURLRef URLRef)
     // major differnce being that KURL does not do a UTF-8 conversion and instead chops off the high bits of the UTF-16
     // character sequence.
 
-    CString buffer = toWK(URLRef)->string().utf8();
+    CString buffer = toImpl(URLRef)->string().utf8();
     CFURLRef result = CFURLCreateAbsoluteURLWithBytes(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(buffer.data()), buffer.length(), kCFStringEncodingUTF8, 0, true);
     if (!result)
         result = CFURLCreateAbsoluteURLWithBytes(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(buffer.data()), buffer.length(), kCFStringEncodingISOLatin1, 0, true);
diff --git a/WebKit2/Shared/API/c/cf/WKURLRequestCF.cpp b/WebKit2/Shared/API/c/cf/WKURLRequestCF.cpp
index d9c127f..98c801a 100644
--- a/WebKit2/Shared/API/c/cf/WKURLRequestCF.cpp
+++ b/WebKit2/Shared/API/c/cf/WKURLRequestCF.cpp
@@ -34,10 +34,10 @@ WKURLRequestRef WKURLRequestCreateWithCFURLRequest(CFURLRequestRef urlRequest)
 {
     CFURLRequestRef copiedURLRequest = CFURLRequestCreateCopy(kCFAllocatorDefault, urlRequest);
     RefPtr<WebURLRequest> request = WebURLRequest::create(copiedURLRequest);
-    return toRef(request.release().releaseRef());
+    return toAPI(request.release().releaseRef());
 }
 
 CFURLRequestRef WKURLRequestCopyCFURLRequest(CFAllocatorRef alloc, WKURLRequestRef urlRequest)
 {
-    return CFURLRequestCreateCopy(alloc, toWK(urlRequest)->platformRequest());
+    return CFURLRequestCreateCopy(alloc, toImpl(urlRequest)->platformRequest());
 }
diff --git a/WebKit2/Shared/API/c/cf/WKURLResponseCF.cpp b/WebKit2/Shared/API/c/cf/WKURLResponseCF.cpp
index b7b46b3..36d3f00 100644
--- a/WebKit2/Shared/API/c/cf/WKURLResponseCF.cpp
+++ b/WebKit2/Shared/API/c/cf/WKURLResponseCF.cpp
@@ -34,10 +34,10 @@ WKURLResponseRef WKURLResponseCreateWithCFURLResponse(CFURLResponseRef urlRespon
 {
     CFURLResponseRef copiedURLResponse = CFURLResponseCreateCopy(kCFAllocatorDefault, urlResponse);
     RefPtr<WebURLResponse> response = WebURLResponse::create(copiedURLResponse);
-    return toRef(response.release().releaseRef());
+    return toAPI(response.release().releaseRef());
 }
 
 CFURLResponseRef WKURLResponseCopyCFURLResponse(CFAllocatorRef alloc, WKURLResponseRef urlResponse)
 {
-    return CFURLResponseCreateCopy(alloc, toWK(urlResponse)->platformResponse());
+    return CFURLResponseCreateCopy(alloc, toImpl(urlResponse)->platformResponse());
 }
diff --git a/WebKit2/Shared/API/c/mac/WKCertificateInfoMac.mm b/WebKit2/Shared/API/c/mac/WKCertificateInfoMac.mm
index 1455909..760dbbd 100644
--- a/WebKit2/Shared/API/c/mac/WKCertificateInfoMac.mm
+++ b/WebKit2/Shared/API/c/mac/WKCertificateInfoMac.mm
@@ -32,5 +32,5 @@ using namespace WebKit;
 
 CFArrayRef WKCertificateInfoGetPeerCertificates(WKCertificateInfoRef certificateInfoRef)
 {
-    return toWK(certificateInfoRef)->platformCertificateInfo().peerCertificates();
+    return toImpl(certificateInfoRef)->platformCertificateInfo().peerCertificates();
 }
diff --git a/WebKit2/Shared/API/c/mac/WKURLRequestNS.mm b/WebKit2/Shared/API/c/mac/WKURLRequestNS.mm
index 67a8257..f9e69dd 100644
--- a/WebKit2/Shared/API/c/mac/WKURLRequestNS.mm
+++ b/WebKit2/Shared/API/c/mac/WKURLRequestNS.mm
@@ -34,10 +34,10 @@ WKURLRequestRef WKURLRequestCreateWithNSURLRequest(NSURLRequest* urlRequest)
 {
     RetainPtr<NSURLRequest> copiedURLRequest(AdoptNS, [urlRequest copy]);
     RefPtr<WebURLRequest> request = WebURLRequest::create(copiedURLRequest.get());
-    return toRef(request.release().releaseRef());
+    return toAPI(request.release().releaseRef());
 }
 
 NSURLRequest* WKURLRequestCopyNSURLRequest(CFAllocatorRef alloc, WKURLRequestRef urlRequest)
 {
-    return [toWK(urlRequest)->platformRequest() copy];
+    return [toImpl(urlRequest)->platformRequest() copy];
 }
diff --git a/WebKit2/Shared/API/c/mac/WKURLResponseNS.mm b/WebKit2/Shared/API/c/mac/WKURLResponseNS.mm
index 6d6e510..81aaa6e 100644
--- a/WebKit2/Shared/API/c/mac/WKURLResponseNS.mm
+++ b/WebKit2/Shared/API/c/mac/WKURLResponseNS.mm
@@ -34,10 +34,10 @@ WKURLResponseRef WKURLResponseCreateWithNSURLResponse(NSURLResponse* urlResponse
 {
     RetainPtr<NSURLResponse> copiedURLResponse(AdoptNS, [urlResponse copy]);
     RefPtr<WebURLResponse> response = WebURLResponse::create(copiedURLResponse.get());
-    return toRef(response.release().releaseRef());
+    return toAPI(response.release().releaseRef());
 }
 
 NSURLResponse* WKURLResponseCopyNSURLResponse(CFAllocatorRef alloc, WKURLResponseRef urlResponse)
 {
-    return [toWK(urlResponse)->platformResponse() copy];
+    return [toImpl(urlResponse)->platformResponse() copy];
 }
diff --git a/WebKit2/Shared/API/c/win/WKCertificateInfoWin.cpp b/WebKit2/Shared/API/c/win/WKCertificateInfoWin.cpp
index 104a962..04c5a0c 100644
--- a/WebKit2/Shared/API/c/win/WKCertificateInfoWin.cpp
+++ b/WebKit2/Shared/API/c/win/WKCertificateInfoWin.cpp
@@ -32,5 +32,5 @@ using namespace WebKit;
 
 PCCERT_CONTEXT WKCertificateInfoGetCertificateContext(WKCertificateInfoRef certificateInfoRef)
 {
-    return toWK(certificateInfoRef)->platformCertificateInfo().certificateContext();
+    return toImpl(certificateInfoRef)->platformCertificateInfo().certificateContext();
 }
diff --git a/WebKit2/UIProcess/API/C/WKAPICast.h b/WebKit2/UIProcess/API/C/WKAPICast.h
index 0dc3f4d..ddda4fd 100644
--- a/WebKit2/UIProcess/API/C/WKAPICast.h
+++ b/WebKit2/UIProcess/API/C/WKAPICast.h
@@ -58,7 +58,7 @@ WK_ADD_API_MAPPING(WKPreferencesRef, WebPreferences)
 
 /* Enum conversions */
 
-inline WKFrameNavigationType toRef(WebCore::NavigationType type)
+inline WKFrameNavigationType toAPI(WebCore::NavigationType type)
 {
     WKFrameNavigationType wkType = kWKFrameNavigationTypeOther;
 
@@ -101,7 +101,7 @@ inline CacheModel toCacheModel(WKCacheModel wkCacheModel)
     return CacheModelDocumentViewer;
 }
 
-inline WKCacheModel toRef(CacheModel cacheModel)
+inline WKCacheModel toAPI(CacheModel cacheModel)
 {
     switch (cacheModel) {
     case CacheModelDocumentViewer:
diff --git a/WebKit2/UIProcess/API/C/WKBackForwardList.cpp b/WebKit2/UIProcess/API/C/WKBackForwardList.cpp
index 3dcd830..c2343ca 100644
--- a/WebKit2/UIProcess/API/C/WKBackForwardList.cpp
+++ b/WebKit2/UIProcess/API/C/WKBackForwardList.cpp
@@ -32,45 +32,45 @@ using namespace WebKit;
 
 WKTypeID WKBackForwardListGetTypeID()
 {
-    return toRef(WebBackForwardList::APIType);
+    return toAPI(WebBackForwardList::APIType);
 }
 
 WKBackForwardListItemRef WKBackForwardListGetCurrentItem(WKBackForwardListRef listRef)
 {
-    return toRef(toWK(listRef)->currentItem());
+    return toAPI(toImpl(listRef)->currentItem());
 }
 
 WKBackForwardListItemRef WKBackForwardListGetBackItem(WKBackForwardListRef listRef)
 {
-    return toRef(toWK(listRef)->backItem());
+    return toAPI(toImpl(listRef)->backItem());
 }
 
 WKBackForwardListItemRef WKBackForwardListGetForwardItem(WKBackForwardListRef listRef)
 {
-    return toRef(toWK(listRef)->forwardItem());
+    return toAPI(toImpl(listRef)->forwardItem());
 }
 
 WKBackForwardListItemRef WKBackForwardListGetItemAtIndex(WKBackForwardListRef listRef, int index)
 {
-    return toRef(toWK(listRef)->itemAtIndex(index));
+    return toAPI(toImpl(listRef)->itemAtIndex(index));
 }
 
 unsigned WKBackForwardListGetBackListCount(WKBackForwardListRef listRef)
 {
-    return toWK(listRef)->backListCount();
+    return toImpl(listRef)->backListCount();
 }
 
 unsigned WKBackForwardListGetForwardListCount(WKBackForwardListRef listRef)
 {
-    return toWK(listRef)->forwardListCount();
+    return toImpl(listRef)->forwardListCount();
 }
 
 WKArrayRef WKBackForwardListCopyBackListWithLimit(WKBackForwardListRef listRef, unsigned limit)
 {
-    return toRef(toWK(listRef)->backListAsImmutableArrayWithLimit(limit).releaseRef());
+    return toAPI(toImpl(listRef)->backListAsImmutableArrayWithLimit(limit).releaseRef());
 }
 
 WKArrayRef WKBackForwardListCopyForwardListWithLimit(WKBackForwardListRef listRef, unsigned limit)
 {
-    return toRef(toWK(listRef)->forwardListAsImmutableArrayWithLimit(limit).releaseRef());    
+    return toAPI(toImpl(listRef)->forwardListAsImmutableArrayWithLimit(limit).releaseRef());    
 }
diff --git a/WebKit2/UIProcess/API/C/WKBackForwardListItem.cpp b/WebKit2/UIProcess/API/C/WKBackForwardListItem.cpp
index 28fdb71..fcc0bb2 100644
--- a/WebKit2/UIProcess/API/C/WKBackForwardListItem.cpp
+++ b/WebKit2/UIProcess/API/C/WKBackForwardListItem.cpp
@@ -32,20 +32,20 @@ using namespace WebKit;
 
 WKTypeID WKBackForwardListItemGetTypeID()
 {
-    return toRef(WebBackForwardListItem::APIType);
+    return toAPI(WebBackForwardListItem::APIType);
 }
 
 WKURLRef WKBackForwardListItemCopyOriginalURL(WKBackForwardListItemRef itemRef)
 {
-    return toCopiedURLRef(toWK(itemRef)->originalURL());
+    return toCopiedURLAPI(toImpl(itemRef)->originalURL());
 }
 
 WKURLRef WKBackForwardListItemCopyURL(WKBackForwardListItemRef itemRef)
 {
-    return toCopiedURLRef(toWK(itemRef)->url());
+    return toCopiedURLAPI(toImpl(itemRef)->url());
 }
 
 WKStringRef WKBackForwardListItemCopyTitle(WKBackForwardListItemRef itemRef)
 {
-    return toCopiedRef(toWK(itemRef)->title());
+    return toCopiedAPI(toImpl(itemRef)->title());
 }
diff --git a/WebKit2/UIProcess/API/C/WKContext.cpp b/WebKit2/UIProcess/API/C/WKContext.cpp
index 916cb38..b40c65e 100644
--- a/WebKit2/UIProcess/API/C/WKContext.cpp
+++ b/WebKit2/UIProcess/API/C/WKContext.cpp
@@ -37,86 +37,86 @@ using namespace WebKit;
 
 WKTypeID WKContextGetTypeID()
 {
-    return toRef(WebContext::APIType);
+    return toAPI(WebContext::APIType);
 }
 
 WKContextRef WKContextCreate()
 {
     RefPtr<WebContext> context = WebContext::create(String());
-    return toRef(context.release().releaseRef());
+    return toAPI(context.release().releaseRef());
 }
 
 WKContextRef WKContextCreateWithInjectedBundlePath(WKStringRef pathRef)
 {
-    RefPtr<WebContext> context = WebContext::create(toWK(pathRef)->string());
-    return toRef(context.release().releaseRef());
+    RefPtr<WebContext> context = WebContext::create(toImpl(pathRef)->string());
+    return toAPI(context.release().releaseRef());
 }
 
 WKContextRef WKContextGetSharedProcessContext()
 {
-    return toRef(WebContext::sharedProcessContext());
+    return toAPI(WebContext::sharedProcessContext());
 }
 
 WKContextRef WKContextGetSharedThreadContext()
 {
-    return toRef(WebContext::sharedThreadContext());
+    return toAPI(WebContext::sharedThreadContext());
 }
 
 void WKContextSetPreferences(WKContextRef contextRef, WKPreferencesRef preferencesRef)
 {
-    toWK(contextRef)->setPreferences(toWK(preferencesRef));
+    toImpl(contextRef)->setPreferences(toImpl(preferencesRef));
 }
 
 WKPreferencesRef WKContextGetPreferences(WKContextRef contextRef)
 {
-    return toRef(toWK(contextRef)->preferences());
+    return toAPI(toImpl(contextRef)->preferences());
 }
 
 void WKContextSetInjectedBundleClient(WKContextRef contextRef, const WKContextInjectedBundleClient* wkClient)
 {
     if (wkClient && wkClient->version)
         return;
-    toWK(contextRef)->initializeInjectedBundleClient(wkClient);
+    toImpl(contextRef)->initializeInjectedBundleClient(wkClient);
 }
 
 void WKContextSetHistoryClient(WKContextRef contextRef, const WKContextHistoryClient* wkClient)
 {
     if (wkClient && wkClient->version)
         return;
-    toWK(contextRef)->initializeHistoryClient(wkClient);
+    toImpl(contextRef)->initializeHistoryClient(wkClient);
 }
 
 void WKContextPostMessageToInjectedBundle(WKContextRef contextRef, WKStringRef messageNameRef, WKTypeRef messageBodyRef)
 {
-    toWK(contextRef)->postMessageToInjectedBundle(toWK(messageNameRef)->string(), toWK(messageBodyRef));
+    toImpl(contextRef)->postMessageToInjectedBundle(toImpl(messageNameRef)->string(), toImpl(messageBodyRef));
 }
 
 void WKContextGetStatistics(WKContextRef contextRef, WKContextStatistics* statistics)
 {
-    toWK(contextRef)->getStatistics(statistics);
+    toImpl(contextRef)->getStatistics(statistics);
 }
 
 void WKContextAddVisitedLink(WKContextRef contextRef, WKStringRef visitedURL)
 {
-    toWK(contextRef)->addVisitedLink(toWK(visitedURL)->string());
+    toImpl(contextRef)->addVisitedLink(toImpl(visitedURL)->string());
 }
 
 void WKContextSetCacheModel(WKContextRef contextRef, WKCacheModel cacheModel)
 {
-    toWK(contextRef)->setCacheModel(toCacheModel(cacheModel));
+    toImpl(contextRef)->setCacheModel(toCacheModel(cacheModel));
 }
 
 WKCacheModel WKContextGetCacheModel(WKContextRef contextRef)
 {
-    return toRef(toWK(contextRef)->cacheModel());
+    return toAPI(toImpl(contextRef)->cacheModel());
 }
 
 void _WKContextSetAdditionalPluginsDirectory(WKContextRef contextRef, WKStringRef pluginsDirectory)
 {
-    toWK(contextRef)->setAdditionalPluginsDirectory(toWK(pluginsDirectory)->string());
+    toImpl(contextRef)->setAdditionalPluginsDirectory(toImpl(pluginsDirectory)->string());
 }
 
 void _WKContextRegisterURLSchemeAsEmptyDocument(WKContextRef contextRef, WKStringRef urlScheme)
 {
-    toWK(contextRef)->registerURLSchemeAsEmptyDocument(toWK(urlScheme)->string());
+    toImpl(contextRef)->registerURLSchemeAsEmptyDocument(toImpl(urlScheme)->string());
 }
diff --git a/WebKit2/UIProcess/API/C/WKFormSubmissionListener.cpp b/WebKit2/UIProcess/API/C/WKFormSubmissionListener.cpp
index 8b74188..ae98831 100644
--- a/WebKit2/UIProcess/API/C/WKFormSubmissionListener.cpp
+++ b/WebKit2/UIProcess/API/C/WKFormSubmissionListener.cpp
@@ -32,10 +32,10 @@ using namespace WebKit;
 
 WKTypeID WKFormSubmissionListenerGetTypeID()
 {
-    return toRef(WebFormSubmissionListenerProxy::APIType);
+    return toAPI(WebFormSubmissionListenerProxy::APIType);
 }
 
 void WKFormSubmissionListenerContinue(WKFormSubmissionListenerRef submissionListener)
 {
-    toWK(submissionListener)->continueSubmission();
+    toImpl(submissionListener)->continueSubmission();
 }
diff --git a/WebKit2/UIProcess/API/C/WKFrame.cpp b/WebKit2/UIProcess/API/C/WKFrame.cpp
index 6420d22..67f7a8c 100644
--- a/WebKit2/UIProcess/API/C/WKFrame.cpp
+++ b/WebKit2/UIProcess/API/C/WKFrame.cpp
@@ -32,17 +32,17 @@ using namespace WebKit;
 
 WKTypeID WKFrameGetTypeID()
 {
-    return toRef(WebFrameProxy::APIType);
+    return toAPI(WebFrameProxy::APIType);
 }
 
 bool WKFrameIsMainFrame(WKFrameRef frameRef)
 {
-    return toWK(frameRef)->isMainFrame();
+    return toImpl(frameRef)->isMainFrame();
 }
 
 WKFrameLoadState WKFrameGetFrameLoadState(WKFrameRef frameRef)
 {
-    WebFrameProxy* frame = toWK(frameRef);
+    WebFrameProxy* frame = toImpl(frameRef);
     switch (frame->loadState()) {
         case WebFrameProxy::LoadStateProvisional:
             return kWKFrameLoadStateProvisional;
@@ -58,25 +58,25 @@ WKFrameLoadState WKFrameGetFrameLoadState(WKFrameRef frameRef)
 
 WKURLRef WKFrameCopyProvisionalURL(WKFrameRef frameRef)
 {
-    return toCopiedURLRef(toWK(frameRef)->provisionalURL());
+    return toCopiedURLAPI(toImpl(frameRef)->provisionalURL());
 }
 
 WKURLRef WKFrameCopyURL(WKFrameRef frameRef)
 {
-    return toCopiedURLRef(toWK(frameRef)->url());
+    return toCopiedURLAPI(toImpl(frameRef)->url());
 }
 
 WKStringRef WKFrameCopyMIMEType(WKFrameRef frameRef)
 {
-    return toCopiedRef(toWK(frameRef)->mimeType());
+    return toCopiedAPI(toImpl(frameRef)->mimeType());
 }
 
 WKPageRef WKFrameGetPage(WKFrameRef frameRef)
 {
-    return toRef(toWK(frameRef)->page());
+    return toAPI(toImpl(frameRef)->page());
 }
 
 WKCertificateInfoRef WKFrameGetCertificateInfo(WKFrameRef frameRef)
 {
-    return toRef(toWK(frameRef)->certificateInfo());
+    return toAPI(toImpl(frameRef)->certificateInfo());
 }
diff --git a/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp b/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp
index 2c781d9..d44d0d3 100644
--- a/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp
+++ b/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp
@@ -33,20 +33,20 @@ using namespace WebKit;
 
 WKTypeID WKFramePolicyListenerGetTypeID()
 {
-    return toRef(WebFramePolicyListenerProxy::APIType);
+    return toAPI(WebFramePolicyListenerProxy::APIType);
 }
 
 void WKFramePolicyListenerUse(WKFramePolicyListenerRef policyListenerRef)
 {
-    toWK(policyListenerRef)->use();
+    toImpl(policyListenerRef)->use();
 }
 
 void WKFramePolicyListenerDownload(WKFramePolicyListenerRef policyListenerRef)
 {
-    toWK(policyListenerRef)->download();
+    toImpl(policyListenerRef)->download();
 }
 
 void WKFramePolicyListenerIgnore(WKFramePolicyListenerRef policyListenerRef)
 {
-    toWK(policyListenerRef)->ignore();
+    toImpl(policyListenerRef)->ignore();
 }
diff --git a/WebKit2/UIProcess/API/C/WKNavigationData.cpp b/WebKit2/UIProcess/API/C/WKNavigationData.cpp
index a71d4cb..90eb142 100644
--- a/WebKit2/UIProcess/API/C/WKNavigationData.cpp
+++ b/WebKit2/UIProcess/API/C/WKNavigationData.cpp
@@ -32,15 +32,15 @@ using namespace WebKit;
 
 WKTypeID WKNavigationDataGetTypeID()
 {
-    return toRef(WebNavigationData::APIType);
+    return toAPI(WebNavigationData::APIType);
 }
 
 WKStringRef WKNavigationDataCopyTitle(WKNavigationDataRef navigationDataRef)
 {
-    return toCopiedRef(toWK(navigationDataRef)->title());
+    return toCopiedAPI(toImpl(navigationDataRef)->title());
 }
 
 WKURLRef WKNavigationDataCopyURL(WKNavigationDataRef navigationDataRef)
 {
-    return toCopiedURLRef(toWK(navigationDataRef)->url());
+    return toCopiedURLAPI(toImpl(navigationDataRef)->url());
 }
diff --git a/WebKit2/UIProcess/API/C/WKPage.cpp b/WebKit2/UIProcess/API/C/WKPage.cpp
index 7f316bb..27d74e6 100644
--- a/WebKit2/UIProcess/API/C/WKPage.cpp
+++ b/WebKit2/UIProcess/API/C/WKPage.cpp
@@ -39,186 +39,186 @@ using namespace WebKit;
 
 WKTypeID WKPageGetTypeID()
 {
-    return toRef(WebPageProxy::APIType);
+    return toAPI(WebPageProxy::APIType);
 }
 
 WKPageNamespaceRef WKPageGetPageNamespace(WKPageRef pageRef)
 {
-    return toRef(toWK(pageRef)->pageNamespace());
+    return toAPI(toImpl(pageRef)->pageNamespace());
 }
 
 void WKPageLoadURL(WKPageRef pageRef, WKURLRef URLRef)
 {
-    toWK(pageRef)->loadURL(toWK(URLRef)->string());
+    toImpl(pageRef)->loadURL(toImpl(URLRef)->string());
 }
 
 void WKPageLoadURLRequest(WKPageRef pageRef, WKURLRequestRef urlRequestRef)
 {
-    toWK(pageRef)->loadURLRequest(toWK(urlRequestRef));    
+    toImpl(pageRef)->loadURLRequest(toImpl(urlRequestRef));    
 }
 
 void WKPageLoadHTMLString(WKPageRef pageRef, WKStringRef htmlStringRef, WKURLRef baseURLRef)
 {
-    toWK(pageRef)->loadHTMLString(toWTFString(htmlStringRef), toWTFString(baseURLRef));    
+    toImpl(pageRef)->loadHTMLString(toWTFString(htmlStringRef), toWTFString(baseURLRef));    
 }
 
 void WKPageLoadPlainTextString(WKPageRef pageRef, WKStringRef plainTextStringRef)
 {
-    toWK(pageRef)->loadPlainTextString(toWTFString(plainTextStringRef));    
+    toImpl(pageRef)->loadPlainTextString(toWTFString(plainTextStringRef));    
 }
 
 void WKPageStopLoading(WKPageRef pageRef)
 {
-    toWK(pageRef)->stopLoading();
+    toImpl(pageRef)->stopLoading();
 }
 
 void WKPageReload(WKPageRef pageRef)
 {
-    toWK(pageRef)->reload(false);
+    toImpl(pageRef)->reload(false);
 }
 
 void WKPageReloadFromOrigin(WKPageRef pageRef)
 {
-    toWK(pageRef)->reload(true);
+    toImpl(pageRef)->reload(true);
 }
 
 bool WKPageTryClose(WKPageRef pageRef)
 {
-    return toWK(pageRef)->tryClose();
+    return toImpl(pageRef)->tryClose();
 }
 
 void WKPageClose(WKPageRef pageRef)
 {
-    toWK(pageRef)->close();
+    toImpl(pageRef)->close();
 }
 
 bool WKPageIsClosed(WKPageRef pageRef)
 {
-    return toWK(pageRef)->isClosed();
+    return toImpl(pageRef)->isClosed();
 }
 
 void WKPageGoForward(WKPageRef pageRef)
 {
-    toWK(pageRef)->goForward();
+    toImpl(pageRef)->goForward();
 }
 
 bool WKPageCanGoForward(WKPageRef pageRef)
 {
-    return toWK(pageRef)->canGoForward();
+    return toImpl(pageRef)->canGoForward();
 }
 
 void WKPageGoBack(WKPageRef pageRef)
 {
-    toWK(pageRef)->goBack();
+    toImpl(pageRef)->goBack();
 }
 
 bool WKPageCanGoBack(WKPageRef pageRef)
 {
-    return toWK(pageRef)->canGoBack();
+    return toImpl(pageRef)->canGoBack();
 }
 
 void WKPageGoToBackForwardListItem(WKPageRef pageRef, WKBackForwardListItemRef itemRef)
 {
-    toWK(pageRef)->goToBackForwardItem(toWK(itemRef));
+    toImpl(pageRef)->goToBackForwardItem(toImpl(itemRef));
 }
 
 WKBackForwardListRef WKPageGetBackForwardList(WKPageRef pageRef)
 {
-    return toRef(toWK(pageRef)->backForwardList());
+    return toAPI(toImpl(pageRef)->backForwardList());
 }
 
 WKStringRef WKPageCopyTitle(WKPageRef pageRef)
 {
-    return toCopiedRef(toWK(pageRef)->pageTitle());
+    return toCopiedAPI(toImpl(pageRef)->pageTitle());
 }
 
 WKFrameRef WKPageGetMainFrame(WKPageRef pageRef)
 {
-    return toRef(toWK(pageRef)->mainFrame());
+    return toAPI(toImpl(pageRef)->mainFrame());
 }
 
 double WKPageGetEstimatedProgress(WKPageRef pageRef)
 {
-    return toWK(pageRef)->estimatedProgress();
+    return toImpl(pageRef)->estimatedProgress();
 }
 
 void WKPageSetCustomUserAgent(WKPageRef pageRef, WKStringRef userAgentRef)
 {
-    toWK(pageRef)->setCustomUserAgent(toWK(userAgentRef)->string());
+    toImpl(pageRef)->setCustomUserAgent(toImpl(userAgentRef)->string());
 }
 
 void WKPageTerminate(WKPageRef pageRef)
 {
-    toWK(pageRef)->terminateProcess();
+    toImpl(pageRef)->terminateProcess();
 }
 
 WKDataRef WKPageCopySessionState(WKPageRef pageRef)
 {
-    RefPtr<WebData> state = toWK(pageRef)->sessionState();
-    return toRef(state.release().releaseRef());
+    RefPtr<WebData> state = toImpl(pageRef)->sessionState();
+    return toAPI(state.release().releaseRef());
 }
 
 void WKPageRestoreFromSessionState(WKPageRef pageRef, WKDataRef sessionStateData)
 {
-    toWK(pageRef)->restoreFromSessionState(toWK(sessionStateData));
+    toImpl(pageRef)->restoreFromSessionState(toImpl(sessionStateData));
 }
 
 double WKPageGetTextZoomFactor(WKPageRef pageRef)
 {
-    return toWK(pageRef)->textZoomFactor();
+    return toImpl(pageRef)->textZoomFactor();
 }
 
 void WKPageSetTextZoomFactor(WKPageRef pageRef, double zoomFactor)
 {
-    toWK(pageRef)->setTextZoomFactor(zoomFactor);
+    toImpl(pageRef)->setTextZoomFactor(zoomFactor);
 }
 
 double WKPageGetPageZoomFactor(WKPageRef pageRef)
 {
-    return toWK(pageRef)->pageZoomFactor();
+    return toImpl(pageRef)->pageZoomFactor();
 }
 
 void WKPageSetPageZoomFactor(WKPageRef pageRef, double zoomFactor)
 {
-    toWK(pageRef)->setPageZoomFactor(zoomFactor);
+    toImpl(pageRef)->setPageZoomFactor(zoomFactor);
 }
 
 void WKPageSetPageAndTextZoomFactors(WKPageRef pageRef, double pageZoomFactor, double textZoomFactor)
 {
-    toWK(pageRef)->setPageAndTextZoomFactors(pageZoomFactor, textZoomFactor);
+    toImpl(pageRef)->setPageAndTextZoomFactors(pageZoomFactor, textZoomFactor);
 }
 
 void WKPageSetPageLoaderClient(WKPageRef pageRef, const WKPageLoaderClient* wkClient)
 {
     if (wkClient && wkClient->version)
         return;
-    toWK(pageRef)->initializeLoaderClient(wkClient);
+    toImpl(pageRef)->initializeLoaderClient(wkClient);
 }
 
 void WKPageSetPagePolicyClient(WKPageRef pageRef, const WKPagePolicyClient* wkClient)
 {
     if (wkClient && wkClient->version)
         return;
-    toWK(pageRef)->initializePolicyClient(wkClient);
+    toImpl(pageRef)->initializePolicyClient(wkClient);
 }
 
 void WKPageSetPageFormClient(WKPageRef pageRef, const WKPageFormClient* wkClient)
 {
     if (wkClient && wkClient->version)
         return;
-    toWK(pageRef)->initializeFormClient(wkClient);
+    toImpl(pageRef)->initializeFormClient(wkClient);
 }
 
 void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClient * wkClient)
 {
     if (wkClient && wkClient->version)
         return;
-    toWK(pageRef)->initializeUIClient(wkClient);
+    toImpl(pageRef)->initializeUIClient(wkClient);
 }
 
 void WKPageRunJavaScriptInMainFrame(WKPageRef pageRef, WKStringRef scriptRef, void* context, WKPageRunJavaScriptFunction callback)
 {
-    toWK(pageRef)->runJavaScriptInMainFrame(toWK(scriptRef)->string(), ScriptReturnValueCallback::create(context, callback));
+    toImpl(pageRef)->runJavaScriptInMainFrame(toImpl(scriptRef)->string(), ScriptReturnValueCallback::create(context, callback));
 }
 
 #ifdef __BLOCKS__
@@ -237,7 +237,7 @@ void WKPageRunJavaScriptInMainFrame_b(WKPageRef pageRef, WKStringRef scriptRef,
 
 void WKPageRenderTreeExternalRepresentation(WKPageRef pageRef, void* context, WKPageRenderTreeExternalRepresentationFunction callback)
 {
-    toWK(pageRef)->getRenderTreeExternalRepresentation(RenderTreeExternalRepresentationCallback::create(context, callback));
+    toImpl(pageRef)->getRenderTreeExternalRepresentation(RenderTreeExternalRepresentationCallback::create(context, callback));
 }
 
 #ifdef __BLOCKS__
@@ -256,7 +256,7 @@ void WKPageRenderTreeExternalRepresentation_b(WKPageRef pageRef, WKPageRenderTre
 
 void WKPageGetSourceForFrame(WKPageRef pageRef, WKFrameRef frameRef, void *context, WKPageGetSourceForFrameFunction callback)
 {
-    toWK(pageRef)->getSourceForFrame(toWK(frameRef), FrameSourceCallback::create(context, callback));
+    toImpl(pageRef)->getSourceForFrame(toImpl(frameRef), FrameSourceCallback::create(context, callback));
 }
 
 #ifdef __BLOCKS__
diff --git a/WebKit2/UIProcess/API/C/WKPageNamespace.cpp b/WebKit2/UIProcess/API/C/WKPageNamespace.cpp
index c5e21fe..e587a5f 100644
--- a/WebKit2/UIProcess/API/C/WKPageNamespace.cpp
+++ b/WebKit2/UIProcess/API/C/WKPageNamespace.cpp
@@ -34,15 +34,15 @@ using namespace WebKit;
 
 WKTypeID WKPageNamespaceGetTypeID()
 {
-    return toRef(WebPageNamespace::APIType);
+    return toAPI(WebPageNamespace::APIType);
 }
 
 WKPageNamespaceRef WKPageNamespaceCreate(WKContextRef ownerContextRef)
 {
-    return toRef(toWK(ownerContextRef)->createPageNamespace());
+    return toAPI(toImpl(ownerContextRef)->createPageNamespace());
 }
 
 WKContextRef WKPageNamespaceGetContext(WKPageNamespaceRef pageNamespaceRef)
 {
-    return toRef(toWK(pageNamespaceRef)->context());
+    return toAPI(toImpl(pageNamespaceRef)->context());
 }
diff --git a/WebKit2/UIProcess/API/C/WKPreferences.cpp b/WebKit2/UIProcess/API/C/WKPreferences.cpp
index 774455e..34716e9 100644
--- a/WebKit2/UIProcess/API/C/WKPreferences.cpp
+++ b/WebKit2/UIProcess/API/C/WKPreferences.cpp
@@ -34,147 +34,147 @@ using namespace WebKit;
 
 WKTypeID WKPreferencesGetTypeID()
 {
-    return toRef(WebPreferences::APIType);
+    return toAPI(WebPreferences::APIType);
 }
 
 WKPreferencesRef WKPreferencesCreate()
 {
     RefPtr<WebPreferences> preferences = WebPreferences::create();
-    return toRef(preferences.release().leakRef());
+    return toAPI(preferences.release().leakRef());
 }
 
 WKPreferencesRef WKPreferencesCreateCopy(WKPreferencesRef preferencesRef)
 {
-    RefPtr<WebPreferences> preferences = WebPreferences::copy(toWK(preferencesRef));
-    return toRef(preferences.release().releaseRef());
+    RefPtr<WebPreferences> preferences = WebPreferences::copy(toImpl(preferencesRef));
+    return toAPI(preferences.release().releaseRef());
 }
 
 void WKPreferencesSetJavaScriptEnabled(WKPreferencesRef preferencesRef, bool javaScriptEnabled)
 {
-    toWK(preferencesRef)->setJavaScriptEnabled(javaScriptEnabled);
+    toImpl(preferencesRef)->setJavaScriptEnabled(javaScriptEnabled);
 }
 
 bool WKPreferencesGetJavaScriptEnabled(WKPreferencesRef preferencesRef)
 {
-    return toWK(preferencesRef)->javaScriptEnabled();
+    return toImpl(preferencesRef)->javaScriptEnabled();
 }
 
 void WKPreferencesSetLoadsImagesAutomatically(WKPreferencesRef preferencesRef, bool loadsImagesAutomatically)
 {
-    toWK(preferencesRef)->setLoadsImagesAutomatically(loadsImagesAutomatically);
+    toImpl(preferencesRef)->setLoadsImagesAutomatically(loadsImagesAutomatically);
 }
 
 bool WKPreferencesGetLoadsImagesAutomatically(WKPreferencesRef preferencesRef)
 {
-    return toWK(preferencesRef)->loadsImagesAutomatically();
+    return toImpl(preferencesRef)->loadsImagesAutomatically();
 }
 
 void WKPreferencesSetOfflineWebApplicationCacheEnabled(WKPreferencesRef preferencesRef, bool offlineWebApplicationCacheEnabled)
 {
-    toWK(preferencesRef)->setOfflineWebApplicationCacheEnabled(offlineWebApplicationCacheEnabled);
+    toImpl(preferencesRef)->setOfflineWebApplicationCacheEnabled(offlineWebApplicationCacheEnabled);
 }
 
 bool WKPreferencesGetOfflineWebApplicationCacheEnabled(WKPreferencesRef preferencesRef)
 {
-    return toWK(preferencesRef)->offlineWebApplicationCacheEnabled();
+    return toImpl(preferencesRef)->offlineWebApplicationCacheEnabled();
 }
 
 void WKPreferencesSetLocalStorageEnabled(WKPreferencesRef preferencesRef, bool localStorageEnabled)
 {
-    toWK(preferencesRef)->setLocalStorageEnabled(localStorageEnabled);
+    toImpl(preferencesRef)->setLocalStorageEnabled(localStorageEnabled);
 }
 
 bool WKPreferencesGetLocalStorageEnabled(WKPreferencesRef preferencesRef)
 {
-    return toWK(preferencesRef)->localStorageEnabled();
+    return toImpl(preferencesRef)->localStorageEnabled();
 }
 
 void WKPreferencesSetXSSAuditorEnabled(WKPreferencesRef preferencesRef, bool xssAuditorEnabled)
 {
-    toWK(preferencesRef)->setXSSAuditorEnabled(xssAuditorEnabled);
+    toImpl(preferencesRef)->setXSSAuditorEnabled(xssAuditorEnabled);
 }
 
 bool WKPreferencesGetXSSAuditorEnabled(WKPreferencesRef preferencesRef)
 {
-    return toWK(preferencesRef)->xssAuditorEnabled();
+    return toImpl(preferencesRef)->xssAuditorEnabled();
 }
 
 void WKPreferencesSetFrameFlatteningEnabled(WKPreferencesRef preferencesRef, bool frameFlatteningEnabled)
 {
-    toWK(preferencesRef)->setFrameFlatteningEnabled(frameFlatteningEnabled);
+    toImpl(preferencesRef)->setFrameFlatteningEnabled(frameFlatteningEnabled);
 }
 
 bool WKPreferencesGetFrameFlatteningEnabled(WKPreferencesRef preferencesRef)
 {
-    return toWK(preferencesRef)->frameFlatteningEnabled();
+    return toImpl(preferencesRef)->frameFlatteningEnabled();
 }
 
 void WKPreferencesSetPluginsEnabled(WKPreferencesRef preferencesRef, bool pluginsEnabled)
 {
-    toWK(preferencesRef)->setPluginsEnabled(pluginsEnabled);
+    toImpl(preferencesRef)->setPluginsEnabled(pluginsEnabled);
 }
 
 bool WKPreferencesGetPluginsEnabled(WKPreferencesRef preferencesRef)
 {
-    return toWK(preferencesRef)->pluginsEnabled();
+    return toImpl(preferencesRef)->pluginsEnabled();
 }
 
 void WKPreferencesSetStandardFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
 {
-    toWK(preferencesRef)->setStandardFontFamily(toWTFString(family));
+    toImpl(preferencesRef)->setStandardFontFamily(toWTFString(family));
 }
 
 WKStringRef WKPreferencesCopyStandardFontFamily(WKPreferencesRef preferencesRef)
 {
-    return toCopiedRef(toWK(preferencesRef)->standardFontFamily());
+    return toCopiedAPI(toImpl(preferencesRef)->standardFontFamily());
 }
 
 void WKPreferencesSetFixedFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
 {
-    toWK(preferencesRef)->setFixedFontFamily(toWTFString(family));
+    toImpl(preferencesRef)->setFixedFontFamily(toWTFString(family));
 }
 
 WKStringRef WKPreferencesCopyFixedFontFamily(WKPreferencesRef preferencesRef)
 {
-    return toCopiedRef(toWK(preferencesRef)->fixedFontFamily());
+    return toCopiedAPI(toImpl(preferencesRef)->fixedFontFamily());
 }
 
 void WKPreferencesSetSerifFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
 {
-    toWK(preferencesRef)->setSerifFontFamily(toWTFString(family));
+    toImpl(preferencesRef)->setSerifFontFamily(toWTFString(family));
 }
 
 WKStringRef WKPreferencesCopySerifFontFamily(WKPreferencesRef preferencesRef)
 {
-    return toCopiedRef(toWK(preferencesRef)->serifFontFamily());
+    return toCopiedAPI(toImpl(preferencesRef)->serifFontFamily());
 }
 
 void WKPreferencesSetSansSerifFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
 {
-    toWK(preferencesRef)->setSansSerifFontFamily(toWTFString(family));
+    toImpl(preferencesRef)->setSansSerifFontFamily(toWTFString(family));
 }
 
 WKStringRef WKPreferencesCopySansSerifFontFamily(WKPreferencesRef preferencesRef)
 {
-    return toCopiedRef(toWK(preferencesRef)->sansSerifFontFamily());
+    return toCopiedAPI(toImpl(preferencesRef)->sansSerifFontFamily());
 }
 
 void WKPreferencesSetCursiveFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
 {
-    toWK(preferencesRef)->setCursiveFontFamily(toWTFString(family));
+    toImpl(preferencesRef)->setCursiveFontFamily(toWTFString(family));
 }
 
 WKStringRef WKPreferencesCopyCursiveFontFamily(WKPreferencesRef preferencesRef)
 {
-    return toCopiedRef(toWK(preferencesRef)->cursiveFontFamily());
+    return toCopiedAPI(toImpl(preferencesRef)->cursiveFontFamily());
 }
 
 void WKPreferencesSetFantasyFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
 {
-    toWK(preferencesRef)->setFantasyFontFamily(toWTFString(family));
+    toImpl(preferencesRef)->setFantasyFontFamily(toWTFString(family));
 }
 
 WKStringRef WKPreferencesCopyFantasyFontFamily(WKPreferencesRef preferencesRef)
 {
-    return toCopiedRef(toWK(preferencesRef)->fantasyFontFamily());
+    return toCopiedAPI(toImpl(preferencesRef)->fantasyFontFamily());
 }
diff --git a/WebKit2/UIProcess/API/C/WKPreferencesPrivate.cpp b/WebKit2/UIProcess/API/C/WKPreferencesPrivate.cpp
index 157059d..0bfd09c 100644
--- a/WebKit2/UIProcess/API/C/WKPreferencesPrivate.cpp
+++ b/WebKit2/UIProcess/API/C/WKPreferencesPrivate.cpp
@@ -58,12 +58,12 @@ void WKPreferencesSetFontSmoothingLevel(WKPreferencesRef preferencesRef, WKFontS
             level = FontSmoothingLevelMedium;
             break;
     }
-    toWK(preferencesRef)->setFontSmoothingLevel(level);
+    toImpl(preferencesRef)->setFontSmoothingLevel(level);
 }
 
 WKFontSmoothingLevel WKPreferencesGetFontSmoothingLevel(WKPreferencesRef preferencesRef)
 {
-    FontSmoothingLevel level = toWK(preferencesRef)->fontSmoothingLevel();
+    FontSmoothingLevel level = toImpl(preferencesRef)->fontSmoothingLevel();
     switch (level) {
         case FontSmoothingLevelNoSubpixelAntiAliasing:
             return kWKFontSmoothingLevelNoSubpixelAntiAliasing;
diff --git a/WebKit2/UIProcess/API/C/win/WKContextWin.cpp b/WebKit2/UIProcess/API/C/win/WKContextWin.cpp
index 65f0611..9906c81 100644
--- a/WebKit2/UIProcess/API/C/win/WKContextWin.cpp
+++ b/WebKit2/UIProcess/API/C/win/WKContextWin.cpp
@@ -33,5 +33,5 @@ using namespace WebKit;
 
 void WKContextSetShouldPaintNativeControls(WKContextRef contextRef, bool b)
 {
-    toWK(contextRef)->setShouldPaintNativeControls(b);
+    toImpl(contextRef)->setShouldPaintNativeControls(b);
 }
diff --git a/WebKit2/UIProcess/API/C/win/WKView.cpp b/WebKit2/UIProcess/API/C/win/WKView.cpp
index 60a9df4..d1a9d99 100644
--- a/WebKit2/UIProcess/API/C/win/WKView.cpp
+++ b/WebKit2/UIProcess/API/C/win/WKView.cpp
@@ -32,36 +32,36 @@ using namespace WebKit;
 
 WKTypeID WKViewGetTypeID()
 {
-    return toRef(APIObject::TypeView);
+    return toAPI(APIObject::TypeView);
 }
 
 WKViewRef WKViewCreate(RECT rect, WKPageNamespaceRef pageNamespaceRef, HWND hostWindow)
 {
-    RefPtr<WebView> view = WebView::create(rect, toWK(pageNamespaceRef), hostWindow);
-    return toRef(view.release().releaseRef());
+    RefPtr<WebView> view = WebView::create(rect, toImpl(pageNamespaceRef), hostWindow);
+    return toAPI(view.release().releaseRef());
 }
 
 HWND WKViewGetWindow(WKViewRef viewRef)
 {
-    return toWK(viewRef)->window();
+    return toImpl(viewRef)->window();
 }
 
 HWND WKViewGetHostWindow(WKViewRef viewRef)
 {
-    return toWK(viewRef)->hostWindow();
+    return toImpl(viewRef)->hostWindow();
 }
 
 WKPageRef WKViewGetPage(WKViewRef viewRef)
 {
-    return toRef(toWK(viewRef)->page());
+    return toAPI(toImpl(viewRef)->page());
 }
 
 void WKViewSetHostWindow(WKViewRef viewRef, HWND hostWindow)
 {
-    toWK(viewRef)->setHostWindow(hostWindow);
+    toImpl(viewRef)->setHostWindow(hostWindow);
 }
 
 void WKViewWindowAncestryDidChange(WKViewRef viewRef)
 {
-    toWK(viewRef)->windowAncestryDidChange();
+    toImpl(viewRef)->windowAncestryDidChange();
 }
diff --git a/WebKit2/UIProcess/API/cpp/qt/WKStringQt.cpp b/WebKit2/UIProcess/API/cpp/qt/WKStringQt.cpp
index ec391cf..d53c41e 100644
--- a/WebKit2/UIProcess/API/cpp/qt/WKStringQt.cpp
+++ b/WebKit2/UIProcess/API/cpp/qt/WKStringQt.cpp
@@ -37,6 +37,6 @@ QString WKStringCopyQString(WKStringRef stringRef)
 {
     if (!stringRef)
         return QString();
-    const WTF::String& string = toWK(stringRef)->string();
+    const WTF::String& string = toImpl(stringRef)->string();
     return QString(reinterpret_cast<const QChar*>(string.characters()), string.length());
 }
diff --git a/WebKit2/UIProcess/API/cpp/qt/WKURLQt.cpp b/WebKit2/UIProcess/API/cpp/qt/WKURLQt.cpp
index 73b0048..7438bad 100644
--- a/WebKit2/UIProcess/API/cpp/qt/WKURLQt.cpp
+++ b/WebKit2/UIProcess/API/cpp/qt/WKURLQt.cpp
@@ -37,6 +37,6 @@ QUrl WKURLCopyQUrl(WKURLRef urlRef)
 {
     if (!urlRef)
         return QUrl();
-    const WTF::String& string = toWK(urlRef)->string();
+    const WTF::String& string = toImpl(urlRef)->string();
     return QUrl(QString(reinterpret_cast<const QChar*>(string.characters()), string.length()));
 }
diff --git a/WebKit2/UIProcess/API/mac/PageClientImpl.mm b/WebKit2/UIProcess/API/mac/PageClientImpl.mm
index e0a5009..b47f310 100644
--- a/WebKit2/UIProcess/API/mac/PageClientImpl.mm
+++ b/WebKit2/UIProcess/API/mac/PageClientImpl.mm
@@ -93,7 +93,7 @@ namespace WebKit {
 
 NSString* nsStringFromWebCoreString(const String& string)
 {
-    return string.impl() ? HardAutorelease(WKStringCopyCFString(0, toRef(string.impl()))) : @"";
+    return string.impl() ? HardAutorelease(WKStringCopyCFString(0, toAPI(string.impl()))) : @"";
 }
 
 PassOwnPtr<PageClientImpl> PageClientImpl::create(WKView* wkView)
diff --git a/WebKit2/UIProcess/API/mac/WKView.mm b/WebKit2/UIProcess/API/mac/WKView.mm
index 7ba928e..0c2e0f8 100644
--- a/WebKit2/UIProcess/API/mac/WKView.mm
+++ b/WebKit2/UIProcess/API/mac/WKView.mm
@@ -106,7 +106,7 @@ struct EditCommandState {
     _data = [[WKViewData alloc] init];
 
     _data->_pageClient = PageClientImpl::create(self);
-    _data->_page = toWK(pageNamespaceRef)->createWebPage();
+    _data->_page = toImpl(pageNamespaceRef)->createWebPage();
     _data->_page->setPageClient(_data->_pageClient.get());
     _data->_page->setDrawingArea(ChunkedUpdateDrawingAreaProxy::create(self));
     _data->_page->initializeWebPage(IntSize(frame.size));
@@ -121,7 +121,7 @@ struct EditCommandState {
 - (id)initWithFrame:(NSRect)frame
 {
     WebContext* context = WebContext::sharedProcessContext();
-    self = [self initWithFrame:frame pageNamespaceRef:toRef(context->createPageNamespace())];
+    self = [self initWithFrame:frame pageNamespaceRef:toAPI(context->createPageNamespace())];
     if (!self)
         return nil;
 
@@ -138,7 +138,7 @@ struct EditCommandState {
 
 - (WKPageRef)pageRef
 {
-    return toRef(_data->_page.get());
+    return toAPI(_data->_page.get());
 }
 
 - (BOOL)acceptsFirstResponder
diff --git a/WebKit2/UIProcess/API/qt/ClientImpl.cpp b/WebKit2/UIProcess/API/qt/ClientImpl.cpp
index c29ced9..8797495 100644
--- a/WebKit2/UIProcess/API/qt/ClientImpl.cpp
+++ b/WebKit2/UIProcess/API/qt/ClientImpl.cpp
@@ -56,7 +56,7 @@ void qt_wk_didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef use
 {
     if (!WKFrameIsMainFrame(frame))
         return;
-    WebFrameProxy* wkframe = toWK(frame);
+    WebFrameProxy* wkframe = toImpl(frame);
     QString urlStr(wkframe->url());
     QUrl qUrl = urlStr;
     emit toQWKPage(clientInfo)->urlChanged(qUrl);
diff --git a/WebKit2/UIProcess/API/qt/qwkpage.cpp b/WebKit2/UIProcess/API/qt/qwkpage.cpp
index 0f10f13..1c6e4ed 100644
--- a/WebKit2/UIProcess/API/qt/qwkpage.cpp
+++ b/WebKit2/UIProcess/API/qt/qwkpage.cpp
@@ -55,7 +55,7 @@ QWKPagePrivate::QWKPagePrivate(QWKPage* qq, WKPageNamespaceRef namespaceRef)
     WebPlatformStrategies::initialize();
 
     memset(actions, 0, sizeof(actions));
-    page = toWK(namespaceRef)->createWebPage();
+    page = toImpl(namespaceRef)->createWebPage();
     page->setPageClient(this);
     pageNamespaceRef = namespaceRef;
 }
@@ -364,7 +364,7 @@ void QWKPage::timerEvent(QTimerEvent* ev)
 
 WKPageRef QWKPage::pageRef() const
 {
-    return toRef(d->page.get());
+    return toAPI(d->page.get());
 }
 
 QWKPreferences* QWKPage::preferences() const
diff --git a/WebKit2/UIProcess/GenericCallback.h b/WebKit2/UIProcess/GenericCallback.h
index 04a186c..f7befe5 100644
--- a/WebKit2/UIProcess/GenericCallback.h
+++ b/WebKit2/UIProcess/GenericCallback.h
@@ -53,7 +53,7 @@ public:
     {
         ASSERT(m_callback);
 
-        m_callback(toRef(returnValue), 0, m_context);
+        m_callback(toAPI(returnValue), 0, m_context);
 
         m_callback = 0;
     }
@@ -63,7 +63,7 @@ public:
         ASSERT(m_callback);
 
         RefPtr<WebError> error = WebError::create();
-        m_callback(0, toRef(error.get()), m_context);
+        m_callback(0, toAPI(error.get()), m_context);
         
         m_callback = 0;
     }
diff --git a/WebKit2/UIProcess/WebContextInjectedBundleClient.cpp b/WebKit2/UIProcess/WebContextInjectedBundleClient.cpp
index d030318..2fba9d9 100644
--- a/WebKit2/UIProcess/WebContextInjectedBundleClient.cpp
+++ b/WebKit2/UIProcess/WebContextInjectedBundleClient.cpp
@@ -50,7 +50,7 @@ void WebContextInjectedBundleClient::didReceiveMessageFromInjectedBundle(WebCont
     if (!m_client.didReceiveMessageFromInjectedBundle)
         return;
 
-    m_client.didReceiveMessageFromInjectedBundle(toRef(context), toRef(messageName.impl()), toRef(messageBody), m_client.clientInfo);
+    m_client.didReceiveMessageFromInjectedBundle(toAPI(context), toAPI(messageName.impl()), toAPI(messageBody), m_client.clientInfo);
 }
 
 void WebContextInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle(WebContext* context, const String& messageName, APIObject* messageBody, RefPtr<APIObject>& returnData)
@@ -59,8 +59,8 @@ void WebContextInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBun
         return;
 
     WKTypeRef returnDataRef = 0;
-    m_client.didReceiveSynchronousMessageFromInjectedBundle(toRef(context), toRef(messageName.impl()), toRef(messageBody), &returnDataRef, m_client.clientInfo);
-    returnData = adoptRef(toWK(returnDataRef));
+    m_client.didReceiveSynchronousMessageFromInjectedBundle(toAPI(context), toAPI(messageName.impl()), toAPI(messageBody), &returnDataRef, m_client.clientInfo);
+    returnData = adoptRef(toImpl(returnDataRef));
 }
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/WebFormClient.cpp b/WebKit2/UIProcess/WebFormClient.cpp
index 4e657be..11eaf0d 100644
--- a/WebKit2/UIProcess/WebFormClient.cpp
+++ b/WebKit2/UIProcess/WebFormClient.cpp
@@ -55,7 +55,7 @@ bool WebFormClient::willSubmitForm(WebPageProxy* page, WebFrameProxy* frame, Web
         map.set(textFieldValues[i].first, WebString::create(textFieldValues[i].second));
     RefPtr<ImmutableDictionary> textFieldsMap = ImmutableDictionary::adopt(map);
 
-    m_pageFormClient.willSubmitForm(toRef(page), toRef(frame), toRef(sourceFrame), toRef(textFieldsMap.get()), toRef(userData), toRef(listener), m_pageFormClient.clientInfo);
+    m_pageFormClient.willSubmitForm(toAPI(page), toAPI(frame), toAPI(sourceFrame), toAPI(textFieldsMap.get()), toAPI(userData), toAPI(listener), m_pageFormClient.clientInfo);
     return true;
 }
 
diff --git a/WebKit2/UIProcess/WebHistoryClient.cpp b/WebKit2/UIProcess/WebHistoryClient.cpp
index 8175b12..12056ee 100644
--- a/WebKit2/UIProcess/WebHistoryClient.cpp
+++ b/WebKit2/UIProcess/WebHistoryClient.cpp
@@ -52,7 +52,7 @@ void WebHistoryClient::didNavigateWithNavigationData(WebContext* context, WebPag
         return;
 
     RefPtr<WebNavigationData> navigationData = WebNavigationData::create(navigationDataStore); 
-    m_contextHistoryClient.didNavigateWithNavigationData(toRef(context), toRef(page), toRef(navigationData.get()), toRef(frame), m_contextHistoryClient.clientInfo);
+    m_contextHistoryClient.didNavigateWithNavigationData(toAPI(context), toAPI(page), toAPI(navigationData.get()), toAPI(frame), m_contextHistoryClient.clientInfo);
 }
 
 void WebHistoryClient::didPerformClientRedirect(WebContext* context, WebPageProxy* page, const String& sourceURL, const String& destinationURL, WebFrameProxy* frame)
@@ -60,7 +60,7 @@ void WebHistoryClient::didPerformClientRedirect(WebContext* context, WebPageProx
     if (!m_contextHistoryClient.didPerformClientRedirect)
         return;
 
-    m_contextHistoryClient.didPerformClientRedirect(toRef(context), toRef(page), toURLRef(sourceURL.impl()), toURLRef(destinationURL.impl()), toRef(frame), m_contextHistoryClient.clientInfo);
+    m_contextHistoryClient.didPerformClientRedirect(toAPI(context), toAPI(page), toURLRef(sourceURL.impl()), toURLRef(destinationURL.impl()), toAPI(frame), m_contextHistoryClient.clientInfo);
 }
 
 void WebHistoryClient::didPerformServerRedirect(WebContext* context, WebPageProxy* page, const String& sourceURL, const String& destinationURL, WebFrameProxy* frame)
@@ -68,7 +68,7 @@ void WebHistoryClient::didPerformServerRedirect(WebContext* context, WebPageProx
     if (!m_contextHistoryClient.didPerformServerRedirect)
         return;
 
-    m_contextHistoryClient.didPerformServerRedirect(toRef(context), toRef(page), toURLRef(sourceURL.impl()), toURLRef(destinationURL.impl()), toRef(frame), m_contextHistoryClient.clientInfo);
+    m_contextHistoryClient.didPerformServerRedirect(toAPI(context), toAPI(page), toURLRef(sourceURL.impl()), toURLRef(destinationURL.impl()), toAPI(frame), m_contextHistoryClient.clientInfo);
 }
 
 void WebHistoryClient::didUpdateHistoryTitle(WebContext* context, WebPageProxy* page, const String& title, const String& url, WebFrameProxy* frame)
@@ -76,7 +76,7 @@ void WebHistoryClient::didUpdateHistoryTitle(WebContext* context, WebPageProxy*
     if (!m_contextHistoryClient.didUpdateHistoryTitle)
         return;
 
-    m_contextHistoryClient.didUpdateHistoryTitle(toRef(context), toRef(page), toRef(title.impl()), toURLRef(url.impl()), toRef(frame), m_contextHistoryClient.clientInfo);
+    m_contextHistoryClient.didUpdateHistoryTitle(toAPI(context), toAPI(page), toAPI(title.impl()), toURLRef(url.impl()), toAPI(frame), m_contextHistoryClient.clientInfo);
 }
 
 void WebHistoryClient::populateVisitedLinks(WebContext* context)
@@ -84,7 +84,7 @@ void WebHistoryClient::populateVisitedLinks(WebContext* context)
     if (!m_contextHistoryClient.populateVisitedLinks)
         return;
 
-    m_contextHistoryClient.populateVisitedLinks(toRef(context), m_contextHistoryClient.clientInfo);
+    m_contextHistoryClient.populateVisitedLinks(toAPI(context), m_contextHistoryClient.clientInfo);
 }
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/WebLoaderClient.cpp b/WebKit2/UIProcess/WebLoaderClient.cpp
index f4c5895..ca340ea 100644
--- a/WebKit2/UIProcess/WebLoaderClient.cpp
+++ b/WebKit2/UIProcess/WebLoaderClient.cpp
@@ -48,7 +48,7 @@ void WebLoaderClient::didStartProvisionalLoadForFrame(WebPageProxy* page, WebFra
     if (!m_pageLoaderClient.didStartProvisionalLoadForFrame)
         return;
 
-    m_pageLoaderClient.didStartProvisionalLoadForFrame(toRef(page), toRef(frame), toRef(userData), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didStartProvisionalLoadForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame(WebPageProxy* page, WebFrameProxy* frame, APIObject* userData)
@@ -56,7 +56,7 @@ void WebLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame(WebPage
     if (!m_pageLoaderClient.didReceiveServerRedirectForProvisionalLoadForFrame)
         return;
 
-    m_pageLoaderClient.didReceiveServerRedirectForProvisionalLoadForFrame(toRef(page), toRef(frame), toRef(userData), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didReceiveServerRedirectForProvisionalLoadForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::didFailProvisionalLoadWithErrorForFrame(WebPageProxy* page, WebFrameProxy* frame, APIObject* userData)
@@ -64,7 +64,7 @@ void WebLoaderClient::didFailProvisionalLoadWithErrorForFrame(WebPageProxy* page
     if (!m_pageLoaderClient.didFailProvisionalLoadWithErrorForFrame)
         return;
 
-    m_pageLoaderClient.didFailProvisionalLoadWithErrorForFrame(toRef(page), toRef(frame), toRef(userData), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didFailProvisionalLoadWithErrorForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::didCommitLoadForFrame(WebPageProxy* page, WebFrameProxy* frame, APIObject* userData)
@@ -72,7 +72,7 @@ void WebLoaderClient::didCommitLoadForFrame(WebPageProxy* page, WebFrameProxy* f
     if (!m_pageLoaderClient.didCommitLoadForFrame)
         return;
 
-    m_pageLoaderClient.didCommitLoadForFrame(toRef(page), toRef(frame), toRef(userData), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didCommitLoadForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::didFinishDocumentLoadForFrame(WebPageProxy* page, WebFrameProxy* frame, APIObject* userData)
@@ -80,7 +80,7 @@ void WebLoaderClient::didFinishDocumentLoadForFrame(WebPageProxy* page, WebFrame
     if (!m_pageLoaderClient.didFinishDocumentLoadForFrame)
         return;
 
-    m_pageLoaderClient.didFinishDocumentLoadForFrame(toRef(page), toRef(frame), toRef(userData), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didFinishDocumentLoadForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::didFinishLoadForFrame(WebPageProxy* page, WebFrameProxy* frame, APIObject* userData)
@@ -88,7 +88,7 @@ void WebLoaderClient::didFinishLoadForFrame(WebPageProxy* page, WebFrameProxy* f
     if (!m_pageLoaderClient.didFinishLoadForFrame)
         return;
 
-    m_pageLoaderClient.didFinishLoadForFrame(toRef(page), toRef(frame), toRef(userData), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didFinishLoadForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::didFailLoadWithErrorForFrame(WebPageProxy* page, WebFrameProxy* frame, APIObject* userData)
@@ -96,7 +96,7 @@ void WebLoaderClient::didFailLoadWithErrorForFrame(WebPageProxy* page, WebFrameP
     if (!m_pageLoaderClient.didFailLoadWithErrorForFrame)
         return;
 
-    m_pageLoaderClient.didFailLoadWithErrorForFrame(toRef(page), toRef(frame), toRef(userData), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didFailLoadWithErrorForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::didReceiveTitleForFrame(WebPageProxy* page, const String& title, WebFrameProxy* frame, APIObject* userData)
@@ -104,7 +104,7 @@ void WebLoaderClient::didReceiveTitleForFrame(WebPageProxy* page, const String&
     if (!m_pageLoaderClient.didReceiveTitleForFrame)
         return;
 
-    m_pageLoaderClient.didReceiveTitleForFrame(toRef(page), toRef(title.impl()), toRef(frame), toRef(userData), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didReceiveTitleForFrame(toAPI(page), toAPI(title.impl()), toAPI(frame), toAPI(userData), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::didFirstLayoutForFrame(WebPageProxy* page, WebFrameProxy* frame, APIObject* userData)
@@ -112,7 +112,7 @@ void WebLoaderClient::didFirstLayoutForFrame(WebPageProxy* page, WebFrameProxy*
     if (!m_pageLoaderClient.didFirstLayoutForFrame)
         return;
 
-    m_pageLoaderClient.didFirstLayoutForFrame(toRef(page), toRef(frame), toRef(userData), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didFirstLayoutForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame(WebPageProxy* page, WebFrameProxy* frame, APIObject* userData)
@@ -120,7 +120,7 @@ void WebLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame(WebPageProxy* page,
     if (!m_pageLoaderClient.didFirstVisuallyNonEmptyLayoutForFrame)
         return;
 
-    m_pageLoaderClient.didFirstVisuallyNonEmptyLayoutForFrame(toRef(page), toRef(frame), toRef(userData), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didFirstVisuallyNonEmptyLayoutForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::didRemoveFrameFromHierarchy(WebPageProxy* page, WebFrameProxy* frame, APIObject* userData)
@@ -128,7 +128,7 @@ void WebLoaderClient::didRemoveFrameFromHierarchy(WebPageProxy* page, WebFramePr
     if (!m_pageLoaderClient.didRemoveFrameFromHierarchy)
         return;
 
-    m_pageLoaderClient.didRemoveFrameFromHierarchy(toRef(page), toRef(frame), toRef(userData), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didRemoveFrameFromHierarchy(toAPI(page), toAPI(frame), toAPI(userData), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::didStartProgress(WebPageProxy* page)
@@ -136,7 +136,7 @@ void WebLoaderClient::didStartProgress(WebPageProxy* page)
     if (!m_pageLoaderClient.didStartProgress)
         return;
 
-    m_pageLoaderClient.didStartProgress(toRef(page), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didStartProgress(toAPI(page), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::didChangeProgress(WebPageProxy* page)
@@ -144,7 +144,7 @@ void WebLoaderClient::didChangeProgress(WebPageProxy* page)
     if (!m_pageLoaderClient.didChangeProgress)
         return;
 
-    m_pageLoaderClient.didChangeProgress(toRef(page), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didChangeProgress(toAPI(page), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::didFinishProgress(WebPageProxy* page)
@@ -152,7 +152,7 @@ void WebLoaderClient::didFinishProgress(WebPageProxy* page)
     if (!m_pageLoaderClient.didFinishProgress)
         return;
 
-    m_pageLoaderClient.didFinishProgress(toRef(page), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didFinishProgress(toAPI(page), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::didBecomeUnresponsive(WebPageProxy* page)
@@ -160,7 +160,7 @@ void WebLoaderClient::didBecomeUnresponsive(WebPageProxy* page)
     if (!m_pageLoaderClient.didBecomeUnresponsive)
         return;
 
-    m_pageLoaderClient.didBecomeUnresponsive(toRef(page), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didBecomeUnresponsive(toAPI(page), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::didBecomeResponsive(WebPageProxy* page)
@@ -168,7 +168,7 @@ void WebLoaderClient::didBecomeResponsive(WebPageProxy* page)
     if (!m_pageLoaderClient.didBecomeResponsive)
         return;
 
-    m_pageLoaderClient.didBecomeResponsive(toRef(page), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didBecomeResponsive(toAPI(page), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::processDidExit(WebPageProxy* page)
@@ -176,7 +176,7 @@ void WebLoaderClient::processDidExit(WebPageProxy* page)
     if (!m_pageLoaderClient.processDidExit)
         return;
 
-    m_pageLoaderClient.processDidExit(toRef(page), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.processDidExit(toAPI(page), m_pageLoaderClient.clientInfo);
 }
 
 void WebLoaderClient::didChangeBackForwardList(WebPageProxy* page)
@@ -184,7 +184,7 @@ void WebLoaderClient::didChangeBackForwardList(WebPageProxy* page)
     if (!m_pageLoaderClient.didChangeBackForwardList)
         return;
 
-    m_pageLoaderClient.didChangeBackForwardList(toRef(page), m_pageLoaderClient.clientInfo);
+    m_pageLoaderClient.didChangeBackForwardList(toAPI(page), m_pageLoaderClient.clientInfo);
 }
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/WebPolicyClient.cpp b/WebKit2/UIProcess/WebPolicyClient.cpp
index b359cd6..57a835f 100644
--- a/WebKit2/UIProcess/WebPolicyClient.cpp
+++ b/WebKit2/UIProcess/WebPolicyClient.cpp
@@ -50,7 +50,7 @@ bool WebPolicyClient::decidePolicyForNavigationAction(WebPageProxy* page, Naviga
     if (!m_pagePolicyClient.decidePolicyForNavigationAction)
         return false;
 
-    m_pagePolicyClient.decidePolicyForNavigationAction(toRef(page), toRef(type), toRef(modifiers), toRef(mouseButton), toURLRef(url.impl()), toRef(frame), toRef(listener), m_pagePolicyClient.clientInfo);
+    m_pagePolicyClient.decidePolicyForNavigationAction(toAPI(page), toAPI(type), toAPI(modifiers), toAPI(mouseButton), toURLRef(url.impl()), toAPI(frame), toAPI(listener), m_pagePolicyClient.clientInfo);
     return true;
 }
 
@@ -59,7 +59,7 @@ bool WebPolicyClient::decidePolicyForNewWindowAction(WebPageProxy* page, Navigat
     if (!m_pagePolicyClient.decidePolicyForNewWindowAction)
         return false;
 
-    m_pagePolicyClient.decidePolicyForNewWindowAction(toRef(page), toRef(type), toRef(modifiers), toRef(mouseButton), toURLRef(url.impl()), toRef(frame), toRef(listener), m_pagePolicyClient.clientInfo);
+    m_pagePolicyClient.decidePolicyForNewWindowAction(toAPI(page), toAPI(type), toAPI(modifiers), toAPI(mouseButton), toURLRef(url.impl()), toAPI(frame), toAPI(listener), m_pagePolicyClient.clientInfo);
     return true;
 }
 
@@ -68,7 +68,7 @@ bool WebPolicyClient::decidePolicyForMIMEType(WebPageProxy* page, const String&
     if (!m_pagePolicyClient.decidePolicyForMIMEType)
         return false;
 
-    m_pagePolicyClient.decidePolicyForMIMEType(toRef(page), toRef(MIMEType.impl()), toURLRef(url.impl()), toRef(frame), toRef(listener), m_pagePolicyClient.clientInfo);
+    m_pagePolicyClient.decidePolicyForMIMEType(toAPI(page), toAPI(MIMEType.impl()), toURLRef(url.impl()), toAPI(frame), toAPI(listener), m_pagePolicyClient.clientInfo);
     return true;
 }
 
diff --git a/WebKit2/UIProcess/WebUIClient.cpp b/WebKit2/UIProcess/WebUIClient.cpp
index 9fbe53f..ba25f96 100644
--- a/WebKit2/UIProcess/WebUIClient.cpp
+++ b/WebKit2/UIProcess/WebUIClient.cpp
@@ -54,7 +54,7 @@ PassRefPtr<WebPageProxy> WebUIClient::createNewPage(WebPageProxy* page)
     if (!m_pageUIClient.createNewPage)
         return 0;
     
-    return adoptRef(toWK(m_pageUIClient.createNewPage(toRef(page), m_pageUIClient.clientInfo)));
+    return adoptRef(toImpl(m_pageUIClient.createNewPage(toAPI(page), m_pageUIClient.clientInfo)));
 } 
 
 void WebUIClient::showPage(WebPageProxy* page)
@@ -62,7 +62,7 @@ void WebUIClient::showPage(WebPageProxy* page)
     if (!m_pageUIClient.showPage)
         return;
     
-    m_pageUIClient.showPage(toRef(page), m_pageUIClient.clientInfo);
+    m_pageUIClient.showPage(toAPI(page), m_pageUIClient.clientInfo);
 }
 
 void WebUIClient::close(WebPageProxy* page)
@@ -70,7 +70,7 @@ void WebUIClient::close(WebPageProxy* page)
     if (!m_pageUIClient.close)
         return;
     
-    m_pageUIClient.close(toRef(page), m_pageUIClient.clientInfo);
+    m_pageUIClient.close(toAPI(page), m_pageUIClient.clientInfo);
 }
 
 void WebUIClient::runJavaScriptAlert(WebPageProxy* page, const String& message, WebFrameProxy* frame)
@@ -78,7 +78,7 @@ void WebUIClient::runJavaScriptAlert(WebPageProxy* page, const String& message,
     if (!m_pageUIClient.runJavaScriptAlert)
         return;
     
-    m_pageUIClient.runJavaScriptAlert(toRef(page), toRef(message.impl()), toRef(frame), m_pageUIClient.clientInfo);
+    m_pageUIClient.runJavaScriptAlert(toAPI(page), toAPI(message.impl()), toAPI(frame), m_pageUIClient.clientInfo);
 }
 
 bool WebUIClient::runJavaScriptConfirm(WebPageProxy* page, const String& message, WebFrameProxy* frame)
@@ -86,7 +86,7 @@ bool WebUIClient::runJavaScriptConfirm(WebPageProxy* page, const String& message
     if (!m_pageUIClient.runJavaScriptConfirm)
         return false;
 
-    return m_pageUIClient.runJavaScriptConfirm(toRef(page), toRef(message.impl()), toRef(frame), m_pageUIClient.clientInfo);
+    return m_pageUIClient.runJavaScriptConfirm(toAPI(page), toAPI(message.impl()), toAPI(frame), m_pageUIClient.clientInfo);
 }
 
 String WebUIClient::runJavaScriptPrompt(WebPageProxy* page, const String& message, const String& defaultValue, WebFrameProxy* frame)
@@ -94,7 +94,7 @@ String WebUIClient::runJavaScriptPrompt(WebPageProxy* page, const String& messag
     if (!m_pageUIClient.runJavaScriptPrompt)
         return String();
 
-    WebString* string = toWK(m_pageUIClient.runJavaScriptPrompt(toRef(page), toRef(message.impl()), toRef(defaultValue.impl()), toRef(frame), m_pageUIClient.clientInfo));
+    WebString* string = toImpl(m_pageUIClient.runJavaScriptPrompt(toAPI(page), toAPI(message.impl()), toAPI(defaultValue.impl()), toAPI(frame), m_pageUIClient.clientInfo));
     if (!string)
         return String();
 
@@ -109,7 +109,7 @@ void WebUIClient::setStatusText(WebPageProxy* page, const String& text)
     if (!m_pageUIClient.setStatusText)
         return;
 
-    m_pageUIClient.setStatusText(toRef(page), toRef(text.impl()), m_pageUIClient.clientInfo);
+    m_pageUIClient.setStatusText(toAPI(page), toAPI(text.impl()), m_pageUIClient.clientInfo);
 }
 
 void WebUIClient::mouseDidMoveOverElement(WebPageProxy* page, WebEvent::Modifiers modifiers, APIObject* userData)
@@ -117,7 +117,7 @@ void WebUIClient::mouseDidMoveOverElement(WebPageProxy* page, WebEvent::Modifier
     if (!m_pageUIClient.mouseDidMoveOverElement)
         return;
 
-    m_pageUIClient.mouseDidMoveOverElement(toRef(page), toRef(modifiers), toRef(userData), m_pageUIClient.clientInfo);
+    m_pageUIClient.mouseDidMoveOverElement(toAPI(page), toAPI(modifiers), toAPI(userData), m_pageUIClient.clientInfo);
 }
 
 
@@ -126,14 +126,14 @@ void WebUIClient::contentsSizeChanged(WebPageProxy* page, const IntSize& size, W
     if (!m_pageUIClient.contentsSizeChanged)
         return;
 
-    m_pageUIClient.contentsSizeChanged(toRef(page), size.width(), size.height(), toRef(frame), m_pageUIClient.clientInfo);
+    m_pageUIClient.contentsSizeChanged(toAPI(page), size.width(), size.height(), toAPI(frame), m_pageUIClient.clientInfo);
 }
 
 void WebUIClient::didNotHandleKeyEvent(WebPageProxy* page, const NativeWebKeyboardEvent& event)
 {
     if (!m_pageUIClient.didNotHandleKeyEvent)
         return;
-    m_pageUIClient.didNotHandleKeyEvent(toRef(page), event.nativeEvent(), m_pageUIClient.clientInfo);
+    m_pageUIClient.didNotHandleKeyEvent(toAPI(page), event.nativeEvent(), m_pageUIClient.clientInfo);
 }
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm b/WebKit2/UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm
index ef10457..90ba900 100644
--- a/WebKit2/UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm
+++ b/WebKit2/UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm
@@ -38,7 +38,7 @@ namespace WebKit {
 
 WebPageProxy* ChunkedUpdateDrawingAreaProxy::page()
 {
-    return toWK([m_webView pageRef]);
+    return toImpl([m_webView pageRef]);
 }
 
 void ChunkedUpdateDrawingAreaProxy::ensureBackingStore()
diff --git a/WebKit2/UIProcess/mac/LayerBackedDrawingAreaProxyMac.mm b/WebKit2/UIProcess/mac/LayerBackedDrawingAreaProxyMac.mm
index 7f70de1..00d3f6c 100644
--- a/WebKit2/UIProcess/mac/LayerBackedDrawingAreaProxyMac.mm
+++ b/WebKit2/UIProcess/mac/LayerBackedDrawingAreaProxyMac.mm
@@ -40,7 +40,7 @@ namespace WebKit {
 
 WebPageProxy* LayerBackedDrawingAreaProxy::page()
 {
-    return toWK([m_webView pageRef]);
+    return toImpl([m_webView pageRef]);
 }
 
 void LayerBackedDrawingAreaProxy::platformSetSize()
diff --git a/WebKit2/UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp b/WebKit2/UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp
index e1e4d33..291a161 100644
--- a/WebKit2/UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp
+++ b/WebKit2/UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp
@@ -40,7 +40,7 @@ namespace WebKit {
 
 WebPageProxy* ChunkedUpdateDrawingAreaProxy::page()
 {
-    return toWK(m_webView->page()->pageRef());
+    return toImpl(m_webView->page()->pageRef());
 }
 
 void ChunkedUpdateDrawingAreaProxy::ensureBackingStore()
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
index b65ba5b..1594125 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
@@ -34,95 +34,95 @@ using namespace WebKit;
 
 WKTypeID WKBundleGetTypeID()
 {
-    return toRef(InjectedBundle::APIType);
+    return toAPI(InjectedBundle::APIType);
 }
 
 void WKBundleSetClient(WKBundleRef bundleRef, WKBundleClient * wkClient)
 {
     if (wkClient && wkClient->version)
         return;
-    toWK(bundleRef)->initializeClient(wkClient);
+    toImpl(bundleRef)->initializeClient(wkClient);
 }
 
 void WKBundlePostMessage(WKBundleRef bundleRef, WKStringRef messageNameRef, WKTypeRef messageBodyRef)
 {
-    toWK(bundleRef)->postMessage(toWK(messageNameRef)->string(), toWK(messageBodyRef));
+    toImpl(bundleRef)->postMessage(toImpl(messageNameRef)->string(), toImpl(messageBodyRef));
 }
 
 void WKBundlePostSynchronousMessage(WKBundleRef bundleRef, WKStringRef messageNameRef, WKTypeRef messageBodyRef, WKTypeRef* returnDataRef)
 {
     RefPtr<APIObject> returnData;
-    toWK(bundleRef)->postSynchronousMessage(toWK(messageNameRef)->string(), toWK(messageBodyRef), returnData);
+    toImpl(bundleRef)->postSynchronousMessage(toImpl(messageNameRef)->string(), toImpl(messageBodyRef), returnData);
     if (returnDataRef)
-        *returnDataRef = toRef(returnData.release().leakRef());
+        *returnDataRef = toAPI(returnData.release().leakRef());
 }
 
 void WKBundleSetShouldTrackVisitedLinks(WKBundleRef bundleRef, bool shouldTrackVisitedLinks)
 {
-    toWK(bundleRef)->setShouldTrackVisitedLinks(shouldTrackVisitedLinks);
+    toImpl(bundleRef)->setShouldTrackVisitedLinks(shouldTrackVisitedLinks);
 }
 
 void WKBundleRemoveAllVisitedLinks(WKBundleRef bundleRef)
 {
-    toWK(bundleRef)->removeAllVisitedLinks();
+    toImpl(bundleRef)->removeAllVisitedLinks();
 }
 
 void WKBundleActivateMacFontAscentHack(WKBundleRef bundleRef)
 {
-    toWK(bundleRef)->activateMacFontAscentHack();
+    toImpl(bundleRef)->activateMacFontAscentHack();
 }
 
 void WKBundleGarbageCollectJavaScriptObjects(WKBundleRef bundleRef)
 {
-    toWK(bundleRef)->garbageCollectJavaScriptObjects();
+    toImpl(bundleRef)->garbageCollectJavaScriptObjects();
 }
 
 void WKBundleGarbageCollectJavaScriptObjectsOnAlternateThreadForDebugging(WKBundleRef bundleRef, bool waitUntilDone)
 {
-    toWK(bundleRef)->garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging(waitUntilDone);
+    toImpl(bundleRef)->garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging(waitUntilDone);
 }
 
 size_t WKBundleGetJavaScriptObjectsCount(WKBundleRef bundleRef)
 {
-    return toWK(bundleRef)->javaScriptObjectsCount();
+    return toImpl(bundleRef)->javaScriptObjectsCount();
 }
 
 void WKBundleAddUserScript(WKBundleRef bundleRef, WKBundleScriptWorldRef scriptWorldRef, WKStringRef sourceRef, WKURLRef urlRef, WKArrayRef whitelistRef, WKArrayRef blacklistRef, WKUserScriptInjectionTime injectionTimeRef, WKUserContentInjectedFrames injectedFramesRef)
 {
-    toWK(bundleRef)->addUserScript(toWK(scriptWorldRef), toWTFString(sourceRef), toWTFString(urlRef), toWK(whitelistRef), toWK(blacklistRef), toUserScriptInjectionTime(injectionTimeRef), toUserContentInjectedFrames(injectedFramesRef));
+    toImpl(bundleRef)->addUserScript(toImpl(scriptWorldRef), toWTFString(sourceRef), toWTFString(urlRef), toImpl(whitelistRef), toImpl(blacklistRef), toUserScriptInjectionTime(injectionTimeRef), toUserContentInjectedFrames(injectedFramesRef));
 }
 
 void WKBundleAddUserStyleSheet(WKBundleRef bundleRef, WKBundleScriptWorldRef scriptWorldRef, WKStringRef sourceRef, WKURLRef urlRef, WKArrayRef whitelistRef, WKArrayRef blacklistRef, WKUserContentInjectedFrames injectedFramesRef)
 {
-    toWK(bundleRef)->addUserStyleSheet(toWK(scriptWorldRef), toWTFString(sourceRef), toWTFString(urlRef), toWK(whitelistRef), toWK(blacklistRef), toUserContentInjectedFrames(injectedFramesRef));
+    toImpl(bundleRef)->addUserStyleSheet(toImpl(scriptWorldRef), toWTFString(sourceRef), toWTFString(urlRef), toImpl(whitelistRef), toImpl(blacklistRef), toUserContentInjectedFrames(injectedFramesRef));
 }
 
 void WKBundleRemoveUserScript(WKBundleRef bundleRef, WKBundleScriptWorldRef scriptWorldRef, WKURLRef urlRef)
 {
-    toWK(bundleRef)->removeUserScript(toWK(scriptWorldRef), toWTFString(urlRef));
+    toImpl(bundleRef)->removeUserScript(toImpl(scriptWorldRef), toWTFString(urlRef));
 }
 
 void WKBundleRemoveUserStyleSheet(WKBundleRef bundleRef, WKBundleScriptWorldRef scriptWorldRef, WKURLRef urlRef)
 {
-    toWK(bundleRef)->removeUserStyleSheet(toWK(scriptWorldRef), toWTFString(urlRef));
+    toImpl(bundleRef)->removeUserStyleSheet(toImpl(scriptWorldRef), toWTFString(urlRef));
 }
 
 void WKBundleRemoveUserScripts(WKBundleRef bundleRef, WKBundleScriptWorldRef scriptWorldRef)
 {
-    toWK(bundleRef)->removeUserScripts(toWK(scriptWorldRef));
+    toImpl(bundleRef)->removeUserScripts(toImpl(scriptWorldRef));
 }
 
 void WKBundleRemoveUserStyleSheets(WKBundleRef bundleRef, WKBundleScriptWorldRef scriptWorldRef)
 {
-    toWK(bundleRef)->removeUserStyleSheets(toWK(scriptWorldRef));
+    toImpl(bundleRef)->removeUserStyleSheets(toImpl(scriptWorldRef));
 }
 
 void WKBundleRemoveAllUserContent(WKBundleRef bundleRef)
 {
-    toWK(bundleRef)->removeAllUserContent();
+    toImpl(bundleRef)->removeAllUserContent();
 }
 
 void WKBundleOverrideXSSAuditorEnabledForTestRunner(WKBundleRef bundleRef, bool enabled)
 {
-    toWK(bundleRef)->overrideXSSAuditorEnabledForTestRunner(enabled);
+    toImpl(bundleRef)->overrideXSSAuditorEnabledForTestRunner(enabled);
 }
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
index cf6bb01..2539713 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
@@ -58,7 +58,7 @@ WK_ADD_API_MAPPING(WKBundleRangeHandleRef, InjectedBundleRangeHandle)
 WK_ADD_API_MAPPING(WKBundleRef, InjectedBundle)
 WK_ADD_API_MAPPING(WKBundleScriptWorldRef, InjectedBundleScriptWorld)
 
-inline WKInsertActionType toWK(WebCore::EditorInsertAction action)
+inline WKInsertActionType toAPI(WebCore::EditorInsertAction action)
 {
     switch (action) {
     case WebCore::EditorInsertActionTyped:
@@ -75,7 +75,7 @@ inline WKInsertActionType toWK(WebCore::EditorInsertAction action)
     return kWKInsertActionTyped;
 }
 
-inline WKAffinityType toWK(WebCore::EAffinity affinity)
+inline WKAffinityType toAPI(WebCore::EAffinity affinity)
 {
     switch (affinity) {
     case WebCore::UPSTREAM:
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
index ffc46a1..9197709 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
@@ -36,85 +36,85 @@ using namespace WebKit;
 
 WKTypeID WKBundleFrameGetTypeID()
 {
-    return toRef(WebFrame::APIType);
+    return toAPI(WebFrame::APIType);
 }
 
 bool WKBundleFrameIsMainFrame(WKBundleFrameRef frameRef)
 {
-    return toWK(frameRef)->isMainFrame();
+    return toImpl(frameRef)->isMainFrame();
 }
 
 WKURLRef WKBundleFrameCopyURL(WKBundleFrameRef frameRef)
 {
-    return toCopiedURLRef(toWK(frameRef)->url());
+    return toCopiedURLAPI(toImpl(frameRef)->url());
 }
 
 WKArrayRef WKBundleFrameCopyChildFrames(WKBundleFrameRef frameRef)
 {
-    return toRef(toWK(frameRef)->childFrames().releaseRef());    
+    return toAPI(toImpl(frameRef)->childFrames().releaseRef());    
 }
 
 unsigned WKBundleFrameGetNumberOfActiveAnimations(WKBundleFrameRef frameRef)
 {
-    return toWK(frameRef)->numberOfActiveAnimations();
+    return toImpl(frameRef)->numberOfActiveAnimations();
 }
 
 bool WKBundleFramePauseAnimationOnElementWithId(WKBundleFrameRef frameRef, WKStringRef name, WKStringRef elementID, double time)
 {
-    return toWK(frameRef)->pauseAnimationOnElementWithId(toWK(name)->string(), toWK(elementID)->string(), time);
+    return toImpl(frameRef)->pauseAnimationOnElementWithId(toImpl(name)->string(), toImpl(elementID)->string(), time);
 }
 
 JSGlobalContextRef WKBundleFrameGetJavaScriptContext(WKBundleFrameRef frameRef)
 {
-    return toWK(frameRef)->jsContext();
+    return toImpl(frameRef)->jsContext();
 }
 
 JSGlobalContextRef WKBundleFrameGetJavaScriptContextForWorld(WKBundleFrameRef frameRef, WKBundleScriptWorldRef worldRef)
 {
-    return toWK(frameRef)->jsContextForWorld(toWK(worldRef));
+    return toImpl(frameRef)->jsContextForWorld(toImpl(worldRef));
 }
 
 JSValueRef WKBundleFrameGetJavaScriptWrapperForNodeForWorld(WKBundleFrameRef frameRef, WKBundleNodeHandleRef nodeHandleRef, WKBundleScriptWorldRef worldRef)
 {
-    return toWK(frameRef)->jsWrapperForWorld(toWK(nodeHandleRef), toWK(worldRef));
+    return toImpl(frameRef)->jsWrapperForWorld(toImpl(nodeHandleRef), toImpl(worldRef));
 }
 
 JSValueRef WKBundleFrameGetJavaScriptWrapperForRangeForWorld(WKBundleFrameRef frameRef, WKBundleRangeHandleRef rangeHandleRef, WKBundleScriptWorldRef worldRef)
 {
-    return toWK(frameRef)->jsWrapperForWorld(toWK(rangeHandleRef), toWK(worldRef));
+    return toImpl(frameRef)->jsWrapperForWorld(toImpl(rangeHandleRef), toImpl(worldRef));
 }
 
 WKStringRef WKBundleFrameCopyName(WKBundleFrameRef frameRef)
 {
-    return toCopiedRef(toWK(frameRef)->name());
+    return toCopiedAPI(toImpl(frameRef)->name());
 }
 
 JSValueRef WKBundleFrameGetComputedStyleIncludingVisitedInfo(WKBundleFrameRef frameRef, JSObjectRef element)
 {
-    return toWK(frameRef)->computedStyleIncludingVisitedInfo(element);
+    return toImpl(frameRef)->computedStyleIncludingVisitedInfo(element);
 }
 
 WKStringRef WKBundleFrameCopyCounterValue(WKBundleFrameRef frameRef, JSObjectRef element)
 {
-    return toCopiedRef(toWK(frameRef)->counterValue(element));
+    return toCopiedAPI(toImpl(frameRef)->counterValue(element));
 }
 
 WKStringRef WKBundleFrameCopyMarkerText(WKBundleFrameRef frameRef, JSObjectRef element)
 {
-    return toCopiedRef(toWK(frameRef)->markerText(element));
+    return toCopiedAPI(toImpl(frameRef)->markerText(element));
 }
 
 WKStringRef WKBundleFrameCopyInnerText(WKBundleFrameRef frameRef)
 {
-    return toCopiedRef(toWK(frameRef)->innerText());
+    return toCopiedAPI(toImpl(frameRef)->innerText());
 }
 
 unsigned WKBundleFrameGetPendingUnloadCount(WKBundleFrameRef frameRef)
 {
-    return toWK(frameRef)->pendingUnloadCount();
+    return toImpl(frameRef)->pendingUnloadCount();
 }
 
 WKBundlePageRef WKBundleFrameGetPage(WKBundleFrameRef frameRef)
 {
-    return toRef(toWK(frameRef)->page());
+    return toAPI(toImpl(frameRef)->page());
 }
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp
index d4665e5..d9a7c9a 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp
@@ -34,21 +34,21 @@ using namespace WebKit;
 
 WKTypeID WKBundleHitTestResultGetTypeID()
 {
-    return toRef(InjectedBundleHitTestResult::APIType);
+    return toAPI(InjectedBundleHitTestResult::APIType);
 }
 
 WKBundleNodeHandleRef WKBundleHitTestResultGetNodeHandle(WKBundleHitTestResultRef hitTestResultRef)
 {
-    RefPtr<InjectedBundleNodeHandle> nodeHandle = toWK(hitTestResultRef)->nodeHandle();
-    return toRef(nodeHandle.get());
+    RefPtr<InjectedBundleNodeHandle> nodeHandle = toImpl(hitTestResultRef)->nodeHandle();
+    return toAPI(nodeHandle.get());
 }
 
 WKBundleFrameRef WKBundleHitTestResultGetFrame(WKBundleHitTestResultRef hitTestResultRef)
 {
-    return toRef(toWK(hitTestResultRef)->webFrame());
+    return toAPI(toImpl(hitTestResultRef)->webFrame());
 }
 
 WKURLRef WKBundleHitTestResultCopyAbsoluteLinkURL(WKBundleHitTestResultRef hitTestResultRef)
 {
-    return toCopiedURLRef(toWK(hitTestResultRef)->absoluteLinkURL());
+    return toCopiedURLAPI(toImpl(hitTestResultRef)->absoluteLinkURL());
 }
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp
index 56738da..5c4e111 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp
@@ -33,5 +33,5 @@ using namespace WebKit;
 
 WKTypeID WKBundleNodeHandleGetTypeID()
 {
-    return toRef(InjectedBundleNodeHandle::APIType);
+    return toAPI(InjectedBundleNodeHandle::APIType);
 }
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
index bfa1feb..78684fa 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
@@ -34,88 +34,88 @@ using namespace WebKit;
 
 WKTypeID WKBundlePageGetTypeID()
 {
-    return toRef(WebPage::APIType);
+    return toAPI(WebPage::APIType);
 }
 
 void WKBundlePageSetEditorClient(WKBundlePageRef pageRef, WKBundlePageEditorClient* wkClient)
 {
     if (wkClient && wkClient->version)
         return;
-    toWK(pageRef)->initializeInjectedBundleEditorClient(wkClient);
+    toImpl(pageRef)->initializeInjectedBundleEditorClient(wkClient);
 }
 
 void WKBundlePageSetFormClient(WKBundlePageRef pageRef, WKBundlePageFormClient* wkClient)
 {
     if (wkClient && wkClient->version)
         return;
-    toWK(pageRef)->initializeInjectedBundleFormClient(wkClient);
+    toImpl(pageRef)->initializeInjectedBundleFormClient(wkClient);
 }
 
 void WKBundlePageSetLoaderClient(WKBundlePageRef pageRef, WKBundlePageLoaderClient* wkClient)
 {
     if (wkClient && wkClient->version)
         return;
-    toWK(pageRef)->initializeInjectedBundleLoaderClient(wkClient);
+    toImpl(pageRef)->initializeInjectedBundleLoaderClient(wkClient);
 }
 
 void WKBundlePageSetUIClient(WKBundlePageRef pageRef, WKBundlePageUIClient* wkClient)
 {
     if (wkClient && wkClient->version)
         return;
-    toWK(pageRef)->initializeInjectedBundleUIClient(wkClient);
+    toImpl(pageRef)->initializeInjectedBundleUIClient(wkClient);
 }
 
 WKBundleFrameRef WKBundlePageGetMainFrame(WKBundlePageRef pageRef)
 {
-    return toRef(toWK(pageRef)->mainFrame());
+    return toAPI(toImpl(pageRef)->mainFrame());
 }
 
 void WKBundlePageStopLoading(WKBundlePageRef pageRef)
 {
-    toWK(pageRef)->stopLoading();
+    toImpl(pageRef)->stopLoading();
 }
 
 WKStringRef WKBundlePageCopyRenderTreeExternalRepresentation(WKBundlePageRef pageRef)
 {
-    return toCopiedRef(toWK(pageRef)->renderTreeExternalRepresentation());
+    return toCopiedAPI(toImpl(pageRef)->renderTreeExternalRepresentation());
 }
 
 void WKBundlePageExecuteEditingCommand(WKBundlePageRef pageRef, WKStringRef name, WKStringRef argument)
 {
-    toWK(pageRef)->executeEditingCommand(toWK(name)->string(), toWK(argument)->string());
+    toImpl(pageRef)->executeEditingCommand(toImpl(name)->string(), toImpl(argument)->string());
 }
 
 bool WKBundlePageIsEditingCommandEnabled(WKBundlePageRef pageRef, WKStringRef name)
 {
-    return toWK(pageRef)->isEditingCommandEnabled(toWK(name)->string());
+    return toImpl(pageRef)->isEditingCommandEnabled(toImpl(name)->string());
 }
 
 void WKBundlePageClearMainFrameName(WKBundlePageRef pageRef)
 {
-    toWK(pageRef)->clearMainFrameName();
+    toImpl(pageRef)->clearMainFrameName();
 }
 
 void WKBundlePageClose(WKBundlePageRef pageRef)
 {
-    toWK(pageRef)->sendClose();
+    toImpl(pageRef)->sendClose();
 }
 
 double WKBundlePageGetTextZoomFactor(WKBundlePageRef pageRef)
 {
-    return toWK(pageRef)->textZoomFactor();
+    return toImpl(pageRef)->textZoomFactor();
 }
 
 void WKBundlePageSetTextZoomFactor(WKBundlePageRef pageRef, double zoomFactor)
 {
-    toWK(pageRef)->setTextZoomFactor(zoomFactor);
+    toImpl(pageRef)->setTextZoomFactor(zoomFactor);
 }
 
 double WKBundlePageGetPageZoomFactor(WKBundlePageRef pageRef)
 {
-    return toWK(pageRef)->pageZoomFactor();
+    return toImpl(pageRef)->pageZoomFactor();
 }
 
 void WKBundlePageSetPageZoomFactor(WKBundlePageRef pageRef, double zoomFactor)
 {
-    toWK(pageRef)->setPageZoomFactor(zoomFactor);
+    toImpl(pageRef)->setPageZoomFactor(zoomFactor);
 }
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp
index 13c9064..78047af 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp
@@ -33,5 +33,5 @@ using namespace WebKit;
 
 WKTypeID WKBundleRangeHandleGetTypeID()
 {
-    return toRef(InjectedBundleRangeHandle::APIType);
+    return toAPI(InjectedBundleRangeHandle::APIType);
 }
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp
index 06171b0..a7a4a8d 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp
@@ -33,16 +33,16 @@ using namespace WebKit;
 
 WKTypeID WKBundleScriptWorldGetTypeID()
 {
-    return toRef(InjectedBundleScriptWorld::APIType);
+    return toAPI(InjectedBundleScriptWorld::APIType);
 }
 
 WKBundleScriptWorldRef WKBundleScriptWorldCreateWorld()
 {
     RefPtr<InjectedBundleScriptWorld> world = InjectedBundleScriptWorld::create();
-    return toRef(world.release().releaseRef());
+    return toAPI(world.release().releaseRef());
 }
 
 WKBundleScriptWorldRef WKBundleScriptWorldNormalWorld()
 {
-    return toRef(InjectedBundleScriptWorld::normalWorld());
+    return toAPI(InjectedBundleScriptWorld::normalWorld());
 }
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp b/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
index 65d1b74..43f2357 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
@@ -187,19 +187,19 @@ size_t InjectedBundle::javaScriptObjectsCount()
 void InjectedBundle::didCreatePage(WebPage* page)
 {
     if (m_client.didCreatePage)
-        m_client.didCreatePage(toRef(this), toRef(page), m_client.clientInfo);
+        m_client.didCreatePage(toAPI(this), toAPI(page), m_client.clientInfo);
 }
 
 void InjectedBundle::willDestroyPage(WebPage* page)
 {
     if (m_client.willDestroyPage)
-        m_client.willDestroyPage(toRef(this), toRef(page), m_client.clientInfo);
+        m_client.willDestroyPage(toAPI(this), toAPI(page), m_client.clientInfo);
 }
 
 void InjectedBundle::didReceiveMessage(const String& messageName, APIObject* messageBody)
 {
     if (m_client.didReceiveMessage)
-        m_client.didReceiveMessage(toRef(this), toRef(messageName.impl()), toRef(messageBody), m_client.clientInfo);
+        m_client.didReceiveMessage(toAPI(this), toAPI(messageName.impl()), toAPI(messageBody), m_client.clientInfo);
 }
 
 void InjectedBundle::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp
index 7df6b59..d568fc1 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp
@@ -52,7 +52,7 @@ bool InjectedBundlePageEditorClient::shouldBeginEditing(WebPage* page, Range* ra
 {
     if (m_client.shouldBeginEditing) {
         RefPtr<InjectedBundleRangeHandle> rangeHandle = InjectedBundleRangeHandle::getOrCreate(range);
-        return m_client.shouldBeginEditing(toRef(page), toRef(rangeHandle.get()), m_client.clientInfo);
+        return m_client.shouldBeginEditing(toAPI(page), toAPI(rangeHandle.get()), m_client.clientInfo);
     }
     return true;
 }
@@ -61,7 +61,7 @@ bool InjectedBundlePageEditorClient::shouldEndEditing(WebPage* page, Range* rang
 {
     if (m_client.shouldEndEditing) {
         RefPtr<InjectedBundleRangeHandle> rangeHandle = InjectedBundleRangeHandle::getOrCreate(range);
-        return m_client.shouldEndEditing(toRef(page), toRef(rangeHandle.get()), m_client.clientInfo);
+        return m_client.shouldEndEditing(toAPI(page), toAPI(rangeHandle.get()), m_client.clientInfo);
     }
     return true;
 }
@@ -71,7 +71,7 @@ bool InjectedBundlePageEditorClient::shouldInsertNode(WebPage* page, Node* node,
     if (m_client.shouldInsertNode) {
         RefPtr<InjectedBundleNodeHandle> nodeHandle = InjectedBundleNodeHandle::getOrCreate(node);
         RefPtr<InjectedBundleRangeHandle> rangeToReplaceHandle = InjectedBundleRangeHandle::getOrCreate(rangeToReplace);
-        return m_client.shouldInsertNode(toRef(page), toRef(nodeHandle.get()), toRef(rangeToReplaceHandle.get()), toWK(action), m_client.clientInfo);
+        return m_client.shouldInsertNode(toAPI(page), toAPI(nodeHandle.get()), toAPI(rangeToReplaceHandle.get()), toAPI(action), m_client.clientInfo);
     }
     return true;
 }
@@ -80,7 +80,7 @@ bool InjectedBundlePageEditorClient::shouldInsertText(WebPage* page, StringImpl*
 {
     if (m_client.shouldInsertText) {
         RefPtr<InjectedBundleRangeHandle> rangeToReplaceHandle = InjectedBundleRangeHandle::getOrCreate(rangeToReplace);
-        return m_client.shouldInsertText(toRef(page), toRef(text), toRef(rangeToReplaceHandle.get()), toWK(action), m_client.clientInfo);
+        return m_client.shouldInsertText(toAPI(page), toAPI(text), toAPI(rangeToReplaceHandle.get()), toAPI(action), m_client.clientInfo);
     }
     return true;
 }
@@ -89,7 +89,7 @@ bool InjectedBundlePageEditorClient::shouldDeleteRange(WebPage* page, Range* ran
 {
     if (m_client.shouldDeleteRange) {
         RefPtr<InjectedBundleRangeHandle> rangeHandle = InjectedBundleRangeHandle::getOrCreate(range);
-        return m_client.shouldDeleteRange(toRef(page), toRef(rangeHandle.get()), m_client.clientInfo);
+        return m_client.shouldDeleteRange(toAPI(page), toAPI(rangeHandle.get()), m_client.clientInfo);
     }
     return true;
 }
@@ -99,7 +99,7 @@ bool InjectedBundlePageEditorClient::shouldChangeSelectedRange(WebPage* page, Ra
     if (m_client.shouldChangeSelectedRange) {
         RefPtr<InjectedBundleRangeHandle> fromRangeHandle = InjectedBundleRangeHandle::getOrCreate(fromRange);
         RefPtr<InjectedBundleRangeHandle> toRangeHandle = InjectedBundleRangeHandle::getOrCreate(toRange);
-        return m_client.shouldChangeSelectedRange(toRef(page), toRef(fromRangeHandle.get()), toRef(toRangeHandle.get()), toWK(affinity), stillSelecting, m_client.clientInfo);
+        return m_client.shouldChangeSelectedRange(toAPI(page), toAPI(fromRangeHandle.get()), toAPI(toRangeHandle.get()), toAPI(affinity), stillSelecting, m_client.clientInfo);
     }
     return true;
 }
@@ -108,7 +108,7 @@ bool InjectedBundlePageEditorClient::shouldApplyStyle(WebPage* page, CSSStyleDec
 {
     if (m_client.shouldApplyStyle) {
         RefPtr<InjectedBundleRangeHandle> rangeHandle = InjectedBundleRangeHandle::getOrCreate(range);
-        return m_client.shouldApplyStyle(toRef(page), toRef(style), toRef(rangeHandle.get()), m_client.clientInfo);
+        return m_client.shouldApplyStyle(toAPI(page), toAPI(style), toAPI(rangeHandle.get()), m_client.clientInfo);
     }
     return true;
 }
@@ -116,25 +116,25 @@ bool InjectedBundlePageEditorClient::shouldApplyStyle(WebPage* page, CSSStyleDec
 void InjectedBundlePageEditorClient::didBeginEditing(WebPage* page, StringImpl* notificationName)
 {
     if (m_client.didBeginEditing)
-        m_client.didBeginEditing(toRef(page), toRef(notificationName), m_client.clientInfo);
+        m_client.didBeginEditing(toAPI(page), toAPI(notificationName), m_client.clientInfo);
 }
 
 void InjectedBundlePageEditorClient::didEndEditing(WebPage* page, StringImpl* notificationName)
 {
     if (m_client.didEndEditing)
-        m_client.didEndEditing(toRef(page), toRef(notificationName), m_client.clientInfo);
+        m_client.didEndEditing(toAPI(page), toAPI(notificationName), m_client.clientInfo);
 }
 
 void InjectedBundlePageEditorClient::didChange(WebPage* page, StringImpl* notificationName)
 {
     if (m_client.didChange)
-        m_client.didChange(toRef(page), toRef(notificationName), m_client.clientInfo);
+        m_client.didChange(toAPI(page), toAPI(notificationName), m_client.clientInfo);
 }
 
 void InjectedBundlePageEditorClient::didChangeSelection(WebPage* page, StringImpl* notificationName)
 {
     if (m_client.didChangeSelection)
-        m_client.didChangeSelection(toRef(page), toRef(notificationName), m_client.clientInfo);
+        m_client.didChangeSelection(toAPI(page), toAPI(notificationName), m_client.clientInfo);
 }
 
 } // namespace WebKit
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp
index a9dcbbe..cfe5f87 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp
@@ -56,7 +56,7 @@ void InjectedBundlePageFormClient::textFieldDidBeginEditing(WebPage* page, HTMLI
         return;
 
     RefPtr<InjectedBundleNodeHandle> nodeHandle = InjectedBundleNodeHandle::getOrCreate(inputElement);
-    m_client.textFieldDidBeginEditing(toRef(page), toRef(nodeHandle.get()), toRef(frame), m_client.clientInfo);
+    m_client.textFieldDidBeginEditing(toAPI(page), toAPI(nodeHandle.get()), toAPI(frame), m_client.clientInfo);
 }
 
 void InjectedBundlePageFormClient::textFieldDidEndEditing(WebPage* page, HTMLInputElement* inputElement, WebFrame* frame)
@@ -65,7 +65,7 @@ void InjectedBundlePageFormClient::textFieldDidEndEditing(WebPage* page, HTMLInp
         return;
 
     RefPtr<InjectedBundleNodeHandle> nodeHandle = InjectedBundleNodeHandle::getOrCreate(inputElement);
-    m_client.textFieldDidEndEditing(toRef(page), toRef(nodeHandle.get()), toRef(frame), m_client.clientInfo);
+    m_client.textFieldDidEndEditing(toAPI(page), toAPI(nodeHandle.get()), toAPI(frame), m_client.clientInfo);
 }
 
 void InjectedBundlePageFormClient::textDidChangeInTextField(WebPage* page, HTMLInputElement* inputElement, WebFrame* frame)
@@ -74,7 +74,7 @@ void InjectedBundlePageFormClient::textDidChangeInTextField(WebPage* page, HTMLI
         return;
 
     RefPtr<InjectedBundleNodeHandle> nodeHandle = InjectedBundleNodeHandle::getOrCreate(inputElement);
-    m_client.textDidChangeInTextField(toRef(page), toRef(nodeHandle.get()), toRef(frame), m_client.clientInfo);
+    m_client.textDidChangeInTextField(toAPI(page), toAPI(nodeHandle.get()), toAPI(frame), m_client.clientInfo);
 }
 
 void InjectedBundlePageFormClient::textDidChangeInTextArea(WebPage* page, HTMLTextAreaElement* textAreaElement, WebFrame* frame)
@@ -83,7 +83,7 @@ void InjectedBundlePageFormClient::textDidChangeInTextArea(WebPage* page, HTMLTe
         return;
 
     RefPtr<InjectedBundleNodeHandle> nodeHandle = InjectedBundleNodeHandle::getOrCreate(textAreaElement);
-    m_client.textDidChangeInTextArea(toRef(page), toRef(nodeHandle.get()), toRef(frame), m_client.clientInfo);
+    m_client.textDidChangeInTextArea(toAPI(page), toAPI(nodeHandle.get()), toAPI(frame), m_client.clientInfo);
 }
 
 bool InjectedBundlePageFormClient::shouldPerformActionInTextField(WebPage* page, HTMLInputElement* inputElement, WKInputFieldActionType actionType, WebFrame* frame)
@@ -92,7 +92,7 @@ bool InjectedBundlePageFormClient::shouldPerformActionInTextField(WebPage* page,
         return false;
 
     RefPtr<InjectedBundleNodeHandle> nodeHandle = InjectedBundleNodeHandle::getOrCreate(inputElement);
-    return m_client.shouldPerformActionInTextField(toRef(page), toRef(nodeHandle.get()), actionType, toRef(frame), m_client.clientInfo);
+    return m_client.shouldPerformActionInTextField(toAPI(page), toAPI(nodeHandle.get()), actionType, toAPI(frame), m_client.clientInfo);
 }
 
 void InjectedBundlePageFormClient::willSubmitForm(WebPage* page, HTMLFormElement* formElement, WebFrame* frame, WebFrame* sourceFrame, const Vector<std::pair<String, String> >& values, RefPtr<APIObject>& userData)
@@ -108,8 +108,8 @@ void InjectedBundlePageFormClient::willSubmitForm(WebPage* page, HTMLFormElement
     RefPtr<ImmutableDictionary> textFieldsMap = ImmutableDictionary::adopt(map);
 
     WKTypeRef userDataToPass = 0;
-    m_client.willSubmitForm(toRef(page), toRef(nodeHandle.get()), toRef(frame), toRef(sourceFrame), toRef(textFieldsMap.get()), &userDataToPass, m_client.clientInfo);
-    userData = adoptRef(toWK(userDataToPass));
+    m_client.willSubmitForm(toAPI(page), toAPI(nodeHandle.get()), toAPI(frame), toAPI(sourceFrame), toAPI(textFieldsMap.get()), &userDataToPass, m_client.clientInfo);
+    userData = adoptRef(toImpl(userDataToPass));
 }
 
 } // namespace WebKit
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
index a6e395d..7f41bdb 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
@@ -53,8 +53,8 @@ void InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame(WebPage* pa
         return;
 
     WKTypeRef userDataToPass = 0;
-    m_client.didStartProvisionalLoadForFrame(toRef(page), toRef(frame), &userDataToPass, m_client.clientInfo);
-    userData = adoptRef(toWK(userDataToPass));
+    m_client.didStartProvisionalLoadForFrame(toAPI(page), toAPI(frame), &userDataToPass, m_client.clientInfo);
+    userData = adoptRef(toImpl(userDataToPass));
 }
 
 void InjectedBundlePageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame(WebPage* page, WebFrame* frame, RefPtr<APIObject>& userData)
@@ -63,8 +63,8 @@ void InjectedBundlePageLoaderClient::didReceiveServerRedirectForProvisionalLoadF
         return;
 
     WKTypeRef userDataToPass = 0;
-    m_client.didReceiveServerRedirectForProvisionalLoadForFrame(toRef(page), toRef(frame), &userDataToPass, m_client.clientInfo);
-    userData = adoptRef(toWK(userDataToPass));
+    m_client.didReceiveServerRedirectForProvisionalLoadForFrame(toAPI(page), toAPI(frame), &userDataToPass, m_client.clientInfo);
+    userData = adoptRef(toImpl(userDataToPass));
 }
 
 void InjectedBundlePageLoaderClient::didFailProvisionalLoadWithErrorForFrame(WebPage* page, WebFrame* frame, RefPtr<APIObject>& userData)
@@ -73,8 +73,8 @@ void InjectedBundlePageLoaderClient::didFailProvisionalLoadWithErrorForFrame(Web
         return;
 
     WKTypeRef userDataToPass = 0;
-    m_client.didFailProvisionalLoadWithErrorForFrame(toRef(page), toRef(frame), &userDataToPass, m_client.clientInfo);
-    userData = adoptRef(toWK(userDataToPass));
+    m_client.didFailProvisionalLoadWithErrorForFrame(toAPI(page), toAPI(frame), &userDataToPass, m_client.clientInfo);
+    userData = adoptRef(toImpl(userDataToPass));
 }
 
 void InjectedBundlePageLoaderClient::didCommitLoadForFrame(WebPage* page, WebFrame* frame, RefPtr<APIObject>& userData)
@@ -83,8 +83,8 @@ void InjectedBundlePageLoaderClient::didCommitLoadForFrame(WebPage* page, WebFra
         return;
 
     WKTypeRef userDataToPass = 0;
-    m_client.didCommitLoadForFrame(toRef(page), toRef(frame), &userDataToPass, m_client.clientInfo);
-    userData = adoptRef(toWK(userDataToPass));
+    m_client.didCommitLoadForFrame(toAPI(page), toAPI(frame), &userDataToPass, m_client.clientInfo);
+    userData = adoptRef(toImpl(userDataToPass));
 }
 
 void InjectedBundlePageLoaderClient::didFinishDocumentLoadForFrame(WebPage* page, WebFrame* frame, RefPtr<APIObject>& userData)
@@ -93,8 +93,8 @@ void InjectedBundlePageLoaderClient::didFinishDocumentLoadForFrame(WebPage* page
         return;
 
     WKTypeRef userDataToPass = 0;
-    m_client.didFinishDocumentLoadForFrame(toRef(page), toRef(frame), &userDataToPass, m_client.clientInfo);
-    userData = adoptRef(toWK(userDataToPass));
+    m_client.didFinishDocumentLoadForFrame(toAPI(page), toAPI(frame), &userDataToPass, m_client.clientInfo);
+    userData = adoptRef(toImpl(userDataToPass));
 }
 
 void InjectedBundlePageLoaderClient::didFinishLoadForFrame(WebPage* page, WebFrame* frame, RefPtr<APIObject>& userData)
@@ -103,8 +103,8 @@ void InjectedBundlePageLoaderClient::didFinishLoadForFrame(WebPage* page, WebFra
         return;
 
     WKTypeRef userDataToPass = 0;
-    m_client.didFinishLoadForFrame(toRef(page), toRef(frame), &userDataToPass, m_client.clientInfo);
-    userData = adoptRef(toWK(userDataToPass));
+    m_client.didFinishLoadForFrame(toAPI(page), toAPI(frame), &userDataToPass, m_client.clientInfo);
+    userData = adoptRef(toImpl(userDataToPass));
 }
 
 void InjectedBundlePageLoaderClient::didFailLoadWithErrorForFrame(WebPage* page, WebFrame* frame, RefPtr<APIObject>& userData)
@@ -113,8 +113,8 @@ void InjectedBundlePageLoaderClient::didFailLoadWithErrorForFrame(WebPage* page,
         return;
 
     WKTypeRef userDataToPass = 0;
-    m_client.didFailLoadWithErrorForFrame(toRef(page), toRef(frame), &userDataToPass, m_client.clientInfo);
-    userData = adoptRef(toWK(userDataToPass));
+    m_client.didFailLoadWithErrorForFrame(toAPI(page), toAPI(frame), &userDataToPass, m_client.clientInfo);
+    userData = adoptRef(toImpl(userDataToPass));
 }
 
 void InjectedBundlePageLoaderClient::didReceiveTitleForFrame(WebPage* page, const String& title, WebFrame* frame, RefPtr<APIObject>& userData)
@@ -123,8 +123,8 @@ void InjectedBundlePageLoaderClient::didReceiveTitleForFrame(WebPage* page, cons
         return;
 
     WKTypeRef userDataToPass = 0;
-    m_client.didReceiveTitleForFrame(toRef(page), toRef(title.impl()), toRef(frame), &userDataToPass, m_client.clientInfo);
-    userData = adoptRef(toWK(userDataToPass));
+    m_client.didReceiveTitleForFrame(toAPI(page), toAPI(title.impl()), toAPI(frame), &userDataToPass, m_client.clientInfo);
+    userData = adoptRef(toImpl(userDataToPass));
 }
 
 void InjectedBundlePageLoaderClient::didFirstLayoutForFrame(WebPage* page, WebFrame* frame, RefPtr<APIObject>& userData)
@@ -133,8 +133,8 @@ void InjectedBundlePageLoaderClient::didFirstLayoutForFrame(WebPage* page, WebFr
         return;
 
     WKTypeRef userDataToPass = 0;
-    m_client.didFirstLayoutForFrame(toRef(page), toRef(frame), &userDataToPass, m_client.clientInfo);
-    userData = adoptRef(toWK(userDataToPass));
+    m_client.didFirstLayoutForFrame(toAPI(page), toAPI(frame), &userDataToPass, m_client.clientInfo);
+    userData = adoptRef(toImpl(userDataToPass));
 }
 
 void InjectedBundlePageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame(WebPage* page, WebFrame* frame, RefPtr<APIObject>& userData)
@@ -143,8 +143,8 @@ void InjectedBundlePageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame(WebP
         return;
 
     WKTypeRef userDataToPass = 0;
-    m_client.didFirstVisuallyNonEmptyLayoutForFrame(toRef(page), toRef(frame), &userDataToPass, m_client.clientInfo);
-    userData = adoptRef(toWK(userDataToPass));
+    m_client.didFirstVisuallyNonEmptyLayoutForFrame(toAPI(page), toAPI(frame), &userDataToPass, m_client.clientInfo);
+    userData = adoptRef(toImpl(userDataToPass));
 }
 
 void InjectedBundlePageLoaderClient::didRemoveFrameFromHierarchy(WebPage* page , WebFrame* frame, RefPtr<APIObject>& userData)
@@ -153,8 +153,8 @@ void InjectedBundlePageLoaderClient::didRemoveFrameFromHierarchy(WebPage* page ,
         return;
 
     WKTypeRef userDataToPass = 0;
-    m_client.didRemoveFrameFromHierarchy(toRef(page), toRef(frame), &userDataToPass, m_client.clientInfo);
-    userData = adoptRef(toWK(userDataToPass));
+    m_client.didRemoveFrameFromHierarchy(toAPI(page), toAPI(frame), &userDataToPass, m_client.clientInfo);
+    userData = adoptRef(toImpl(userDataToPass));
 }
 
 void InjectedBundlePageLoaderClient::didClearWindowObjectForFrame(WebPage* page, WebFrame* frame, DOMWrapperWorld* world)
@@ -162,7 +162,7 @@ void InjectedBundlePageLoaderClient::didClearWindowObjectForFrame(WebPage* page,
     if (!m_client.didClearWindowObjectForFrame)
         return;
 
-    m_client.didClearWindowObjectForFrame(toRef(page), toRef(frame), toRef(InjectedBundleScriptWorld::getOrCreate(world).get()), m_client.clientInfo);
+    m_client.didClearWindowObjectForFrame(toAPI(page), toAPI(frame), toAPI(InjectedBundleScriptWorld::getOrCreate(world).get()), m_client.clientInfo);
 }
 
 void InjectedBundlePageLoaderClient::didCancelClientRedirectForFrame(WebPage* page, WebFrame* frame)
@@ -170,7 +170,7 @@ void InjectedBundlePageLoaderClient::didCancelClientRedirectForFrame(WebPage* pa
     if (!m_client.didCancelClientRedirectForFrame)
         return;
 
-    m_client.didCancelClientRedirectForFrame(toRef(page), toRef(frame), m_client.clientInfo);
+    m_client.didCancelClientRedirectForFrame(toAPI(page), toAPI(frame), m_client.clientInfo);
 }
 
 void InjectedBundlePageLoaderClient::willPerformClientRedirectForFrame(WebPage* page, WebFrame* frame, const String& url, double delay, double date)
@@ -178,7 +178,7 @@ void InjectedBundlePageLoaderClient::willPerformClientRedirectForFrame(WebPage*
     if (!m_client.willPerformClientRedirectForFrame)
         return;
 
-    m_client.willPerformClientRedirectForFrame(toRef(page), toRef(frame), toURLRef(url.impl()), delay, date, m_client.clientInfo);
+    m_client.willPerformClientRedirectForFrame(toAPI(page), toAPI(frame), toURLRef(url.impl()), delay, date, m_client.clientInfo);
 }
 
 void InjectedBundlePageLoaderClient::didChangeLocationWithinPageForFrame(WebPage* page, WebFrame* frame)
@@ -186,7 +186,7 @@ void InjectedBundlePageLoaderClient::didChangeLocationWithinPageForFrame(WebPage
     if (!m_client.didChangeLocationWithinPageForFrame)
         return;
 
-    m_client.didChangeLocationWithinPageForFrame(toRef(page), toRef(frame), m_client.clientInfo);
+    m_client.didChangeLocationWithinPageForFrame(toAPI(page), toAPI(frame), m_client.clientInfo);
 }
 
 void InjectedBundlePageLoaderClient::didHandleOnloadEventsForFrame(WebPage* page, WebFrame* frame)
@@ -194,7 +194,7 @@ void InjectedBundlePageLoaderClient::didHandleOnloadEventsForFrame(WebPage* page
     if (!m_client.didHandleOnloadEventsForFrame)
         return;
 
-    m_client.didHandleOnloadEventsForFrame(toRef(page), toRef(frame), m_client.clientInfo);
+    m_client.didHandleOnloadEventsForFrame(toAPI(page), toAPI(frame), m_client.clientInfo);
 }
 
 void InjectedBundlePageLoaderClient::didDisplayInsecureContentForFrame(WebPage* page, WebFrame* frame)
@@ -202,7 +202,7 @@ void InjectedBundlePageLoaderClient::didDisplayInsecureContentForFrame(WebPage*
     if (!m_client.didDisplayInsecureContentForFrame)
         return;
 
-    m_client.didDisplayInsecureContentForFrame(toRef(page), toRef(frame), m_client.clientInfo);
+    m_client.didDisplayInsecureContentForFrame(toAPI(page), toAPI(frame), m_client.clientInfo);
 }
 
 void InjectedBundlePageLoaderClient::didRunInsecureContentForFrame(WebPage* page, WebFrame* frame)
@@ -210,7 +210,7 @@ void InjectedBundlePageLoaderClient::didRunInsecureContentForFrame(WebPage* page
     if (!m_client.didRunInsecureContentForFrame)
         return;
 
-    m_client.didRunInsecureContentForFrame(toRef(page), toRef(frame), m_client.clientInfo);
+    m_client.didRunInsecureContentForFrame(toAPI(page), toAPI(frame), m_client.clientInfo);
 }
 
 } // namespace WebKit
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp
index 630502c..b5ea845 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp
@@ -50,31 +50,31 @@ void InjectedBundlePageUIClient::initialize(WKBundlePageUIClient* client)
 void InjectedBundlePageUIClient::willAddMessageToConsole(WebPage* page, const String& message, int32_t lineNumber)
 {
     if (m_client.willAddMessageToConsole)
-        m_client.willAddMessageToConsole(toRef(page), toRef(message.impl()), lineNumber, m_client.clientInfo);
+        m_client.willAddMessageToConsole(toAPI(page), toAPI(message.impl()), lineNumber, m_client.clientInfo);
 }
 
 void InjectedBundlePageUIClient::willSetStatusbarText(WebPage* page, const String& statusbarText)
 {
     if (m_client.willSetStatusbarText)
-        m_client.willSetStatusbarText(toRef(page), toRef(statusbarText.impl()), m_client.clientInfo);
+        m_client.willSetStatusbarText(toAPI(page), toAPI(statusbarText.impl()), m_client.clientInfo);
 }
 
 void InjectedBundlePageUIClient::willRunJavaScriptAlert(WebPage* page, const String& alertText, WebFrame* frame)
 {
     if (m_client.willRunJavaScriptAlert)
-        m_client.willRunJavaScriptAlert(toRef(page), toRef(alertText.impl()), toRef(frame), m_client.clientInfo);
+        m_client.willRunJavaScriptAlert(toAPI(page), toAPI(alertText.impl()), toAPI(frame), m_client.clientInfo);
 }
 
 void InjectedBundlePageUIClient::willRunJavaScriptConfirm(WebPage* page, const String& message, WebFrame* frame)
 {
     if (m_client.willRunJavaScriptConfirm)
-        m_client.willRunJavaScriptConfirm(toRef(page), toRef(message.impl()), toRef(frame), m_client.clientInfo);
+        m_client.willRunJavaScriptConfirm(toAPI(page), toAPI(message.impl()), toAPI(frame), m_client.clientInfo);
 }
 
 void InjectedBundlePageUIClient::willRunJavaScriptPrompt(WebPage* page, const String& message, const String& defaultValue, WebFrame* frame)
 {
     if (m_client.willRunJavaScriptPrompt)
-        m_client.willRunJavaScriptPrompt(toRef(page), toRef(message.impl()), toRef(defaultValue.impl()), toRef(frame), m_client.clientInfo);
+        m_client.willRunJavaScriptPrompt(toAPI(page), toAPI(message.impl()), toAPI(defaultValue.impl()), toAPI(frame), m_client.clientInfo);
 }
 
 void InjectedBundlePageUIClient::mouseDidMoveOverElement(WebPage* page, const HitTestResult& coreHitTestResult, WebEvent::Modifiers modifiers, RefPtr<APIObject>& userData)
@@ -85,8 +85,8 @@ void InjectedBundlePageUIClient::mouseDidMoveOverElement(WebPage* page, const Hi
     RefPtr<InjectedBundleHitTestResult> hitTestResult = InjectedBundleHitTestResult::create(coreHitTestResult);
 
     WKTypeRef userDataToPass = 0;
-    m_client.mouseDidMoveOverElement(toRef(page), toRef(hitTestResult.get()), toRef(modifiers), &userDataToPass, m_client.clientInfo);
-    userData = adoptRef(toWK(userDataToPass));
+    m_client.mouseDidMoveOverElement(toAPI(page), toAPI(hitTestResult.get()), toAPI(modifiers), &userDataToPass, m_client.clientInfo);
+    userData = adoptRef(toImpl(userDataToPass));
 }
 
 } // namespace WebKit
diff --git a/WebKit2/WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp b/WebKit2/WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp
index 3a3ffb4..dfef8a3 100644
--- a/WebKit2/WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp
@@ -82,7 +82,7 @@ bool InjectedBundle::load()
         return false;
     }
 
-    initializeFunction(toRef(this));
+    initializeFunction(toAPI(this));
     return true;
 }
 
diff --git a/WebKit2/WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp b/WebKit2/WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp
index 10a267a..b1e5b26 100644
--- a/WebKit2/WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp
@@ -45,7 +45,7 @@ bool InjectedBundle::load()
     if (!initializeFunction)
         return false;
 
-    initializeFunction(toRef(this));
+    initializeFunction(toAPI(this));
     return true;
 }
 
diff --git a/WebKit2/WebProcess/InjectedBundle/win/InjectedBundleWin.cpp b/WebKit2/WebProcess/InjectedBundle/win/InjectedBundleWin.cpp
index feef104..c30b20a 100644
--- a/WebKit2/WebProcess/InjectedBundle/win/InjectedBundleWin.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/win/InjectedBundleWin.cpp
@@ -76,7 +76,7 @@ bool InjectedBundle::load()
     if (!initializeFunction)
         return false;
 
-    initializeFunction(toRef(this));
+    initializeFunction(toAPI(this));
     return true;
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list