[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 16:13:52 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit bcf10fcd242593cc215542b5bfe380198d10b149
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 19 21:50:21 2010 +0000

    Make it possible to encode null SandboxExtension handles
    https://bugs.webkit.org/show_bug.cgi?id=49825
    
    Reviewed by Darin Adler.
    
    * Shared/mac/SandboxExtensionMac.mm:
    (WebKit::SandboxExtension::Handle::encode):
    If there's no underlying sandbox extension, just encode an empty byte array.
    
    (WebKit::SandboxExtension::Handle::decode):
    If the decoded byte array is empty, don't try to create a sandbox extension.
    
    (WebKit::SandboxExtension::create):
    If the handle is null, return null.
    
    (WebKit::SandboxExtension::consume):
    Consuming shuld not null out the underlying sandbox extension object.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72434 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 38d0b9d..21a8652 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,23 @@
+2010-11-19  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Make it possible to encode null SandboxExtension handles
+        https://bugs.webkit.org/show_bug.cgi?id=49825
+
+        * Shared/mac/SandboxExtensionMac.mm:
+        (WebKit::SandboxExtension::Handle::encode):
+        If there's no underlying sandbox extension, just encode an empty byte array.
+
+        (WebKit::SandboxExtension::Handle::decode):
+        If the decoded byte array is empty, don't try to create a sandbox extension.
+
+        (WebKit::SandboxExtension::create):
+        If the handle is null, return null.
+
+        (WebKit::SandboxExtension::consume):
+        Consuming shuld not null out the underlying sandbox extension object.
+
 2010-11-19  Steve Falkenburg  <sfalken at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebKit2/Shared/mac/SandboxExtensionMac.mm b/WebKit2/Shared/mac/SandboxExtensionMac.mm
index b2536af..d17360b 100644
--- a/WebKit2/Shared/mac/SandboxExtensionMac.mm
+++ b/WebKit2/Shared/mac/SandboxExtensionMac.mm
@@ -53,7 +53,10 @@ SandboxExtension::Handle::~Handle()
 
 void SandboxExtension::Handle::encode(CoreIPC::ArgumentEncoder* encoder) const
 {
-    ASSERT(m_sandboxExtension);
+    if (!m_sandboxExtension) {
+        encoder->encodeBytes(0, 0);
+        return;
+    }
 
     size_t length = 0;
     const char *serializedFormat = WKSandboxExtensionGetSerializedFormat(m_sandboxExtension, &length);
@@ -74,12 +77,18 @@ bool SandboxExtension::Handle::decode(CoreIPC::ArgumentDecoder* decoder, Handle&
     if (!decoder->decodeBytes(dataReference))
         return false;
 
+    if (dataReference.isEmpty())
+        return true;
+
     result.m_sandboxExtension = WKSandboxExtensionCreateFromSerializedFormat(reinterpret_cast<const char*>(dataReference.data()), dataReference.size());
     return true;
 }
 
 PassRefPtr<SandboxExtension> SandboxExtension::create(const Handle& handle)
 {
+    if (!handle.m_sandboxExtension)
+        return 0;
+
     return adoptRef(new SandboxExtension(handle));
 }
 
@@ -134,11 +143,7 @@ bool SandboxExtension::consume()
 {
     ASSERT(m_sandboxExtension);
 
-    bool result = WKSandboxExtensionConsume(m_sandboxExtension);
-    WKSandboxExtensionDestroy(m_sandboxExtension);
-    m_sandboxExtension = 0;
-
-    return result;
+    return WKSandboxExtensionConsume(m_sandboxExtension);
 }
 
 } // namespace WebKit

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list