Skip to content
Permalink
Browse files
Move duplicated internal CoreIPC message kinds to a
header.

Reviewed by Darin Adler.

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::processIncomingMessage):
* Platform/CoreIPC/CoreIPCMessageKinds.h: Added.
(CoreIPC::CoreIPCMessage::):
(CoreIPC::):
* Platform/CoreIPC/mac/ConnectionMac.cpp:
* WebKit2.xcodeproj/project.pbxproj:
* win/WebKit2.vcproj:



Canonical link: https://commits.webkit.org/48747@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@57458 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
weinig committed Apr 11, 2010
1 parent 07e3c4f commit 6fdc1539b485d03719d457965d454350e62f6132
Showing 6 changed files with 76 additions and 29 deletions.
@@ -1,3 +1,20 @@
2010-04-11 Sam Weinig <sam@webkit.org>

Reviewed by Darin Adler.

Fix for https://bugs.webkit.org/show_bug.cgi?id=37417
Move duplicated internal CoreIPC message kinds to a
header.

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::processIncomingMessage):
* Platform/CoreIPC/CoreIPCMessageKinds.h: Added.
(CoreIPC::CoreIPCMessage::):
(CoreIPC::):
* Platform/CoreIPC/mac/ConnectionMac.cpp:
* WebKit2.xcodeproj/project.pbxproj:
* win/WebKit2.vcproj:

2010-04-11 Sam Weinig <sam@webkit.org>

Rubber-stamped by Anders Carlsson.
@@ -25,6 +25,7 @@

#include "Connection.h"

#include "CoreIPCMessageKinds.h"
#include "RunLoop.h"
#include "WorkItem.h"
#include <wtf/CurrentTime.h>
@@ -33,19 +34,6 @@ using namespace std;

namespace CoreIPC {

namespace CoreIPCMessage {

enum Kind {
InitializeConnection,
SyncMessageReply,
};

}

template<> struct MessageKindTraits<CoreIPCMessage::Kind> {
static const MessageClass messageClass = MessageClassCoreIPC;
};

PassRefPtr<Connection> Connection::createServerConnection(Identifier identifier, Client* client, RunLoop* clientRunLoop)
{
return adoptRef(new Connection(identifier, true, client, clientRunLoop));
@@ -178,8 +166,7 @@ void Connection::processIncomingMessage(MessageID messageID, std::auto_ptr<Argum
{
MutexLocker locker(m_waitForMessageMutex);

HashMap<std::pair<unsigned, uint64_t>, ArgumentDecoder*>::iterator it = m_waitForMessageMap.find(std::make_pair(messageID.toInt(),
arguments->destinationID()));
HashMap<std::pair<unsigned, uint64_t>, ArgumentDecoder*>::iterator it = m_waitForMessageMap.find(std::make_pair(messageID.toInt(), arguments->destinationID()));
if (it != m_waitForMessageMap.end()) {
it->second = arguments.release();

@@ -0,0 +1,48 @@
/*
* 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,
};

} // namespace CoreIPCMessage

template<> struct MessageKindTraits<CoreIPCMessage::Kind> {
static const MessageClass messageClass = MessageClassCoreIPC;
};

} // namespace CoreIPC

#endif // CoreIPCMessageKinds_h
@@ -25,6 +25,7 @@

#include "Connection.h"

#include "CoreIPCMessageKinds.h"
#include "MachPort.h"
#include "RunLoop.h"

@@ -34,20 +35,6 @@ namespace CoreIPC {

static const size_t inlineMessageMaxSize = 4096;

// FIXME: Share this between ConnectionMac.cpp and ConnectionWin.cpp.
namespace CoreIPCMessage {

enum Kind {
InitializeConnection,
SyncMessageReply,
};

}

template<> struct MessageKindTraits<CoreIPCMessage::Kind> {
static const MessageClass messageClass = MessageClassCoreIPC;
};

void Connection::platformInvalidate()
{
if (!m_isConnected)
@@ -88,6 +88,7 @@
BC111B63112F638300337BAB /* WebPageMessageKinds.h in Headers */ = {isa = PBXBuildFile; fileRef = BC111B60112F638300337BAB /* WebPageMessageKinds.h */; };
BC111B64112F638300337BAB /* WebPageProxyMessageKinds.h in Headers */ = {isa = PBXBuildFile; fileRef = BC111B61112F638300337BAB /* WebPageProxyMessageKinds.h */; };
BC111B65112F638300337BAB /* WebProcessMessageKinds.h in Headers */ = {isa = PBXBuildFile; fileRef = BC111B62112F638300337BAB /* WebProcessMessageKinds.h */; };
BC131BC911726C2800B69727 /* CoreIPCMessageKinds.h in Headers */ = {isa = PBXBuildFile; fileRef = BC131BC811726C2800B69727 /* CoreIPCMessageKinds.h */; };
BC1A7C581136E19C00FB7167 /* WebProcessLauncher.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1A7C571136E19C00FB7167 /* WebProcessLauncher.h */; };
BC1DD7B2114DC396005ADAF3 /* WebCoreTypeArgumentMarshalling.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1DD7B1114DC396005ADAF3 /* WebCoreTypeArgumentMarshalling.h */; };
BC20EBB0116EEB0800094A50 /* WKString.h in Headers */ = {isa = PBXBuildFile; fileRef = BC20EBAE116EEB0800094A50 /* WKString.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -277,6 +278,7 @@
BC111B60112F638300337BAB /* WebPageMessageKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageMessageKinds.h; sourceTree = "<group>"; };
BC111B61112F638300337BAB /* WebPageProxyMessageKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageProxyMessageKinds.h; sourceTree = "<group>"; };
BC111B62112F638300337BAB /* WebProcessMessageKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebProcessMessageKinds.h; sourceTree = "<group>"; };
BC131BC811726C2800B69727 /* CoreIPCMessageKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreIPCMessageKinds.h; sourceTree = "<group>"; };
BC1A7C571136E19C00FB7167 /* WebProcessLauncher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebProcessLauncher.h; sourceTree = "<group>"; };
BC1DD7B1114DC396005ADAF3 /* WebCoreTypeArgumentMarshalling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreTypeArgumentMarshalling.h; sourceTree = "<group>"; };
BC20EBAE116EEB0800094A50 /* WKString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKString.h; sourceTree = "<group>"; };
@@ -503,6 +505,7 @@
BCEE966B112FAF57006BCC24 /* Attachment.h */,
BC032DA210F437D10058C15A /* Connection.cpp */,
BC032DA310F437D10058C15A /* Connection.h */,
BC131BC811726C2800B69727 /* CoreIPCMessageKinds.h */,
BC032DA410F437D10058C15A /* MessageID.h */,
);
path = CoreIPC;
@@ -849,6 +852,7 @@
BC20EBC7116EF10500094A50 /* KURLWrapper.h in Headers */,
BC20EC06116EF7FF00094A50 /* WKStringCF.h in Headers */,
BC20ED66116F971100094A50 /* WKURLCF.h in Headers */,
BC131BC911726C2800B69727 /* CoreIPCMessageKinds.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1556,6 +1556,10 @@
RelativePath="..\Platform\CoreIPC\Connection.h"
>
</File>
<File
RelativePath="..\Platform\CoreIPC\CoreIPCMessageKinds.h"
>
</File>
<File
RelativePath="..\Platform\CoreIPC\MessageID.h"
>

0 comments on commit 6fdc153

Please sign in to comment.