Changeset 141177 in webkit
- Timestamp:
- Jan 29, 2013 4:22:23 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r141174 r141177 1 2013-01-29 Anders Carlsson <andersca@apple.com> 2 3 Remove almost everything from MessageID 4 https://bugs.webkit.org/show_bug.cgi?id=108244 5 6 Reviewed by Beth Dakin. 7 8 * Platform/CoreIPC/MessageID.h: 9 (CoreIPC::MessageID::MessageID): 10 * Platform/CoreIPC/mac/ConnectionMac.cpp: 11 (CoreIPC): 12 (CoreIPC::Connection::sendOutgoingMessage): 13 (CoreIPC::createMessageDecoder): 14 (CoreIPC::Connection::receiveSourceEventHandler): 15 1 16 2013-01-29 Anders Carlsson <andersca@apple.com> 2 17 -
trunk/Source/WebKit2/Platform/CoreIPC/MessageID.h
r141174 r141177 163 163 public: 164 164 MessageID() 165 : m_messageID(0)166 165 { 167 166 } 168 167 169 168 template <typename EnumType> 170 explicit MessageID(EnumType messageKind, unsigned char flags = 0) 171 : m_messageID(stripMostSignificantBit(flags << 24 | (MessageKindTraits<EnumType>::messageClass) << 16 | messageKind)) 169 explicit MessageID(EnumType, unsigned char = 0) 172 170 { 173 171 } 174 175 static MessageID fromInt(unsigned i)176 {177 MessageID messageID;178 messageID.m_messageID = stripMostSignificantBit(i);179 180 return messageID;181 }182 183 unsigned toInt() const { return m_messageID; }184 185 private:186 static inline unsigned stripMostSignificantBit(unsigned value)187 {188 return value & 0x7fffffff;189 }190 191 MessageClass messageClass() const192 {193 return static_cast<MessageClass>(getClass());194 }195 196 template <typename EnumType>197 bool operator==(EnumType messageKind) const198 {199 return m_messageID == MessageID(messageKind).m_messageID;200 }201 202 unsigned char getFlags() const { return (m_messageID & 0xff000000) >> 24; }203 unsigned char getClass() const { return (m_messageID & 0x00ff0000) >> 16; }204 205 unsigned m_messageID;206 172 }; 207 173 -
trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp
r141037 r141177 44 44 static const size_t inlineMessageMaxSize = 4096; 45 45 46 // Message flags. 46 47 enum { 47 MessageBodyIsO OL = 1 << 3148 MessageBodyIsOutOfLine = 1 << 0 48 49 }; 49 50 … … 213 214 header->msgh_remote_port = m_sendPort; 214 215 header->msgh_local_port = MACH_PORT_NULL; 215 header->msgh_id = messageID.toInt();216 header->msgh_id = 0; 216 217 if (messageBodyIsOOL) 217 header->msgh_id |= MessageBodyIsO OL;218 header->msgh_id |= MessageBodyIsOutOfLine; 218 219 219 220 uint8_t* messageData; … … 293 294 } 294 295 295 bool messageBodyIsOOL = header->msgh_id & MessageBodyIsO OL;296 bool messageBodyIsOOL = header->msgh_id & MessageBodyIsOutOfLine; 296 297 297 298 mach_msg_body_t* body = reinterpret_cast<mach_msg_body_t*>(header + 1); … … 391 392 return; 392 393 393 MessageID messageID = MessageID::fromInt(header->msgh_id);394 394 OwnPtr<MessageDecoder> decoder = createMessageDecoder(header); 395 395 ASSERT(decoder); … … 429 429 } 430 430 431 processIncomingMessage( messageID, decoder.release());431 processIncomingMessage(MessageID(), decoder.release()); 432 432 } 433 433
Note: See TracChangeset
for help on using the changeset viewer.