[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-142-g786665c

andersca at apple.com andersca at apple.com
Mon Dec 27 16:27:43 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 39280b2066c3b459a2563402dc3599b5b180eb26
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 21 20:59:54 2010 +0000

    2010-12-21  Anders Carlsson  <andersca at apple.com>
    
            Reviewed by Darin Adler.
    
            Add ArgumentCoder support for CFDataRef
            https://bugs.webkit.org/show_bug.cgi?id=51412
    
            * Shared/cf/ArgumentCodersCF.cpp:
            (CoreIPC::typeFromCFTypeRef):
            (CoreIPC::encode):
            (CoreIPC::decode):
            * Shared/cf/ArgumentCodersCF.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74422 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index cebb183..927f7db 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,18 @@
 2010-12-21  Anders Carlsson  <andersca at apple.com>
 
+        Reviewed by Darin Adler.
+
+        Add ArgumentCoder support for CFDataRef
+        https://bugs.webkit.org/show_bug.cgi?id=51412
+
+        * Shared/cf/ArgumentCodersCF.cpp:
+        (CoreIPC::typeFromCFTypeRef):
+        (CoreIPC::encode):
+        (CoreIPC::decode):
+        * Shared/cf/ArgumentCodersCF.h:
+
+2010-12-21  Anders Carlsson  <andersca at apple.com>
+
         Reviewed by John Sullivan.
 
         Clicking missing plug-in text does not show a sheet
diff --git a/WebKit2/Shared/cf/ArgumentCodersCF.cpp b/WebKit2/Shared/cf/ArgumentCodersCF.cpp
index e23e600..f977c84 100644
--- a/WebKit2/Shared/cf/ArgumentCodersCF.cpp
+++ b/WebKit2/Shared/cf/ArgumentCodersCF.cpp
@@ -41,6 +41,7 @@ CFTypeRef tokenNullTypeRef()
 enum CFType {
     CFArray,
     CFBoolean,
+    CFData,
     CFDictionary,
     CFNull,
     CFNumber,
@@ -62,6 +63,8 @@ static CFType typeFromCFTypeRef(CFTypeRef type)
         return CFArray;
     if (typeID == CFBooleanGetTypeID())
         return CFBoolean;
+    if (typeID == CFDataGetTypeID())
+        return CFData;
     if (typeID == CFDictionaryGetTypeID())
         return CFDictionary;
     if (typeID == CFNullGetTypeID())
@@ -89,6 +92,9 @@ static void encode(ArgumentEncoder* encoder, CFTypeRef typeRef)
     case CFBoolean:
         encode(encoder, static_cast<CFBooleanRef>(typeRef));
         return;
+    case CFData:
+        encode(encoder, static_cast<CFDataRef>(typeRef));
+        return;
     case CFDictionary:
         encode(encoder, static_cast<CFDictionaryRef>(typeRef));
         return;
@@ -133,6 +139,13 @@ static bool decode(ArgumentDecoder* decoder, RetainPtr<CFTypeRef>& result)
         result.adoptCF(boolean.leakRef());
         return true;
     }
+    case CFData: {
+        RetainPtr<CFDictionaryRef> data;
+        if (!decode(decoder, data))
+            return false;
+        result.adoptCF(data.leakRef());
+        return true;
+    }
     case CFDictionary: {
         RetainPtr<CFDictionaryRef> dictionary;
         if (!decode(decoder, dictionary))
@@ -225,6 +238,24 @@ bool decode(ArgumentDecoder* decoder, RetainPtr<CFBooleanRef>& result)
     return true;
 }
 
+void encode(ArgumentEncoder* encoder, CFDataRef data)
+{
+    CFIndex length = CFDataGetLength(data);
+    const UInt8* bytePtr = CFDataGetBytePtr(data);
+
+    encoder->encodeBytes(bytePtr, length);
+}
+
+bool decode(ArgumentDecoder* decoder, RetainPtr<CFDataRef>& result)
+{
+    CoreIPC::DataReference dataReference;
+    if (!decoder->decode(dataReference))
+        return false;
+
+    result.adoptCF(CFDataCreate(0, dataReference.data(), dataReference.size()));
+    return true;
+}
+
 void encode(ArgumentEncoder* encoder, CFDictionaryRef dictionary)
 {
     CFIndex size = CFDictionaryGetCount(dictionary);
diff --git a/WebKit2/Shared/cf/ArgumentCodersCF.h b/WebKit2/Shared/cf/ArgumentCodersCF.h
index 7dbe46c..4caec5f 100644
--- a/WebKit2/Shared/cf/ArgumentCodersCF.h
+++ b/WebKit2/Shared/cf/ArgumentCodersCF.h
@@ -41,6 +41,10 @@ bool decode(ArgumentDecoder*, RetainPtr<CFArrayRef>& result);
 void encode(ArgumentEncoder*, CFBooleanRef);
 bool decode(ArgumentDecoder*, RetainPtr<CFBooleanRef>& result);
 
+// CFDataRef
+void encode(ArgumentEncoder*, CFDataRef);
+bool decode(ArgumentDecoder*, RetainPtr<CFDataRef>& result);
+
 // CFDictionaryRef
 void encode(ArgumentEncoder*, CFDictionaryRef);
 bool decode(ArgumentDecoder*, RetainPtr<CFDictionaryRef>& result);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list