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

weinig at apple.com weinig at apple.com
Wed Dec 22 12:55:48 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit dda05aebe75c004cca35c07a26277bc94b835de5
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 2 04:00:14 2010 +0000

    Fix the build.
    
    As with CF, const struct OpaqueType* should be the default type
    so that const_casts are not necessary in user code.
    
    * UIProcess/API/C/WKArray.cpp:
    (WKArrayCreate):
    * UIProcess/API/C/WKBase.h:
    * UIProcess/API/C/WKType.cpp:
    (WKGetTypeID):
    (WKRetain):
    (WKRelease):
    * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
    (toWK):
    * WebProcess/InjectedBundle/API/c/WKBundleBase.h:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66639 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 6da0f73..b571768 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,23 @@
 2010-09-01  Sam Weinig  <sam at webkit.org>
 
+        Fix the build.
+
+        As with CF, const struct OpaqueType* should be the default type
+        so that const_casts are not necessary in user code.
+
+        * UIProcess/API/C/WKArray.cpp:
+        (WKArrayCreate):
+        * UIProcess/API/C/WKBase.h:
+        * UIProcess/API/C/WKType.cpp:
+        (WKGetTypeID):
+        (WKRetain):
+        (WKRelease):
+        * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
+        (toWK):
+        * WebProcess/InjectedBundle/API/c/WKBundleBase.h:
+
+2010-09-01  Sam Weinig  <sam at webkit.org>
+
         Reviewed by Adam Roben.
 
         Add mutable array API to WebKit2
diff --git a/WebKit2/UIProcess/API/C/WKArray.cpp b/WebKit2/UIProcess/API/C/WKArray.cpp
index c11dd85..656a4cc 100644
--- a/WebKit2/UIProcess/API/C/WKArray.cpp
+++ b/WebKit2/UIProcess/API/C/WKArray.cpp
@@ -37,7 +37,7 @@ WKTypeID WKArrayGetTypeID()
 
 WKArrayRef WKArrayCreate(WKTypeRef* values, size_t numberOfValues)
 {
-    RefPtr<ImmutableArray> array = ImmutableArray::create(reinterpret_cast<APIObject**>(values), numberOfValues);
+    RefPtr<ImmutableArray> array = ImmutableArray::create(reinterpret_cast<APIObject**>(const_cast<void**>(values)), numberOfValues);
     return toRef(array.release().releaseRef());
 }
 
diff --git a/WebKit2/UIProcess/API/C/WKBase.h b/WebKit2/UIProcess/API/C/WKBase.h
index e5768d1..d6f8638 100644
--- a/WebKit2/UIProcess/API/C/WKBase.h
+++ b/WebKit2/UIProcess/API/C/WKBase.h
@@ -33,28 +33,28 @@
 #endif
 
 typedef uint32_t WKTypeID;
-typedef void* WKTypeRef;
+typedef const void* WKTypeRef;
 
 typedef const struct OpaqueWKArray* WKArrayRef;
 typedef struct OpaqueWKArray* WKMutableArrayRef;
 
-typedef struct OpaqueWKBackForwardList* WKBackForwardListRef;
-typedef struct OpaqueWKBackForwardListItem* WKBackForwardListItemRef;
-typedef struct OpaqueWKContext* WKContextRef;
-typedef struct OpaqueWKData* WKDataRef;
-typedef struct OpaqueWKDictionary* WKDictionaryRef;
-typedef struct OpaqueWKError* WKErrorRef;
-typedef struct OpaqueWKFormSubmissionListener* WKFormSubmissionListenerRef;
-typedef struct OpaqueWKFrame* WKFrameRef;
-typedef struct OpaqueWKFramePolicyListener* WKFramePolicyListenerRef;
-typedef struct OpaqueWKNavigationData* WKNavigationDataRef;
-typedef struct OpaqueWKPage* WKPageRef;
-typedef struct OpaqueWKPageNamespace* WKPageNamespaceRef;
-typedef struct OpaqueWKPreferences* WKPreferencesRef;
-typedef struct OpaqueWKString* WKStringRef;
-typedef struct OpaqueWKURL* WKURLRef;
-typedef struct OpaqueWKURLRequest* WKURLRequestRef;
-typedef struct OpaqueWKURLResponse* WKURLResponseRef;
+typedef const struct OpaqueWKBackForwardList* WKBackForwardListRef;
+typedef const struct OpaqueWKBackForwardListItem* WKBackForwardListItemRef;
+typedef const struct OpaqueWKContext* WKContextRef;
+typedef const struct OpaqueWKData* WKDataRef;
+typedef const struct OpaqueWKDictionary* WKDictionaryRef;
+typedef const struct OpaqueWKError* WKErrorRef;
+typedef const struct OpaqueWKFormSubmissionListener* WKFormSubmissionListenerRef;
+typedef const struct OpaqueWKFrame* WKFrameRef;
+typedef const struct OpaqueWKFramePolicyListener* WKFramePolicyListenerRef;
+typedef const struct OpaqueWKNavigationData* WKNavigationDataRef;
+typedef const struct OpaqueWKPage* WKPageRef;
+typedef const struct OpaqueWKPageNamespace* WKPageNamespaceRef;
+typedef const struct OpaqueWKPreferences* WKPreferencesRef;
+typedef const struct OpaqueWKString* WKStringRef;
+typedef const struct OpaqueWKURL* WKURLRef;
+typedef const struct OpaqueWKURLRequest* WKURLRequestRef;
+typedef const struct OpaqueWKURLResponse* WKURLResponseRef;
 
 #undef WK_EXPORT
 #if defined(WK_NO_EXPORT)
diff --git a/WebKit2/UIProcess/API/C/WKType.cpp b/WebKit2/UIProcess/API/C/WKType.cpp
index 16abbe3..00a3d52 100644
--- a/WebKit2/UIProcess/API/C/WKType.cpp
+++ b/WebKit2/UIProcess/API/C/WKType.cpp
@@ -32,16 +32,16 @@ using namespace WebKit;
 
 WKTypeID WKGetTypeID(WKTypeRef typeRef)
 {
-    return toRef(static_cast<APIObject*>(typeRef)->type());
+    return toRef(static_cast<APIObject*>(const_cast<void*>(typeRef))->type());
 }
 
 WKTypeRef WKRetain(WKTypeRef typeRef)
 {
-    static_cast<APIObject*>(typeRef)->ref();
+    static_cast<APIObject*>(const_cast<void*>(typeRef))->ref();
     return typeRef;
 }
 
 void WKRelease(WKTypeRef typeRef)
 {
-    static_cast<APIObject*>(typeRef)->deref();
+    static_cast<APIObject*>(const_cast<void*>(typeRef))->deref();
 }
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
index 3922cae..9b35d59 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
@@ -77,7 +77,10 @@ template<> struct BundleImplTypeInfo<WebCore::Range*>                   { typede
 template<typename T>
 inline typename WebKit::BundleAPITypeInfo<T>::ImplType toWK(T t)
 {
-    return reinterpret_cast<typename WebKit::BundleAPITypeInfo<T>::ImplType>(t);
+    typedef typename WTF::RemovePointer<T>::Type PotentiallyConstValueType;
+    typedef typename WTF::RemoveConst<PotentiallyConstValueType>::Type NonConstValueType;
+
+    return reinterpret_cast<typename WebKit::BundleAPITypeInfo<T>::ImplType>(const_cast<NonConstValueType*>(t));
 }
 
 template<typename T>
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBase.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBase.h
index 194c3c2..51c1c70 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBase.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBase.h
@@ -26,15 +26,15 @@
 #ifndef WKBundleBase_h
 #define WKBundleBase_h
 
-typedef struct OpaqueWKBundle* WKBundleRef;
-typedef struct OpaqueWKBundleFrame* WKBundleFrameRef;
-typedef struct OpaqueWKBundleNodeHandle* WKBundleNodeHandleRef;
-typedef struct OpaqueWKBundlePage* WKBundlePageRef;
-typedef struct OpaqueWKBundleScriptWorld* WKBundleScriptWorldRef;
+typedef const struct OpaqueWKBundle* WKBundleRef;
+typedef const struct OpaqueWKBundleFrame* WKBundleFrameRef;
+typedef const struct OpaqueWKBundleNodeHandle* WKBundleNodeHandleRef;
+typedef const struct OpaqueWKBundlePage* WKBundlePageRef;
+typedef const struct OpaqueWKBundleScriptWorld* WKBundleScriptWorldRef;
 
-typedef struct OpaqueWKBundleDOMCSSStyleDeclaration* WKBundleCSSStyleDeclarationRef;
-typedef struct OpaqueWKBundleNode* WKBundleNodeRef;
-typedef struct OpaqueWKBundleRange* WKBundleRangeRef;
+typedef const struct OpaqueWKBundleDOMCSSStyleDeclaration* WKBundleCSSStyleDeclarationRef;
+typedef const struct OpaqueWKBundleNode* WKBundleNodeRef;
+typedef const struct OpaqueWKBundleRange* WKBundleRangeRef;
 
 #undef WK_EXPORT
 #if defined(WK_NO_EXPORT)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list