[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 15:48:25 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit fbd2b6bb272bf82764503f381642ad3cc15bc9e4
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 12 18:39:53 2010 +0000

    ASSERTION when converting some WKStringRefs returned from willSubmitForm to CFStringRef
    <rdar://problem/8662180>
    https://bugs.webkit.org/show_bug.cgi?id=49454
    
    Reviewed by Anders Carlsson.
    
    Enforce the invariant that a WebString never contains a null WTF::String at a
    lower level, in the WebString constructor, instead of relying on the callers of
    WebString::create to do it.
    
    * Shared/API/c/WKSharedAPICast.h:
    (WebKit::toAPI):
    (WebKit::toCopiedAPI): Remove null string check...
    
    * Shared/WebString.h:
    (WebKit::WebString::WebString): ... and move it to the constructor.
    
    * Shared/API/c/WKURL.cpp:
    (WKURLCopyString): Use toCopiedAPI() instead of calling WebString directly
    to match other similar uses.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71930 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 91621a4..83bfb99 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,26 @@
+2010-11-12  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        ASSERTION when converting some WKStringRefs returned from willSubmitForm to CFStringRef
+        <rdar://problem/8662180>
+        https://bugs.webkit.org/show_bug.cgi?id=49454
+
+        Enforce the invariant that a WebString never contains a null WTF::String at a
+        lower level, in the WebString constructor, instead of relying on the callers of
+        WebString::create to do it.
+
+        * Shared/API/c/WKSharedAPICast.h:
+        (WebKit::toAPI):
+        (WebKit::toCopiedAPI): Remove null string check...
+
+        * Shared/WebString.h:
+        (WebKit::WebString::WebString): ... and move it to the constructor.
+
+        * Shared/API/c/WKURL.cpp:
+        (WKURLCopyString): Use toCopiedAPI() instead of calling WebString directly
+        to match other similar uses.
+
 2010-11-12  Andreas Kling  <kling at webkit.org>
 
         Reviewed by Antonio Gomes.
diff --git a/WebKit2/Shared/API/c/WKSharedAPICast.h b/WebKit2/Shared/API/c/WKSharedAPICast.h
index 116fa1d..773376c 100644
--- a/WebKit2/Shared/API/c/WKSharedAPICast.h
+++ b/WebKit2/Shared/API/c/WKSharedAPICast.h
@@ -115,14 +115,12 @@ inline typename ImplTypeInfo<T>::APIType toAPI(T t)
 
 inline ProxyingRefPtr<WebString> toAPI(StringImpl* string)
 {
-    StringImpl* impl = string ? string : StringImpl::empty();
-    return ProxyingRefPtr<WebString>(WebString::create(String(impl)));
+    return ProxyingRefPtr<WebString>(WebString::create(string));
 }
 
 inline WKStringRef toCopiedAPI(const String& string)
 {
-    StringImpl* impl = string.impl() ? string.impl() : StringImpl::empty();
-    RefPtr<WebString> webString = WebString::create(String(impl));
+    RefPtr<WebString> webString = WebString::create(string);
     return toAPI(webString.release().releaseRef());
 }
 
diff --git a/WebKit2/Shared/API/c/WKURL.cpp b/WebKit2/Shared/API/c/WKURL.cpp
index f2237fb..0060b34 100644
--- a/WebKit2/Shared/API/c/WKURL.cpp
+++ b/WebKit2/Shared/API/c/WKURL.cpp
@@ -41,7 +41,7 @@ WKURLRef WKURLCreateWithUTF8CString(const char* string)
 
 WKStringRef WKURLCopyString(WKURLRef url)
 {
-    return toAPI(WebString::create(toImpl(url)->string()).leakRef());
+    return toCopiedAPI(toImpl(url)->string());
 }
 
 bool WKURLIsEqual(WKURLRef a, WKURLRef b)
diff --git a/WebKit2/Shared/WebString.h b/WebKit2/Shared/WebString.h
index 0053b8e..4ad786b 100644
--- a/WebKit2/Shared/WebString.h
+++ b/WebKit2/Shared/WebString.h
@@ -81,7 +81,7 @@ public:
 
 private:
     WebString(const String& string)
-        : m_string(string)
+        : m_string(!string.impl() ? String(StringImpl::empty()) : string)
     {
     }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list