Diff
Modified: trunk/Source/WebKit2/ChangeLog (141149 => 141150)
--- trunk/Source/WebKit2/ChangeLog 2013-01-29 20:56:20 UTC (rev 141149)
+++ trunk/Source/WebKit2/ChangeLog 2013-01-29 20:56:37 UTC (rev 141150)
@@ -1,3 +1,41 @@
+2013-01-29 Anders Carlsson <[email protected]>
+
+ Encode/decode message send flags in the message
+ https://bugs.webkit.org/show_bug.cgi?id=108208
+
+ Reviewed by Beth Dakin.
+
+ This is another step towards getting rid of MessageID.
+
+ * Platform/CoreIPC/ArgumentDecoder.cpp:
+ (CoreIPC::ArgumentDecoder::decodeUInt8):
+ (CoreIPC):
+ * Platform/CoreIPC/ArgumentDecoder.h:
+ (ArgumentDecoder):
+ (CoreIPC::ArgumentDecoder::decode):
+ (CoreIPC):
+ * Platform/CoreIPC/ArgumentEncoder.cpp:
+ (CoreIPC::ArgumentEncoder::encode):
+ (CoreIPC):
+ * Platform/CoreIPC/ArgumentEncoder.h:
+ (ArgumentEncoder):
+ * Platform/CoreIPC/Connection.cpp:
+ (CoreIPC::Connection::sendMessage):
+ * Platform/CoreIPC/MessageDecoder.cpp:
+ (CoreIPC::MessageDecoder::MessageDecoder):
+ * Platform/CoreIPC/MessageDecoder.h:
+ (CoreIPC::MessageDecoder::messageSendFlags):
+ (MessageDecoder):
+ * Platform/CoreIPC/MessageEncoder.cpp:
+ (CoreIPC):
+ (CoreIPC::MessageEncoder::MessageEncoder):
+ (CoreIPC::MessageEncoder::~MessageEncoder):
+ (CoreIPC::MessageEncoder::setMessageSendFlags):
+ * Platform/CoreIPC/MessageEncoder.h:
+ (MessageEncoder):
+ * UIProcess/Authentication/AuthenticationChallengeProxy.h:
+ (CoreIPC):
+
2013-01-29 Mario Sanchez Prada <[email protected]>
[GTK] Missing build flags when building with Harfbuzz
Modified: trunk/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp (141149 => 141150)
--- trunk/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp 2013-01-29 20:56:20 UTC (rev 141149)
+++ trunk/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp 2013-01-29 20:56:37 UTC (rev 141150)
@@ -139,6 +139,16 @@
return true;
}
+bool ArgumentDecoder::decodeUInt8(uint8_t& result)
+{
+ if (!alignBufferPosition(sizeof(result), sizeof(result)))
+ return false;
+
+ result = *reinterpret_cast<uint8_t*>(m_bufferPos);
+ m_bufferPos += sizeof(result);
+ return true;
+}
+
bool ArgumentDecoder::decodeUInt16(uint16_t& result)
{
if (!alignBufferPosition(sizeof(result), sizeof(result)))
Modified: trunk/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h (141149 => 141150)
--- trunk/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h 2013-01-29 20:56:20 UTC (rev 141149)
+++ trunk/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h 2013-01-29 20:56:37 UTC (rev 141150)
@@ -53,6 +53,7 @@
bool decodeVariableLengthByteArray(DataReference&);
bool decodeBool(bool&);
+ bool decodeUInt8(uint8_t&);
bool decodeUInt16(uint16_t&);
bool decodeUInt32(uint32_t&);
bool decodeUInt64(uint64_t&);
@@ -122,6 +123,11 @@
return decodeBool(n);
}
+template<> inline bool ArgumentDecoder::decode(uint8_t& n)
+{
+ return decodeUInt8(n);
+}
+
template<> inline bool ArgumentDecoder::decode(uint16_t& n)
{
return decodeUInt16(n);
Modified: trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp (141149 => 141150)
--- trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp 2013-01-29 20:56:20 UTC (rev 141149)
+++ trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp 2013-01-29 20:56:37 UTC (rev 141150)
@@ -115,6 +115,13 @@
*reinterpret_cast<bool*>(buffer) = n;
}
+void ArgumentEncoder::encode(uint8_t n)
+{
+ uint8_t* buffer = grow(sizeof(n), sizeof(n));
+
+ *reinterpret_cast<uint8_t*>(buffer) = n;
+}
+
void ArgumentEncoder::encode(uint16_t n)
{
uint8_t* buffer = grow(sizeof(n), sizeof(n));
Modified: trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h (141149 => 141150)
--- trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h 2013-01-29 20:56:20 UTC (rev 141149)
+++ trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h 2013-01-29 20:56:37 UTC (rev 141150)
@@ -46,6 +46,7 @@
void encodeVariableLengthByteArray(const DataReference&);
void encode(bool);
+ void encode(uint8_t);
void encode(uint16_t);
void encode(uint32_t);
void encode(uint64_t);
Modified: trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp (141149 => 141150)
--- trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp 2013-01-29 20:56:20 UTC (rev 141149)
+++ trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp 2013-01-29 20:56:37 UTC (rev 141150)
@@ -317,6 +317,8 @@
bool Connection::sendMessage(MessageID messageID, PassOwnPtr<MessageEncoder> encoder, unsigned messageSendFlags)
{
+ encoder->setMessageSendFlags(messageSendFlags);
+
if (!isValid())
return false;
Modified: trunk/Source/WebKit2/Platform/CoreIPC/MessageDecoder.cpp (141149 => 141150)
--- trunk/Source/WebKit2/Platform/CoreIPC/MessageDecoder.cpp 2013-01-29 20:56:20 UTC (rev 141149)
+++ trunk/Source/WebKit2/Platform/CoreIPC/MessageDecoder.cpp 2013-01-29 20:56:37 UTC (rev 141150)
@@ -50,6 +50,9 @@
MessageDecoder::MessageDecoder(const DataReference& buffer, Deque<Attachment>& attachments)
: ArgumentDecoder(buffer.data(), buffer.size(), attachments)
{
+ if (!decodeUInt8(m_messageSendFlags))
+ return;
+
if (!decode(m_messageReceiverName))
return;
Modified: trunk/Source/WebKit2/Platform/CoreIPC/MessageDecoder.h (141149 => 141150)
--- trunk/Source/WebKit2/Platform/CoreIPC/MessageDecoder.h 2013-01-29 20:56:20 UTC (rev 141149)
+++ trunk/Source/WebKit2/Platform/CoreIPC/MessageDecoder.h 2013-01-29 20:56:37 UTC (rev 141150)
@@ -39,12 +39,14 @@
static PassOwnPtr<MessageDecoder> create(const DataReference& buffer, Deque<Attachment>&);
virtual ~MessageDecoder();
+ uint8_t messageSendFlags() const { return m_messageSendFlags; }
StringReference messageReceiverName() const { return m_messageReceiverName; }
StringReference messageName() const { return m_messageName; }
private:
MessageDecoder(const DataReference& buffer, Deque<Attachment>&);
+ uint8_t m_messageSendFlags;
StringReference m_messageReceiverName;
StringReference m_messageName;
};
Modified: trunk/Source/WebKit2/Platform/CoreIPC/MessageEncoder.cpp (141149 => 141150)
--- trunk/Source/WebKit2/Platform/CoreIPC/MessageEncoder.cpp 2013-01-29 20:56:20 UTC (rev 141149)
+++ trunk/Source/WebKit2/Platform/CoreIPC/MessageEncoder.cpp 2013-01-29 20:56:37 UTC (rev 141150)
@@ -31,6 +31,8 @@
namespace CoreIPC {
+static uint8_t messageSendFlagsPlaceholderValue = 0xff;
+
PassOwnPtr<MessageEncoder> MessageEncoder::create(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID)
{
return adoptPtr(new MessageEncoder(messageReceiverName, messageName, destinationID));
@@ -40,6 +42,7 @@
{
ASSERT(!messageReceiverName.isEmpty());
+ encode(messageSendFlagsPlaceholderValue);
encode(messageReceiverName);
encode(messageName);
encode(destinationID);
@@ -47,6 +50,15 @@
MessageEncoder::~MessageEncoder()
{
+ ASSERT(*buffer() != messageSendFlagsPlaceholderValue);
}
+void MessageEncoder::setMessageSendFlags(uint8_t messageSendFlags)
+{
+ ASSERT(messageSendFlags != messageSendFlagsPlaceholderValue);
+ ASSERT(*buffer() == messageSendFlagsPlaceholderValue);
+
+ *buffer() = messageSendFlags;
+}
+
} // namespace CoreIPC
Modified: trunk/Source/WebKit2/Platform/CoreIPC/MessageEncoder.h (141149 => 141150)
--- trunk/Source/WebKit2/Platform/CoreIPC/MessageEncoder.h 2013-01-29 20:56:20 UTC (rev 141149)
+++ trunk/Source/WebKit2/Platform/CoreIPC/MessageEncoder.h 2013-01-29 20:56:37 UTC (rev 141150)
@@ -38,6 +38,8 @@
static PassOwnPtr<MessageEncoder> create(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID);
virtual ~MessageEncoder();
+ void setMessageSendFlags(uint8_t);
+
private:
MessageEncoder(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID);
Modified: trunk/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h (141149 => 141150)
--- trunk/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h 2013-01-29 20:56:20 UTC (rev 141149)
+++ trunk/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h 2013-01-29 20:56:37 UTC (rev 141150)
@@ -31,9 +31,7 @@
#include <wtf/PassRefPtr.h>
namespace CoreIPC {
- class ArgumentDecoder;
- class Connection;
- class MessageID;
+class Connection;
}
namespace WebKit {