[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 13:46:38 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit ac2fb1e6e872f749a41a6a6741f965c9035d38c8
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sun Sep 26 21:48:19 2010 +0000
Make it possible to encode null SharedMemory::Handle objects
https://bugs.webkit.org/show_bug.cgi?id=46585
Reviewed by Sam Weinig.
* Platform/SharedMemory.h:
(WebKit::SharedMemory::Handle::isNull):
Add isNull.
* Platform/mac/SharedMemoryMac.cpp:
(WebKit::SharedMemory::Handle::encode):
Remove asserts.
(WebKit::SharedMemory::create):
Bail if we see a null handle. Also work around a kernel bug where
mach_vm_map fails if the given address to map is already mapped, even if
VM_FLAG_ANYWHERE is set.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68352 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 0ce665c..3247748 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -2,6 +2,26 @@
Reviewed by Sam Weinig.
+ Make it possible to encode null SharedMemory::Handle objects
+ https://bugs.webkit.org/show_bug.cgi?id=46585
+
+ * Platform/SharedMemory.h:
+ (WebKit::SharedMemory::Handle::isNull):
+ Add isNull.
+
+ * Platform/mac/SharedMemoryMac.cpp:
+ (WebKit::SharedMemory::Handle::encode):
+ Remove asserts.
+
+ (WebKit::SharedMemory::create):
+ Bail if we see a null handle. Also work around a kernel bug where
+ mach_vm_map fails if the given address to map is already mapped, even if
+ VM_FLAG_ANYWHERE is set.
+
+2010-09-26 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
Add BackingStore class
https://bugs.webkit.org/show_bug.cgi?id=46584
diff --git a/WebKit2/Platform/SharedMemory.h b/WebKit2/Platform/SharedMemory.h
index d7708d1..db3ee4a 100644
--- a/WebKit2/Platform/SharedMemory.h
+++ b/WebKit2/Platform/SharedMemory.h
@@ -49,6 +49,8 @@ public:
Handle();
~Handle();
+ bool isNull() const { return !m_port; }
+
void encode(CoreIPC::ArgumentEncoder*) const;
static bool decode(CoreIPC::ArgumentDecoder*, Handle&);
diff --git a/WebKit2/Platform/mac/SharedMemoryMac.cpp b/WebKit2/Platform/mac/SharedMemoryMac.cpp
index 4a65be3..117c9c0 100644
--- a/WebKit2/Platform/mac/SharedMemoryMac.cpp
+++ b/WebKit2/Platform/mac/SharedMemoryMac.cpp
@@ -50,9 +50,6 @@ SharedMemory::Handle::~Handle()
void SharedMemory::Handle::encode(CoreIPC::ArgumentEncoder* encoder) const
{
- ASSERT(m_port);
- ASSERT(m_size);
-
encoder->encodeUInt64(m_size);
encoder->encode(CoreIPC::MachPort(m_port, MACH_MSG_TYPE_COPY_SEND));
m_port = MACH_PORT_NULL;
@@ -115,12 +112,12 @@ static inline vm_prot_t machProtection(SharedMemory::Protection protection)
PassRefPtr<SharedMemory> SharedMemory::create(const Handle& handle, Protection protection)
{
- if (!handle.m_port)
+ if (handle.isNull())
return 0;
// Map the memory.
vm_prot_t vmProtection = machProtection(protection);
- mach_vm_address_t mappedAddress;
+ mach_vm_address_t mappedAddress = 0;
kern_return_t kr = mach_vm_map(mach_task_self(), &mappedAddress, handle.m_size, 0, VM_FLAGS_ANYWHERE, handle.m_port, 0, false, vmProtection, vmProtection, VM_INHERIT_NONE);
if (kr != KERN_SUCCESS)
return 0;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list