Title: [141177] trunk/Source/WebKit2
- Revision
- 141177
- Author
- ander...@apple.com
- Date
- 2013-01-29 16:22:23 -0800 (Tue, 29 Jan 2013)
Log Message
Remove almost everything from MessageID
https://bugs.webkit.org/show_bug.cgi?id=108244
Reviewed by Beth Dakin.
* Platform/CoreIPC/MessageID.h:
(CoreIPC::MessageID::MessageID):
* Platform/CoreIPC/mac/ConnectionMac.cpp:
(CoreIPC):
(CoreIPC::Connection::sendOutgoingMessage):
(CoreIPC::createMessageDecoder):
(CoreIPC::Connection::receiveSourceEventHandler):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (141176 => 141177)
--- trunk/Source/WebKit2/ChangeLog 2013-01-30 00:07:38 UTC (rev 141176)
+++ trunk/Source/WebKit2/ChangeLog 2013-01-30 00:22:23 UTC (rev 141177)
@@ -1,5 +1,20 @@
2013-01-29 Anders Carlsson <ander...@apple.com>
+ Remove almost everything from MessageID
+ https://bugs.webkit.org/show_bug.cgi?id=108244
+
+ Reviewed by Beth Dakin.
+
+ * Platform/CoreIPC/MessageID.h:
+ (CoreIPC::MessageID::MessageID):
+ * Platform/CoreIPC/mac/ConnectionMac.cpp:
+ (CoreIPC):
+ (CoreIPC::Connection::sendOutgoingMessage):
+ (CoreIPC::createMessageDecoder):
+ (CoreIPC::Connection::receiveSourceEventHandler):
+
+2013-01-29 Anders Carlsson <ander...@apple.com>
+
Get rid of MessageID::is()
https://bugs.webkit.org/show_bug.cgi?id=108234
Modified: trunk/Source/WebKit2/Platform/CoreIPC/MessageID.h (141176 => 141177)
--- trunk/Source/WebKit2/Platform/CoreIPC/MessageID.h 2013-01-30 00:07:38 UTC (rev 141176)
+++ trunk/Source/WebKit2/Platform/CoreIPC/MessageID.h 2013-01-30 00:22:23 UTC (rev 141177)
@@ -162,47 +162,13 @@
class MessageID {
public:
MessageID()
- : m_messageID(0)
{
}
template <typename EnumType>
- explicit MessageID(EnumType messageKind, unsigned char flags = 0)
- : m_messageID(stripMostSignificantBit(flags << 24 | (MessageKindTraits<EnumType>::messageClass) << 16 | messageKind))
+ explicit MessageID(EnumType, unsigned char = 0)
{
}
-
- static MessageID fromInt(unsigned i)
- {
- MessageID messageID;
- messageID.m_messageID = stripMostSignificantBit(i);
-
- return messageID;
- }
-
- unsigned toInt() const { return m_messageID; }
-
-private:
- static inline unsigned stripMostSignificantBit(unsigned value)
- {
- return value & 0x7fffffff;
- }
-
- MessageClass messageClass() const
- {
- return static_cast<MessageClass>(getClass());
- }
-
- template <typename EnumType>
- bool operator==(EnumType messageKind) const
- {
- return m_messageID == MessageID(messageKind).m_messageID;
- }
-
- unsigned char getFlags() const { return (m_messageID & 0xff000000) >> 24; }
- unsigned char getClass() const { return (m_messageID & 0x00ff0000) >> 16; }
-
- unsigned m_messageID;
};
} // namespace CoreIPC
Modified: trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp (141176 => 141177)
--- trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp 2013-01-30 00:07:38 UTC (rev 141176)
+++ trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp 2013-01-30 00:22:23 UTC (rev 141177)
@@ -43,8 +43,9 @@
static const size_t inlineMessageMaxSize = 4096;
+// Message flags.
enum {
- MessageBodyIsOOL = 1 << 31
+ MessageBodyIsOutOfLine = 1 << 0
};
void Connection::platformInvalidate()
@@ -212,9 +213,9 @@
header->msgh_size = messageSize;
header->msgh_remote_port = m_sendPort;
header->msgh_local_port = MACH_PORT_NULL;
- header->msgh_id = messageID.toInt();
+ header->msgh_id = 0;
if (messageBodyIsOOL)
- header->msgh_id |= MessageBodyIsOOL;
+ header->msgh_id |= MessageBodyIsOutOfLine;
uint8_t* messageData;
@@ -292,7 +293,7 @@
return MessageDecoder::create(DataReference(body, bodySize));
}
- bool messageBodyIsOOL = header->msgh_id & MessageBodyIsOOL;
+ bool messageBodyIsOOL = header->msgh_id & MessageBodyIsOutOfLine;
mach_msg_body_t* body = reinterpret_cast<mach_msg_body_t*>(header + 1);
mach_msg_size_t numDescriptors = body->msgh_descriptor_count;
@@ -390,7 +391,6 @@
if (!header)
return;
- MessageID messageID = MessageID::fromInt(header->msgh_id);
OwnPtr<MessageDecoder> decoder = createMessageDecoder(header);
ASSERT(decoder);
@@ -428,7 +428,7 @@
return;
}
- processIncomingMessage(messageID, decoder.release());
+ processIncomingMessage(MessageID(), decoder.release());
}
void Connection::exceptionSourceEventHandler()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes