Changeset 139919 in webkit


Ignore:
Timestamp:
Jan 16, 2013 1:47:45 PM (11 years ago)
Author:
andersca@apple.com
Message:

Remove CoreIPCMessageKinds.h
https://bugs.webkit.org/show_bug.cgi?id=107048

Reviewed by Beth Dakin.

Use named IPC messages instead.

  • Platform/CoreIPC/Connection.cpp:

(CoreIPC::Connection::sendSyncReply):
(CoreIPC::Connection::processIncomingMessage):
(CoreIPC::Connection::dispatchSyncMessage):

  • Platform/CoreIPC/CoreIPCMessageKinds.h: Removed.
  • Platform/CoreIPC/MessageID.h:

(MessageID):
(CoreIPC::MessageID::stripMostSignificantBit):
(CoreIPC::MessageID::operator==):

  • Platform/CoreIPC/mac/ConnectionMac.cpp:

(CoreIPC::Connection::open):
(CoreIPC::Connection::receiveSourceEventHandler):

  • WebKit2.xcodeproj/project.pbxproj:
Location:
trunk/Source/WebKit2
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r139899 r139919  
     12013-01-16  Anders Carlsson  <andersca@apple.com>
     2
     3        Remove CoreIPCMessageKinds.h
     4        https://bugs.webkit.org/show_bug.cgi?id=107048
     5
     6        Reviewed by Beth Dakin.
     7
     8        Use named IPC messages instead.
     9
     10        * Platform/CoreIPC/Connection.cpp:
     11        (CoreIPC::Connection::sendSyncReply):
     12        (CoreIPC::Connection::processIncomingMessage):
     13        (CoreIPC::Connection::dispatchSyncMessage):
     14        * Platform/CoreIPC/CoreIPCMessageKinds.h: Removed.
     15        * Platform/CoreIPC/MessageID.h:
     16        (MessageID):
     17        (CoreIPC::MessageID::stripMostSignificantBit):
     18        (CoreIPC::MessageID::operator==):
     19        * Platform/CoreIPC/mac/ConnectionMac.cpp:
     20        (CoreIPC::Connection::open):
     21        (CoreIPC::Connection::receiveSourceEventHandler):
     22        * WebKit2.xcodeproj/project.pbxproj:
     23
    1242013-01-15  Jer Noble  <jer.noble@apple.com>
    225
  • trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp

    r139515 r139919  
    2828
    2929#include "BinarySemaphore.h"
    30 #include "CoreIPCMessageKinds.h"
    3130#include <WebCore/RunLoop.h>
    3231#include <wtf/CurrentTime.h>
     
    339338bool Connection::sendSyncReply(PassOwnPtr<MessageEncoder> encoder)
    340339{
    341     return sendMessage(MessageID(CoreIPCMessage::SyncMessageReply), encoder);
     340    return sendMessage(MessageID(), encoder);
    342341}
    343342
     
    573572void Connection::processIncomingMessage(MessageID messageID, PassOwnPtr<MessageDecoder> decoder)
    574573{
    575     // Check if this is a sync reply.
    576     if (messageID == MessageID(CoreIPCMessage::SyncMessageReply)) {
     574    if (decoder->messageReceiverName() == "IPC" && decoder->messageName() == "SyncMessageReply") {
    577575        processIncomingSyncReply(decoder);
    578576        return;
     
    698696    }
    699697
    700     OwnPtr<MessageEncoder> replyEncoder = MessageEncoder::create("IPC", "", syncRequestID);
     698    OwnPtr<MessageEncoder> replyEncoder = MessageEncoder::create("IPC", "SyncMessageReply", syncRequestID);
    701699
    702700    // Hand off both the decoder and encoder to the client.
  • trunk/Source/WebKit2/Platform/CoreIPC/MessageID.h

    r139009 r139919  
    3232    MessageClassInvalid = 0,
    3333
    34     // Messages sent by Core IPC.
    35     MessageClassCoreIPC,
    36 
    3734    // Messages sent by the UI process to the web process.
    3835    MessageClassAuthenticationManager,
     
    202199    }
    203200   
    204     template <typename EnumType>
    205     bool operator==(EnumType messageKind) const
    206     {
    207         return m_messageID == MessageID(messageKind).m_messageID;
    208     }
    209201
    210202    static MessageID fromInt(unsigned i)
     
    221213    bool isSync() const { return getFlags() & SyncMessage; }
    222214
    223     MessageClass messageClass() const
    224     {
    225         return static_cast<MessageClass>(getClass());
    226     }
    227 
    228215private:
    229216    static inline unsigned stripMostSignificantBit(unsigned value)
     
    232219    }
    233220
     221    MessageClass messageClass() const
     222    {
     223        return static_cast<MessageClass>(getClass());
     224    }
     225
     226    template <typename EnumType>
     227    bool operator==(EnumType messageKind) const
     228    {
     229        return m_messageID == MessageID(messageKind).m_messageID;
     230    }
     231
    234232    unsigned char getFlags() const { return (m_messageID & 0xff000000) >> 24; }
    235233    unsigned char getClass() const { return (m_messageID & 0x00ff0000) >> 16; }
  • trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp

    r136190 r139919  
    2727#include "Connection.h"
    2828
    29 #include "CoreIPCMessageKinds.h"
    3029#include "DataReference.h"
    3130#include "MachPort.h"
     
    3938#endif
    4039
    41 using namespace std;
    4240using namespace WebCore;
    4341
     
    117115       
    118116        // Send the initialize message, which contains a send right for the server to use.
    119         OwnPtr<MessageEncoder> encoder = MessageEncoder::create("IPC", "", 0);
     117        OwnPtr<MessageEncoder> encoder = MessageEncoder::create("IPC", "InitializeConnection", 0);
    120118        encoder->encode(MachPort(m_receivePort, MACH_MSG_TYPE_MAKE_SEND));
    121119
    122         sendMessage(MessageID(CoreIPCMessage::InitializeConnection), encoder.release());
     120        sendMessage(MessageID(), encoder.release());
    123121
    124122        // Set the dead name handler for our send port.
    125123        initializeDeadNameSource();
    126124    }
    127    
     125
    128126    // Change the message queue length for the receive port.
    129127    setMachPortQueueLength(m_receivePort, MACH_PORT_QLIMIT_LARGE);
     
    136134        m_connectionQueue.registerMachPortEventHandler(m_exceptionPort, WorkQueue::MachPortDataAvailable, bind(&Connection::exceptionSourceEventHandler, this));
    137135
    138         OwnPtr<MessageEncoder> encoder = MessageEncoder::create("IPC", "", 0);
     136        OwnPtr<MessageEncoder> encoder = MessageEncoder::create("IPC", "SetExceptionPort", 0);
    139137        encoder->encode(MachPort(m_exceptionPort, MACH_MSG_TYPE_MAKE_SEND));
    140138
    141         sendMessage(MessageID(CoreIPCMessage::SetExceptionPort), encoder.release());
     139        sendMessage(MessageID(), encoder.release());
    142140    }
    143141
     
    369367    ASSERT(decoder);
    370368
    371     if (messageID == MessageID(CoreIPCMessage::InitializeConnection)) {
     369    if (decoder->messageReceiverName() == "IPC" && decoder->messageName() == "InitializeConnection") {
    372370        ASSERT(m_isServer);
    373371        ASSERT(!m_isConnected);
     
    394392    }
    395393
    396     if (messageID == MessageID(CoreIPCMessage::SetExceptionPort)) {
     394    if (decoder->messageReceiverName() == "IPC" && decoder->messageName() == "SetExceptionPort") {
    397395        MachPort exceptionPort;
    398396        if (!decoder->decode(exceptionPort))
  • trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r139888 r139919  
    647647                BC111B5D112F629800337BAB /* WebEventFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = BC111B5B112F629800337BAB /* WebEventFactory.h */; };
    648648                BC111B5E112F629800337BAB /* WebEventFactory.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC111B5C112F629800337BAB /* WebEventFactory.mm */; };
    649                 BC131BC911726C2800B69727 /* CoreIPCMessageKinds.h in Headers */ = {isa = PBXBuildFile; fileRef = BC131BC811726C2800B69727 /* CoreIPCMessageKinds.h */; };
    650649                BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */ = {isa = PBXBuildFile; fileRef = BC14DF75120B5B7900826C0C /* InjectedBundleScriptWorld.h */; };
    651650                BC14DF78120B5B7900826C0C /* InjectedBundleScriptWorld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC14DF76120B5B7900826C0C /* InjectedBundleScriptWorld.cpp */; };
     
    19341933                BC122FA3132707F300F7EAC1 /* PluginProcess.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = PluginProcess.xcconfig; sourceTree = "<group>"; };
    19351934                BC122FA61327087400F7EAC1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = PluginProcess/Info.plist; sourceTree = "<group>"; };
    1936                 BC131BC811726C2800B69727 /* CoreIPCMessageKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreIPCMessageKinds.h; sourceTree = "<group>"; };
    19371935                BC14DF75120B5B7900826C0C /* InjectedBundleScriptWorld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleScriptWorld.h; sourceTree = "<group>"; };
    19381936                BC14DF76120B5B7900826C0C /* InjectedBundleScriptWorld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleScriptWorld.cpp; sourceTree = "<group>"; };
     
    29842982                                BC032DA210F437D10058C15A /* Connection.cpp */,
    29852983                                BC032DA310F437D10058C15A /* Connection.h */,
    2986                                 BC131BC811726C2800B69727 /* CoreIPCMessageKinds.h */,
    29872984                                1A8EFDFD1253CB6E00F7067F /* DataReference.cpp */,
    29882985                                1A8EFDF91253CAA200F7067F /* DataReference.h */,
     
    45714568                                BC032DAB10F437D10058C15A /* Connection.h in Headers */,
    45724569                                5136183E163126DA00A99DDE /* ConnectionStack.h in Headers */,
    4573                                 BC131BC911726C2800B69727 /* CoreIPCMessageKinds.h in Headers */,
    45744570                                B878B615133428DC006888E9 /* CorrectionPanel.h in Headers */,
    45754571                                2989A414167D184B004F96D2 /* CustomProtocolManager.h in Headers */,
Note: See TracChangeset for help on using the changeset viewer.