Changeset 141177 in webkit


Ignore:
Timestamp:
Jan 29, 2013 4:22:23 PM (11 years ago)
Author:
andersca@apple.com
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):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r141174 r141177  
     12013-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
    1162013-01-29  Anders Carlsson  <andersca@apple.com>
    217
  • trunk/Source/WebKit2/Platform/CoreIPC/MessageID.h

    r141174 r141177  
    163163public:
    164164    MessageID()
    165         : m_messageID(0)
    166165    {
    167166    }
    168167
    169168    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)
    172170    {
    173171    }
    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() const
    192     {
    193         return static_cast<MessageClass>(getClass());
    194     }
    195 
    196     template <typename EnumType>
    197     bool operator==(EnumType messageKind) const
    198     {
    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;
    206172};
    207173
  • trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp

    r141037 r141177  
    4444static const size_t inlineMessageMaxSize = 4096;
    4545
     46// Message flags.
    4647enum {
    47     MessageBodyIsOOL = 1 << 31
     48    MessageBodyIsOutOfLine = 1 << 0
    4849};
    4950   
     
    213214    header->msgh_remote_port = m_sendPort;
    214215    header->msgh_local_port = MACH_PORT_NULL;
    215     header->msgh_id = messageID.toInt();
     216    header->msgh_id = 0;
    216217    if (messageBodyIsOOL)
    217         header->msgh_id |= MessageBodyIsOOL;
     218        header->msgh_id |= MessageBodyIsOutOfLine;
    218219
    219220    uint8_t* messageData;
     
    293294    }
    294295
    295     bool messageBodyIsOOL = header->msgh_id & MessageBodyIsOOL;
     296    bool messageBodyIsOOL = header->msgh_id & MessageBodyIsOutOfLine;
    296297
    297298    mach_msg_body_t* body = reinterpret_cast<mach_msg_body_t*>(header + 1);
     
    391392        return;
    392393
    393     MessageID messageID = MessageID::fromInt(header->msgh_id);
    394394    OwnPtr<MessageDecoder> decoder = createMessageDecoder(header);
    395395    ASSERT(decoder);
     
    429429    }
    430430
    431     processIncomingMessage(messageID, decoder.release());
     431    processIncomingMessage(MessageID(), decoder.release());
    432432}   
    433433
Note: See TracChangeset for help on using the changeset viewer.