Title: [93634] tags/Safari-534.49.2/Source/WebKit2

Diff

Modified: tags/Safari-534.49.2/Source/WebKit2/ChangeLog (93633 => 93634)


--- tags/Safari-534.49.2/Source/WebKit2/ChangeLog	2011-08-23 20:32:27 UTC (rev 93633)
+++ tags/Safari-534.49.2/Source/WebKit2/ChangeLog	2011-08-23 20:34:03 UTC (rev 93634)
@@ -1,3 +1,27 @@
+2011-08-23  Lucas Forschler  <[email protected]>
+
+    Merged 93546
+
+    2011-08-21  Michael Saboff  <[email protected]>
+
+            REGRESSION (r92231): Apple campus proposal PDF doesn't display in Safari
+            https://bugs.webkit.org/show_bug.cgi?id=66464
+
+            Changed ArgumentEncoder to use system malloc instead of fastMalloc.
+            FastMalloc uses madvise(MADV_FREE_REUSABLE) which is incompatible with
+            mach message Out Of Line (OOL) messages that use MACH_MSG_VIRTUAL_COPY.
+            The system malloc has no such limitation.
+            Changed sendOutgoingMessage to use MACH_MSG_VIRTUAL_COPY again as it 
+            doesn't have size limitations that MACH_MSG_PHYSICAL_COPY.
+
+            Reviewed by Anders Carlsson.
+
+            * Platform/CoreIPC/ArgumentEncoder.cpp:
+            (CoreIPC::ArgumentEncoder::~ArgumentEncoder):
+            (CoreIPC::ArgumentEncoder::grow):
+            * Platform/CoreIPC/mac/ConnectionMac.cpp:
+            (CoreIPC::Connection::sendOutgoingMessage):
+
 2011-08-04  Lucas Forschler  <[email protected]>
 
     Merged 90705.

Modified: tags/Safari-534.49.2/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp (93633 => 93634)


--- tags/Safari-534.49.2/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp	2011-08-23 20:32:27 UTC (rev 93633)
+++ tags/Safari-534.49.2/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp	2011-08-23 20:34:03 UTC (rev 93634)
@@ -49,7 +49,7 @@
 ArgumentEncoder::~ArgumentEncoder()
 {
     if (m_buffer)
-        fastFree(m_buffer);
+        free(m_buffer);
 #if !USE(UNIX_DOMAIN_SOCKETS)
     // FIXME: We need to dispose of the attachments in cases of failure.
 #else
@@ -69,10 +69,13 @@
     
     if (alignedSize + size > m_bufferCapacity) {
         size_t newCapacity = std::max(alignedSize + size, std::max(static_cast<size_t>(32), m_bufferCapacity + m_bufferCapacity / 4 + 1));
+        // Use system malloc / realloc instead of fastMalloc due to 
+        // fastMalloc using MADV_FREE_REUSABLE doesn't work with
+        // mach messages with OOL message and MACH_MSG_VIRTUAL_COPY.
         if (!m_buffer)
-            m_buffer = static_cast<uint8_t*>(fastMalloc(newCapacity));
+            m_buffer = static_cast<uint8_t*>(malloc(newCapacity));
         else
-            m_buffer = static_cast<uint8_t*>(fastRealloc(m_buffer, newCapacity));
+            m_buffer = static_cast<uint8_t*>(realloc(m_buffer, newCapacity));
         
         // FIXME: What should we do if allocating memory fails?
 

Modified: tags/Safari-534.49.2/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp (93633 => 93634)


--- tags/Safari-534.49.2/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp	2011-08-23 20:32:27 UTC (rev 93633)
+++ tags/Safari-534.49.2/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp	2011-08-23 20:34:03 UTC (rev 93634)
@@ -155,7 +155,7 @@
     if (messageSize > sizeof(buffer)) {
         messageBodyIsOOL = true;
 
-        attachments.append(Attachment(arguments->buffer(), arguments->bufferSize(), MACH_MSG_PHYSICAL_COPY, false));
+        attachments.append(Attachment(arguments->buffer(), arguments->bufferSize(), MACH_MSG_VIRTUAL_COPY, false));
         numberOfOOLMemoryDescriptors++;
         messageSize = machMessageSize(0, numberOfPortDescriptors, numberOfOOLMemoryDescriptors);
     }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to