Diff
Modified: trunk/Source/WebKit2/ChangeLog (176451 => 176452)
--- trunk/Source/WebKit2/ChangeLog 2014-11-21 17:05:19 UTC (rev 176451)
+++ trunk/Source/WebKit2/ChangeLog 2014-11-21 17:40:50 UTC (rev 176452)
@@ -1,3 +1,52 @@
+2014-11-21 Antti Koivisto <an...@apple.com>
+
+ Remove alignment code from IPC coders
+ https://bugs.webkit.org/show_bug.cgi?id=138963
+
+ Reviewed by Anders Carlsson.
+
+ Alignment code achieves nothing except making the messages somewhat bigger.
+
+ * Platform/IPC/ArgumentCoders.cpp:
+ (IPC::ArgumentCoder<CString>::encode):
+ (IPC::ArgumentCoder<CString>::decode):
+ (IPC::ArgumentCoder<String>::encode):
+ (IPC::decodeStringText):
+ * Platform/IPC/ArgumentCoders.h:
+ (IPC::SimpleArgumentCoder::encode):
+ (IPC::SimpleArgumentCoder::decode):
+ * Platform/IPC/ArgumentDecoder.cpp:
+ (IPC::ArgumentDecoder::initialize):
+ (IPC::ArgumentDecoder::bufferIsLargeEnoughToContain):
+ (IPC::ArgumentDecoder::decodeFixedLengthData):
+ (IPC::ArgumentDecoder::decodeVariableLengthByteArray):
+ (IPC::ArgumentDecoder::decodeNumber):
+ (IPC::ArgumentDecoder::decode):
+ (IPC::roundUpToAlignment): Deleted.
+ (IPC::alignedBufferIsLargeEnoughToContain): Deleted.
+ (IPC::ArgumentDecoder::alignBufferPosition): Deleted.
+ (IPC::decodeValueFromBuffer): Deleted.
+ * Platform/IPC/ArgumentDecoder.h:
+ (IPC::ArgumentDecoder::isInvalid):
+ (IPC::ArgumentDecoder::markInvalid):
+ (IPC::ArgumentDecoder::bufferIsLargeEnoughToContain):
+ * Platform/IPC/ArgumentEncoder.cpp:
+ (IPC::ArgumentEncoder::ArgumentEncoder):
+ (IPC::ArgumentEncoder::grow):
+ (IPC::ArgumentEncoder::encodeFixedLengthData):
+ (IPC::ArgumentEncoder::encodeVariableLengthByteArray):
+ (IPC::ArgumentEncoder::encode):
+ * Platform/IPC/ArgumentEncoder.h:
+ (IPC::ArgumentEncoder::buffer):
+ (IPC::ArgumentEncoder::mutableBuffer):
+ * Platform/IPC/DataReference.cpp:
+ (IPC::SharedBufferDataReference::encode):
+ * Platform/IPC/MessageEncoder.cpp:
+ (IPC::MessageEncoder::setIsSyncMessage):
+ (IPC::MessageEncoder::setShouldDispatchMessageWhenWaitingForSyncReply):
+ * Platform/IPC/mac/ConnectionMac.mm:
+ (IPC::Connection::sendOutgoingMessage):
+
2014-11-21 Anders Carlsson <ander...@apple.com>
Make memoryCache() return a reference
Modified: trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.cpp (176451 => 176452)
--- trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.cpp 2014-11-21 17:05:19 UTC (rev 176451)
+++ trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.cpp 2014-11-21 17:40:50 UTC (rev 176452)
@@ -57,7 +57,7 @@
uint32_t length = string.length();
encoder << length;
- encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(string.data()), length, 1);
+ encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(string.data()), length);
}
bool ArgumentCoder<CString>::decode(ArgumentDecoder& decoder, CString& result)
@@ -80,7 +80,7 @@
char* buffer;
CString string = CString::newUninitialized(length, buffer);
- if (!decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(buffer), length, 1))
+ if (!decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(buffer), length))
return false;
result = string;
@@ -102,9 +102,9 @@
encoder << length << is8Bit;
if (is8Bit)
- encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(string.characters8()), length * sizeof(LChar), alignof(LChar));
+ encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(string.characters8()), length * sizeof(LChar));
else
- encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(string.characters16()), length * sizeof(UChar), alignof(UChar));
+ encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(string.characters16()), length * sizeof(UChar));
}
template <typename CharacterType>
@@ -118,7 +118,7 @@
CharacterType* buffer;
String string = String::createUninitialized(length, buffer);
- if (!decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(buffer), length * sizeof(CharacterType), alignof(CharacterType)))
+ if (!decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(buffer), length * sizeof(CharacterType)))
return false;
result = string;
Modified: trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.h (176451 => 176452)
--- trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.h 2014-11-21 17:05:19 UTC (rev 176451)
+++ trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.h 2014-11-21 17:40:50 UTC (rev 176452)
@@ -41,12 +41,12 @@
template<typename T> struct SimpleArgumentCoder {
static void encode(ArgumentEncoder& encoder, const T& t)
{
- encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(&t), sizeof(T), alignof(T));
+ encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(&t), sizeof(T));
}
static bool decode(ArgumentDecoder& decoder, T& t)
{
- return decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(&t), sizeof(T), alignof(T));
+ return decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(&t), sizeof(T));
}
};
@@ -178,7 +178,7 @@
static void encode(ArgumentEncoder& encoder, const Vector<T, inlineCapacity>& vector)
{
encoder << static_cast<uint64_t>(vector.size());
- encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(vector.data()), vector.size() * sizeof(T), alignof(T));
+ encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(vector.data()), vector.size() * sizeof(T));
}
static bool decode(ArgumentDecoder& decoder, Vector<T, inlineCapacity>& vector)
@@ -198,7 +198,7 @@
Vector<T, inlineCapacity> temp;
temp.resize(size);
- decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(temp.data()), size * sizeof(T), alignof(T));
+ decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(temp.data()), size * sizeof(T));
vector.swap(temp);
return true;
Modified: trunk/Source/WebKit2/Platform/IPC/ArgumentDecoder.cpp (176451 => 176452)
--- trunk/Source/WebKit2/Platform/IPC/ArgumentDecoder.cpp 2014-11-21 17:05:19 UTC (rev 176451)
+++ trunk/Source/WebKit2/Platform/IPC/ArgumentDecoder.cpp 2014-11-21 17:40:50 UTC (rev 176452)
@@ -56,57 +56,30 @@
#endif
}
-static inline uint8_t* roundUpToAlignment(uint8_t* ptr, unsigned alignment)
-{
- // Assert that the alignment is a power of 2.
- ASSERT(alignment && !(alignment & (alignment - 1)));
-
- uintptr_t alignmentMask = alignment - 1;
- return reinterpret_cast<uint8_t*>((reinterpret_cast<uintptr_t>(ptr) + alignmentMask) & ~alignmentMask);
-}
-
void ArgumentDecoder::initialize(const uint8_t* buffer, size_t bufferSize)
{
m_buffer = static_cast<uint8_t*>(malloc(bufferSize));
ASSERT(!(reinterpret_cast<uintptr_t>(m_buffer) % alignof(uint64_t)));
- m_bufferPos = m_buffer;
+ m_bufferPosition = m_buffer;
m_bufferEnd = m_buffer + bufferSize;
memcpy(m_buffer, buffer, bufferSize);
}
-static inline bool alignedBufferIsLargeEnoughToContain(const uint8_t* alignedPosition, const uint8_t* bufferEnd, size_t size)
+bool ArgumentDecoder::bufferIsLargeEnoughToContain(size_t size) const
{
- return bufferEnd >= alignedPosition && static_cast<size_t>(bufferEnd - alignedPosition) >= size;
+ return m_buffer + size <= m_bufferEnd;
}
-bool ArgumentDecoder::alignBufferPosition(unsigned alignment, size_t size)
+bool ArgumentDecoder::decodeFixedLengthData(uint8_t* data, size_t size)
{
- uint8_t* alignedPosition = roundUpToAlignment(m_bufferPos, alignment);
- if (!alignedBufferIsLargeEnoughToContain(alignedPosition, m_bufferEnd, size)) {
- // We've walked off the end of this buffer.
- markInvalid();
+ if (!bufferIsLargeEnoughToContain(size))
return false;
- }
-
- m_bufferPos = alignedPosition;
- return true;
-}
-bool ArgumentDecoder::bufferIsLargeEnoughToContain(unsigned alignment, size_t size) const
-{
- return alignedBufferIsLargeEnoughToContain(roundUpToAlignment(m_bufferPos, alignment), m_bufferEnd, size);
-}
+ memcpy(data, m_bufferPosition, size);
+ m_bufferPosition += size;
-bool ArgumentDecoder::decodeFixedLengthData(uint8_t* data, size_t size, unsigned alignment)
-{
- if (!alignBufferPosition(alignment, size))
- return false;
-
- memcpy(data, m_bufferPos, size);
- m_bufferPos += size;
-
return true;
}
@@ -116,102 +89,71 @@
if (!decode(size))
return false;
- if (!alignBufferPosition(1, size))
+ if (!bufferIsLargeEnoughToContain(size))
return false;
- uint8_t* data = ""
- m_bufferPos += size;
+ uint8_t* data = ""
+ m_bufferPosition += size;
dataReference = DataReference(data, size);
return true;
}
template<typename Type>
-static void decodeValueFromBuffer(Type& value, uint8_t*& bufferPosition)
+bool ArgumentDecoder::decodeNumber(Type& value)
{
- memcpy(&value, bufferPosition, sizeof(value));
- bufferPosition += sizeof(Type);
+ if (!bufferIsLargeEnoughToContain(sizeof(Type)))
+ return false;
+
+ memcpy(&value, m_bufferPosition, sizeof(Type));
+ m_bufferPosition += sizeof(Type);
+
+ return true;
}
bool ArgumentDecoder::decode(bool& result)
{
- if (!alignBufferPosition(sizeof(result), sizeof(result)))
- return false;
-
- decodeValueFromBuffer(result, m_bufferPos);
- return true;
+ return decodeNumber(result);
}
bool ArgumentDecoder::decode(uint8_t& result)
{
- if (!alignBufferPosition(sizeof(result), sizeof(result)))
- return false;
-
- decodeValueFromBuffer(result, m_bufferPos);
- return true;
+ return decodeNumber(result);
}
bool ArgumentDecoder::decode(uint16_t& result)
{
- if (!alignBufferPosition(sizeof(result), sizeof(result)))
- return false;
-
- decodeValueFromBuffer(result, m_bufferPos);
- return true;
+ return decodeNumber(result);
}
bool ArgumentDecoder::decode(uint32_t& result)
{
- if (!alignBufferPosition(sizeof(result), sizeof(result)))
- return false;
-
- decodeValueFromBuffer(result, m_bufferPos);
- return true;
+ return decodeNumber(result);
}
bool ArgumentDecoder::decode(uint64_t& result)
{
- if (!alignBufferPosition(sizeof(result), sizeof(result)))
- return false;
-
- decodeValueFromBuffer(result, m_bufferPos);
- return true;
+ return decodeNumber(result);
}
bool ArgumentDecoder::decode(int32_t& result)
{
- if (!alignBufferPosition(sizeof(result), sizeof(result)))
- return false;
-
- decodeValueFromBuffer(result, m_bufferPos);
- return true;
+ return decodeNumber(result);
}
bool ArgumentDecoder::decode(int64_t& result)
{
- if (!alignBufferPosition(sizeof(result), sizeof(result)))
- return false;
-
- decodeValueFromBuffer(result, m_bufferPos);
- return true;
+ return decodeNumber(result);
}
bool ArgumentDecoder::decode(float& result)
{
- if (!alignBufferPosition(sizeof(result), sizeof(result)))
- return false;
-
- decodeValueFromBuffer(result, m_bufferPos);
- return true;
+ return decodeNumber(result);
}
bool ArgumentDecoder::decode(double& result)
{
- if (!alignBufferPosition(sizeof(result), sizeof(result)))
- return false;
-
- decodeValueFromBuffer(result, m_bufferPos);
- return true;
+ return decodeNumber(result);
}
bool ArgumentDecoder::removeAttachment(Attachment& attachment)
Modified: trunk/Source/WebKit2/Platform/IPC/ArgumentDecoder.h (176451 => 176452)
--- trunk/Source/WebKit2/Platform/IPC/ArgumentDecoder.h 2014-11-21 17:05:19 UTC (rev 176451)
+++ trunk/Source/WebKit2/Platform/IPC/ArgumentDecoder.h 2014-11-21 17:40:50 UTC (rev 176452)
@@ -42,10 +42,10 @@
size_t length() const { return m_bufferEnd - m_buffer; }
- bool isInvalid() const { return m_bufferPos > m_bufferEnd; }
- void markInvalid() { m_bufferPos = m_bufferEnd + 1; }
+ bool isInvalid() const { return m_bufferPosition > m_bufferEnd; }
+ void markInvalid() { m_bufferPosition = m_bufferEnd + 1; }
- bool decodeFixedLengthData(uint8_t*, size_t, unsigned alignment);
+ bool decodeFixedLengthData(uint8_t*, size_t);
// The data in the data reference here will only be valid for the lifetime of the ArgumentDecoder object.
bool decodeVariableLengthByteArray(DataReference&);
@@ -80,7 +80,7 @@
if (numElements > std::numeric_limits<size_t>::max() / sizeof(T))
return false;
- return bufferIsLargeEnoughToContain(alignof(T), numElements * sizeof(T));
+ return bufferIsLargeEnoughToContain(numElements * sizeof(T));
}
// Generic type decode function.
@@ -96,12 +96,12 @@
void initialize(const uint8_t* buffer, size_t bufferSize);
- bool alignBufferPosition(unsigned alignment, size_t size);
- bool bufferIsLargeEnoughToContain(unsigned alignment, size_t size) const;
+ bool bufferIsLargeEnoughToContain(size_t) const;
+ template <typename Type> bool decodeNumber(Type& value);
private:
uint8_t* m_buffer;
- uint8_t* m_bufferPos;
+ uint8_t* m_bufferPosition;
uint8_t* m_bufferEnd;
Vector<Attachment> m_attachments;
Modified: trunk/Source/WebKit2/Platform/IPC/ArgumentEncoder.cpp (176451 => 176452)
--- trunk/Source/WebKit2/Platform/IPC/ArgumentEncoder.cpp 2014-11-21 17:05:19 UTC (rev 176451)
+++ trunk/Source/WebKit2/Platform/IPC/ArgumentEncoder.cpp 2014-11-21 17:40:50 UTC (rev 176452)
@@ -57,7 +57,6 @@
ArgumentEncoder::ArgumentEncoder()
: m_buffer(m_inlineBuffer)
- , m_bufferPointer(m_inlineBuffer)
, m_bufferSize(0)
, m_bufferCapacity(sizeof(m_inlineBuffer))
{
@@ -103,89 +102,78 @@
m_bufferCapacity = newCapacity;
}
-uint8_t* ArgumentEncoder::grow(unsigned alignment, size_t size)
+uint8_t* ArgumentEncoder::grow(size_t size)
{
- size_t alignedSize = roundUpToAlignment(m_bufferSize, alignment);
- reserve(alignedSize + size);
+ size_t position = m_bufferSize;
+ reserve(m_bufferSize + size);
- m_bufferSize = alignedSize + size;
- m_bufferPointer = m_buffer + alignedSize + size;
-
- return m_buffer + alignedSize;
+ m_bufferSize += size;
+
+ return m_buffer + position;
}
-void ArgumentEncoder::encodeFixedLengthData(const uint8_t* data, size_t size, unsigned alignment)
+void ArgumentEncoder::encodeFixedLengthData(const uint8_t* data, size_t size)
{
- ASSERT(!(reinterpret_cast<uintptr_t>(data) % alignment));
-
- uint8_t* buffer = grow(alignment, size);
+ uint8_t* buffer = grow(size);
memcpy(buffer, data, size);
}
void ArgumentEncoder::encodeVariableLengthByteArray(const DataReference& dataReference)
{
encode(static_cast<uint64_t>(dataReference.size()));
- encodeFixedLengthData(dataReference.data(), dataReference.size(), 1);
+ encodeFixedLengthData(dataReference.data(), dataReference.size());
}
template<typename Type>
-static void copyValueToBuffer(Type value, uint8_t* bufferPosition)
+void ArgumentEncoder::encodeNumber(Type value)
{
+ uint8_t* bufferPosition = grow(sizeof(Type));
memcpy(bufferPosition, &value, sizeof(Type));
}
-void ArgumentEncoder::encode(bool n)
+void ArgumentEncoder::encode(bool value)
{
- uint8_t* buffer = grow(sizeof(n), sizeof(n));
- copyValueToBuffer(n, buffer);
+ encodeNumber(value);
}
-void ArgumentEncoder::encode(uint8_t n)
+void ArgumentEncoder::encode(uint8_t value)
{
- uint8_t* buffer = grow(sizeof(n), sizeof(n));
- copyValueToBuffer(n, buffer);
+ encodeNumber(value);
}
-void ArgumentEncoder::encode(uint16_t n)
+void ArgumentEncoder::encode(uint16_t value)
{
- uint8_t* buffer = grow(sizeof(n), sizeof(n));
- copyValueToBuffer(n, buffer);
+ encodeNumber(value);
}
-void ArgumentEncoder::encode(uint32_t n)
+void ArgumentEncoder::encode(uint32_t value)
{
- uint8_t* buffer = grow(sizeof(n), sizeof(n));
- copyValueToBuffer(n, buffer);
+ encodeNumber(value);
}
-void ArgumentEncoder::encode(uint64_t n)
+void ArgumentEncoder::encode(uint64_t value)
{
- uint8_t* buffer = grow(sizeof(n), sizeof(n));
- copyValueToBuffer(n, buffer);
+ encodeNumber(value);
}
-void ArgumentEncoder::encode(int32_t n)
+void ArgumentEncoder::encode(int32_t value)
{
- uint8_t* buffer = grow(sizeof(n), sizeof(n));
- copyValueToBuffer(n, buffer);
+ encodeNumber(value);
}
-void ArgumentEncoder::encode(int64_t n)
+void ArgumentEncoder::encode(int64_t value)
{
- uint8_t* buffer = grow(sizeof(n), sizeof(n));
- copyValueToBuffer(n, buffer);
+ encodeNumber(value);
}
-void ArgumentEncoder::encode(float n)
+void ArgumentEncoder::encode(float value)
{
- uint8_t* buffer = grow(sizeof(n), sizeof(n));
- copyValueToBuffer(n, buffer);
+ encodeNumber(value);
}
-void ArgumentEncoder::encode(double n)
+void ArgumentEncoder::encode(double value)
{
- uint8_t* buffer = grow(sizeof(n), sizeof(n));
- copyValueToBuffer(n, buffer);
+ encodeNumber(value);
}
void ArgumentEncoder::addAttachment(const Attachment& attachment)
Modified: trunk/Source/WebKit2/Platform/IPC/ArgumentEncoder.h (176451 => 176452)
--- trunk/Source/WebKit2/Platform/IPC/ArgumentEncoder.h 2014-11-21 17:05:19 UTC (rev 176451)
+++ trunk/Source/WebKit2/Platform/IPC/ArgumentEncoder.h 2014-11-21 17:40:50 UTC (rev 176452)
@@ -41,7 +41,7 @@
ArgumentEncoder();
virtual ~ArgumentEncoder();
- void encodeFixedLengthData(const uint8_t*, size_t, unsigned alignment);
+ void encodeFixedLengthData(const uint8_t*, size_t);
void encodeVariableLengthByteArray(const DataReference&);
template<typename T> void encodeEnum(T t)
@@ -62,13 +62,16 @@
return *this;
}
- uint8_t* buffer() const { return m_buffer; }
+ const uint8_t* buffer() const { return m_buffer; }
size_t bufferSize() const { return m_bufferSize; }
void addAttachment(const Attachment&);
Vector<Attachment> releaseAttachments();
void reserve(size_t);
+protected:
+ uint8_t* mutableBuffer() { return m_buffer; }
+
private:
void encode(bool);
void encode(uint8_t);
@@ -79,14 +82,13 @@
void encode(int64_t);
void encode(float);
void encode(double);
+ template<typename Type> void encodeNumber(Type);
- uint8_t* grow(unsigned alignment, size_t size);
+ uint8_t* grow(size_t);
uint8_t m_inlineBuffer[512];
+ uint8_t* m_buffer;
- uint8_t* m_buffer;
- uint8_t* m_bufferPointer;
-
size_t m_bufferSize;
size_t m_bufferCapacity;
Modified: trunk/Source/WebKit2/Platform/IPC/DataReference.cpp (176451 => 176452)
--- trunk/Source/WebKit2/Platform/IPC/DataReference.cpp 2014-11-21 17:05:19 UTC (rev 176451)
+++ trunk/Source/WebKit2/Platform/IPC/DataReference.cpp 2014-11-21 17:40:50 UTC (rev 176452)
@@ -51,7 +51,7 @@
unsigned position = 0;
while (position < bufferSize) {
unsigned bytesToWrite = m_buffer->getSomeData(partialData, position);
- encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(partialData), bytesToWrite, 1);
+ encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(partialData), bytesToWrite);
position += bytesToWrite;
}
}
Modified: trunk/Source/WebKit2/Platform/IPC/MessageEncoder.cpp (176451 => 176452)
--- trunk/Source/WebKit2/Platform/IPC/MessageEncoder.cpp 2014-11-21 17:05:19 UTC (rev 176451)
+++ trunk/Source/WebKit2/Platform/IPC/MessageEncoder.cpp 2014-11-21 17:40:50 UTC (rev 176452)
@@ -51,17 +51,17 @@
void MessageEncoder::setIsSyncMessage(bool isSyncMessage)
{
if (isSyncMessage)
- *buffer() |= SyncMessage;
+ *mutableBuffer() |= SyncMessage;
else
- *buffer() &= ~SyncMessage;
+ *mutableBuffer() &= ~SyncMessage;
}
void MessageEncoder::setShouldDispatchMessageWhenWaitingForSyncReply(bool shouldDispatchMessageWhenWaitingForSyncReply)
{
if (shouldDispatchMessageWhenWaitingForSyncReply)
- *buffer() |= DispatchMessageWhenWaitingForSyncReply;
+ *mutableBuffer() |= DispatchMessageWhenWaitingForSyncReply;
else
- *buffer() &= ~DispatchMessageWhenWaitingForSyncReply;
+ *mutableBuffer() &= ~DispatchMessageWhenWaitingForSyncReply;
}
} // namespace IPC
Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (176451 => 176452)
--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm 2014-11-21 17:05:19 UTC (rev 176451)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm 2014-11-21 17:40:50 UTC (rev 176452)
@@ -327,7 +327,7 @@
if (messageBodyIsOOL) {
mach_msg_descriptor_t* descriptor = reinterpret_cast<mach_msg_descriptor_t*>(descriptorData);
- descriptor->out_of_line.address = encoder->buffer();
+ descriptor->out_of_line.address = const_cast<uint8_t*>(encoder->buffer());
descriptor->out_of_line.size = encoder->bufferSize();
descriptor->out_of_line.copy = MACH_MSG_VIRTUAL_COPY;
descriptor->out_of_line.deallocate = false;
Modified: trunk/Source/WebKit2/Platform/IPC/unix/ConnectionUnix.cpp (176451 => 176452)
--- trunk/Source/WebKit2/Platform/IPC/unix/ConnectionUnix.cpp 2014-11-21 17:05:19 UTC (rev 176451)
+++ trunk/Source/WebKit2/Platform/IPC/unix/ConnectionUnix.cpp 2014-11-21 17:40:50 UTC (rev 176452)
@@ -514,7 +514,7 @@
}
if (!messageInfo.isMessageBodyIsOutOfLine() && encoder->bufferSize()) {
- iov[iovLength].iov_base = reinterpret_cast<void*>(encoder->buffer());
+ iov[iovLength].iov_base = reinterpret_cast<void*>(const_cast<uint8_t*>(encoder->buffer()));
iov[iovLength].iov_len = encoder->bufferSize();
++iovLength;
}