Title: [139919] trunk/Source/WebKit2
Revision
139919
Author
[email protected]
Date
2013-01-16 13:47:45 -0800 (Wed, 16 Jan 2013)

Log 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:

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (139918 => 139919)


--- trunk/Source/WebKit2/ChangeLog	2013-01-16 21:45:35 UTC (rev 139918)
+++ trunk/Source/WebKit2/ChangeLog	2013-01-16 21:47:45 UTC (rev 139919)
@@ -1,3 +1,26 @@
+2013-01-16  Anders Carlsson  <[email protected]>
+
+        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:
+
 2013-01-15  Jer Noble  <[email protected]>
 
         Add a Setting to disable QTKit media engine.

Modified: trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp (139918 => 139919)


--- trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2013-01-16 21:45:35 UTC (rev 139918)
+++ trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2013-01-16 21:47:45 UTC (rev 139919)
@@ -27,7 +27,6 @@
 #include "Connection.h"
 
 #include "BinarySemaphore.h"
-#include "CoreIPCMessageKinds.h"
 #include <WebCore/RunLoop.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/HashSet.h>
@@ -338,7 +337,7 @@
 
 bool Connection::sendSyncReply(PassOwnPtr<MessageEncoder> encoder)
 {
-    return sendMessage(MessageID(CoreIPCMessage::SyncMessageReply), encoder);
+    return sendMessage(MessageID(), encoder);
 }
 
 PassOwnPtr<MessageDecoder> Connection::waitForMessage(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, double timeout)
@@ -572,8 +571,7 @@
 
 void Connection::processIncomingMessage(MessageID messageID, PassOwnPtr<MessageDecoder> decoder)
 {
-    // Check if this is a sync reply.
-    if (messageID == MessageID(CoreIPCMessage::SyncMessageReply)) {
+    if (decoder->messageReceiverName() == "IPC" && decoder->messageName() == "SyncMessageReply") {
         processIncomingSyncReply(decoder);
         return;
     }
@@ -697,7 +695,7 @@
         return;
     }
 
-    OwnPtr<MessageEncoder> replyEncoder = MessageEncoder::create("IPC", "", syncRequestID);
+    OwnPtr<MessageEncoder> replyEncoder = MessageEncoder::create("IPC", "SyncMessageReply", syncRequestID);
 
     // Hand off both the decoder and encoder to the client.
     m_client->didReceiveSyncMessage(this, messageID, decoder, replyEncoder);

Deleted: trunk/Source/WebKit2/Platform/CoreIPC/CoreIPCMessageKinds.h (139918 => 139919)


--- trunk/Source/WebKit2/Platform/CoreIPC/CoreIPCMessageKinds.h	2013-01-16 21:45:35 UTC (rev 139918)
+++ trunk/Source/WebKit2/Platform/CoreIPC/CoreIPCMessageKinds.h	2013-01-16 21:47:45 UTC (rev 139919)
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef CoreIPCMessageKinds_h
-#define CoreIPCMessageKinds_h
-
-#include "MessageID.h"
-
-namespace CoreIPC {
-
-namespace CoreIPCMessage {
-
-enum Kind {
-    InitializeConnection,
-    SyncMessageReply,
-#if OS(DARWIN)
-    SetExceptionPort,
-#endif
-};
-
-} // namespace CoreIPCMessage
-
-template<> struct MessageKindTraits<CoreIPCMessage::Kind> { 
-    static const MessageClass messageClass = MessageClassCoreIPC;
-};
- 
-} // namespace CoreIPC
-
-#endif // CoreIPCMessageKinds_h

Modified: trunk/Source/WebKit2/Platform/CoreIPC/MessageID.h (139918 => 139919)


--- trunk/Source/WebKit2/Platform/CoreIPC/MessageID.h	2013-01-16 21:45:35 UTC (rev 139918)
+++ trunk/Source/WebKit2/Platform/CoreIPC/MessageID.h	2013-01-16 21:47:45 UTC (rev 139919)
@@ -31,9 +31,6 @@
 enum MessageClass {
     MessageClassInvalid = 0,
 
-    // Messages sent by Core IPC.
-    MessageClassCoreIPC,
-
     // Messages sent by the UI process to the web process.
     MessageClassAuthenticationManager,
     MessageClassCoordinatedLayerTreeHost,
@@ -201,11 +198,6 @@
         return getClass() == K;
     }
     
-    template <typename EnumType>
-    bool operator==(EnumType messageKind) const
-    {
-        return m_messageID == MessageID(messageKind).m_messageID;
-    }
 
     static MessageID fromInt(unsigned i)
     {
@@ -220,15 +212,21 @@
     bool shouldDispatchMessageWhenWaitingForSyncReply() const { return getFlags() & DispatchMessageWhenWaitingForSyncReply; }
     bool isSync() const { return getFlags() & SyncMessage; }
 
+private:
+    static inline unsigned stripMostSignificantBit(unsigned value)
+    {
+        return value & 0x7fffffff;
+    }
+
     MessageClass messageClass() const
     {
         return static_cast<MessageClass>(getClass());
     }
 
-private:
-    static inline unsigned stripMostSignificantBit(unsigned value)
+    template <typename EnumType>
+    bool operator==(EnumType messageKind) const
     {
-        return value & 0x7fffffff;
+        return m_messageID == MessageID(messageKind).m_messageID;
     }
 
     unsigned char getFlags() const { return (m_messageID & 0xff000000) >> 24; }

Modified: trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp (139918 => 139919)


--- trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp	2013-01-16 21:45:35 UTC (rev 139918)
+++ trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp	2013-01-16 21:47:45 UTC (rev 139919)
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "Connection.h"
 
-#include "CoreIPCMessageKinds.h"
 #include "DataReference.h"
 #include "MachPort.h"
 #include "MachUtilities.h"
@@ -38,7 +37,6 @@
 #include <xpc/xpc.h>
 #endif
 
-using namespace std;
 using namespace WebCore;
 
 namespace CoreIPC {
@@ -116,15 +114,15 @@
         m_isConnected = true;
         
         // Send the initialize message, which contains a send right for the server to use.
-        OwnPtr<MessageEncoder> encoder = MessageEncoder::create("IPC", "", 0);
+        OwnPtr<MessageEncoder> encoder = MessageEncoder::create("IPC", "InitializeConnection", 0);
         encoder->encode(MachPort(m_receivePort, MACH_MSG_TYPE_MAKE_SEND));
 
-        sendMessage(MessageID(CoreIPCMessage::InitializeConnection), encoder.release());
+        sendMessage(MessageID(), encoder.release());
 
         // Set the dead name handler for our send port.
         initializeDeadNameSource();
     }
-    
+
     // Change the message queue length for the receive port.
     setMachPortQueueLength(m_receivePort, MACH_PORT_QLIMIT_LARGE);
 
@@ -135,10 +133,10 @@
     if (m_exceptionPort) {
         m_connectionQueue.registerMachPortEventHandler(m_exceptionPort, WorkQueue::MachPortDataAvailable, bind(&Connection::exceptionSourceEventHandler, this));
 
-        OwnPtr<MessageEncoder> encoder = MessageEncoder::create("IPC", "", 0);
+        OwnPtr<MessageEncoder> encoder = MessageEncoder::create("IPC", "SetExceptionPort", 0);
         encoder->encode(MachPort(m_exceptionPort, MACH_MSG_TYPE_MAKE_SEND));
 
-        sendMessage(MessageID(CoreIPCMessage::SetExceptionPort), encoder.release());
+        sendMessage(MessageID(), encoder.release());
     }
 
     return true;
@@ -368,7 +366,7 @@
     OwnPtr<MessageDecoder> decoder = createMessageDecoder(header);
     ASSERT(decoder);
 
-    if (messageID == MessageID(CoreIPCMessage::InitializeConnection)) {
+    if (decoder->messageReceiverName() == "IPC" && decoder->messageName() == "InitializeConnection") {
         ASSERT(m_isServer);
         ASSERT(!m_isConnected);
         ASSERT(!m_sendPort);
@@ -393,7 +391,7 @@
         return;
     }
 
-    if (messageID == MessageID(CoreIPCMessage::SetExceptionPort)) {
+    if (decoder->messageReceiverName() == "IPC" && decoder->messageName() == "SetExceptionPort") {
         MachPort exceptionPort;
         if (!decoder->decode(exceptionPort))
             return;

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (139918 => 139919)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2013-01-16 21:45:35 UTC (rev 139918)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2013-01-16 21:47:45 UTC (rev 139919)
@@ -646,7 +646,6 @@
 		BC111B51112F619200337BAB /* PageClientImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC111B4C112F619200337BAB /* PageClientImpl.mm */; };
 		BC111B5D112F629800337BAB /* WebEventFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = BC111B5B112F629800337BAB /* WebEventFactory.h */; };
 		BC111B5E112F629800337BAB /* WebEventFactory.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC111B5C112F629800337BAB /* WebEventFactory.mm */; };
-		BC131BC911726C2800B69727 /* CoreIPCMessageKinds.h in Headers */ = {isa = PBXBuildFile; fileRef = BC131BC811726C2800B69727 /* CoreIPCMessageKinds.h */; };
 		BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */ = {isa = PBXBuildFile; fileRef = BC14DF75120B5B7900826C0C /* InjectedBundleScriptWorld.h */; };
 		BC14DF78120B5B7900826C0C /* InjectedBundleScriptWorld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC14DF76120B5B7900826C0C /* InjectedBundleScriptWorld.cpp */; };
 		BC14DF9E120B635F00826C0C /* WKBundleScriptWorld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC14DF9C120B635F00826C0C /* WKBundleScriptWorld.cpp */; };
@@ -1933,7 +1932,6 @@
 		BC111B5C112F629800337BAB /* WebEventFactory.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEventFactory.mm; sourceTree = "<group>"; };
 		BC122FA3132707F300F7EAC1 /* PluginProcess.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = PluginProcess.xcconfig; sourceTree = "<group>"; };
 		BC122FA61327087400F7EAC1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = PluginProcess/Info.plist; sourceTree = "<group>"; };
-		BC131BC811726C2800B69727 /* CoreIPCMessageKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreIPCMessageKinds.h; sourceTree = "<group>"; };
 		BC14DF75120B5B7900826C0C /* InjectedBundleScriptWorld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleScriptWorld.h; sourceTree = "<group>"; };
 		BC14DF76120B5B7900826C0C /* InjectedBundleScriptWorld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleScriptWorld.cpp; sourceTree = "<group>"; };
 		BC14DF9C120B635F00826C0C /* WKBundleScriptWorld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleScriptWorld.cpp; sourceTree = "<group>"; };
@@ -2983,7 +2981,6 @@
 				1AC41AC51263C88300054E94 /* BinarySemaphore.h */,
 				BC032DA210F437D10058C15A /* Connection.cpp */,
 				BC032DA310F437D10058C15A /* Connection.h */,
-				BC131BC811726C2800B69727 /* CoreIPCMessageKinds.h */,
 				1A8EFDFD1253CB6E00F7067F /* DataReference.cpp */,
 				1A8EFDF91253CAA200F7067F /* DataReference.h */,
 				C0CE72AC1247E78D00BC0EC4 /* HandleMessage.h */,
@@ -4570,7 +4567,6 @@
 				37C4E9F6131C6E7E0029BD5A /* config.h in Headers */,
 				BC032DAB10F437D10058C15A /* Connection.h in Headers */,
 				5136183E163126DA00A99DDE /* ConnectionStack.h in Headers */,
-				BC131BC911726C2800B69727 /* CoreIPCMessageKinds.h in Headers */,
 				B878B615133428DC006888E9 /* CorrectionPanel.h in Headers */,
 				2989A414167D184B004F96D2 /* CustomProtocolManager.h in Headers */,
 				2984F589164BA095004BC0C6 /* CustomProtocolManagerMessages.h in Headers */,
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to