summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/common/chrome_content_client.cc10
-rw-r--r--chrome/common/render_messages.h1
-rw-r--r--chrome/renderer/blocked_plugin.cc22
-rw-r--r--content/browser/renderer_host/p2p/socket_host_test_utils.h4
-rw-r--r--content/common/file_system_messages.h1
-rw-r--r--content/common/quota_messages.h1
-rw-r--r--content/common/view_messages.h2
-rw-r--r--content/content_common.gypi1
-rw-r--r--ipc/ipc_fuzzing_tests.cc69
-rw-r--r--ipc/ipc_message_macros.h295
-rw-r--r--ipc/ipc_message_utils.h162
-rw-r--r--ipc/ipc_message_utils_impl.h29
-rw-r--r--ipc/sync_socket_unittest.cc83
-rw-r--r--webkit/glue/webkit_glue.gypi2
14 files changed, 351 insertions, 331 deletions
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
index 669da71..09274da 100644
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -17,18 +17,20 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h"
-#include "chrome/common/render_messages.h"
#include "content/common/pepper_plugin_registry.h"
#include "remoting/client/plugin/pepper_entrypoints.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+#include "webkit/glue/user_agent.h"
#if defined(OS_WIN)
#include "content/common/sandbox_policy.h"
#include "sandbox/src/sandbox.h"
#endif
-#include "webkit/glue/user_agent.h"
+#if !defined(NACL_WIN64) // The code this needs isn't linked on Win64 builds.
+#include "chrome/common/render_messages.h"
+#endif
namespace {
@@ -288,6 +290,7 @@ void ChromeContentClient::AddPepperPlugins(
}
bool ChromeContentClient::CanSendWhileSwappedOut(const IPC::Message* msg) {
+#if !defined(NACL_WIN64) // The code this needs isn't linked on Win64 builds.
// Any Chrome-specific messages that must be allowed to be sent from swapped
// out renderers.
switch (msg->type()) {
@@ -296,11 +299,13 @@ bool ChromeContentClient::CanSendWhileSwappedOut(const IPC::Message* msg) {
default:
break;
}
+#endif
return false;
}
bool ChromeContentClient::CanHandleWhileSwappedOut(
const IPC::Message& msg) {
+#if !defined(NACL_WIN64) // The code this needs isn't linked on Win64 builds.
// Any Chrome-specific messages (apart from those listed in
// CanSendWhileSwappedOut) that must be handled by the browser when sent from
// swapped out renderers.
@@ -310,6 +315,7 @@ bool ChromeContentClient::CanHandleWhileSwappedOut(
default:
break;
}
+#endif
return false;
}
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 79ea807..4b58bcf 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -27,6 +27,7 @@
#include "content/common/common_param_traits.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_platform_file.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h"
#include "ui/gfx/rect.h"
diff --git a/chrome/renderer/blocked_plugin.cc b/chrome/renderer/blocked_plugin.cc
index 5501aad..f283912 100644
--- a/chrome/renderer/blocked_plugin.cc
+++ b/chrome/renderer/blocked_plugin.cc
@@ -51,7 +51,7 @@ static const char* const kBlockedPluginDataURL = "chrome://blockedplugindata/";
static const unsigned kMenuActionLoad = 1;
static const unsigned kMenuActionRemove = 2;
-static const BlockedPlugin* gLastActiveMenu;
+static const BlockedPlugin* g_last_active_menu;
BlockedPlugin::BlockedPlugin(RenderView* render_view,
WebFrame* frame,
@@ -139,7 +139,7 @@ void BlockedPlugin::ShowContextMenu(const WebKit::WebMouseEvent& event) {
menu_data.customItems.swap(custom_items);
menu_data.mousePosition = WebPoint(event.windowX, event.windowY);
render_view()->showContextMenu(NULL, menu_data);
- gLastActiveMenu = this;
+ g_last_active_menu = this;
}
bool BlockedPlugin::OnMessageReceived(const IPC::Message& message) {
@@ -147,17 +147,11 @@ bool BlockedPlugin::OnMessageReceived(const IPC::Message& message) {
// custom menu IDs, and not just our own. We don't swallow
// ViewMsg_LoadBlockedPlugins because multiple blocked plugins have an
// interest in it.
- if (message.type() == ViewMsg_CustomContextMenuAction::ID &&
- gLastActiveMenu == this) {
- ViewMsg_CustomContextMenuAction::Dispatch(
- &message, this, this, &BlockedPlugin::OnMenuItemSelected);
- } else {
- IPC_BEGIN_MESSAGE_MAP(BlockedPlugin, message)
- IPC_MESSAGE_HANDLER(ChromeViewMsg_LoadBlockedPlugins,
- OnLoadBlockedPlugins)
- IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsPrerendering, OnSetIsPrerendering)
- IPC_END_MESSAGE_MAP()
- }
+ IPC_BEGIN_MESSAGE_MAP(BlockedPlugin, message)
+ IPC_MESSAGE_HANDLER(ViewMsg_CustomContextMenuAction, OnMenuItemSelected)
+ IPC_MESSAGE_HANDLER(ChromeViewMsg_LoadBlockedPlugins, OnLoadBlockedPlugins)
+ IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsPrerendering, OnSetIsPrerendering)
+ IPC_END_MESSAGE_MAP()
return false;
}
@@ -165,6 +159,8 @@ bool BlockedPlugin::OnMessageReceived(const IPC::Message& message) {
void BlockedPlugin::OnMenuItemSelected(
const webkit_glue::CustomContextMenuContext& /* ignored */,
unsigned id) {
+ if (g_last_active_menu != this)
+ return;
if (id == kMenuActionLoad) {
Send(new ViewHostMsg_UserMetricsRecordAction("Plugin_Load_Menu"));
LoadPlugin();
diff --git a/content/browser/renderer_host/p2p/socket_host_test_utils.h b/content/browser/renderer_host/p2p/socket_host_test_utils.h
index a24d094..d4b491b 100644
--- a/content/browser/renderer_host/p2p/socket_host_test_utils.h
+++ b/content/browser/renderer_host/p2p/socket_host_test_utils.h
@@ -264,7 +264,7 @@ MATCHER_P(MatchPacketMessage, packet_content, "") {
if (arg->type() != P2PMsg_OnDataReceived::ID)
return false;
P2PMsg_OnDataReceived::Param params;
- IPC::MessageWithTuple<P2PMsg_OnDataReceived::Param>::Read(arg, &params);
+ P2PMsg_OnDataReceived::Read(arg, &params);
return params.c == packet_content;
}
@@ -272,7 +272,7 @@ MATCHER_P(MatchIncomingSocketMessage, address, "") {
if (arg->type() != P2PMsg_OnIncomingTcpConnection::ID)
return false;
P2PMsg_OnIncomingTcpConnection::Param params;
- IPC::MessageWithTuple<P2PMsg_OnIncomingTcpConnection::Param>::Read(
+ P2PMsg_OnIncomingTcpConnection::Read(
arg, &params);
return params.b == address;
}
diff --git a/content/common/file_system_messages.h b/content/common/file_system_messages.h
index 38504f6..b248558 100644
--- a/content/common/file_system_messages.h
+++ b/content/common/file_system_messages.h
@@ -6,6 +6,7 @@
// Multiply-included message file, hence no include guard.
#include "base/file_util_proxy.h"
+#include "googleurl/src/gurl.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_platform_file.h"
#include "webkit/fileapi/file_system_types.h"
diff --git a/content/common/quota_messages.h b/content/common/quota_messages.h
index d2965e2..69d3696 100644
--- a/content/common/quota_messages.h
+++ b/content/common/quota_messages.h
@@ -5,6 +5,7 @@
// Multiply-included message file, hence no include guard.
#include "base/basictypes.h"
+#include "googleurl/src/gurl.h"
#include "ipc/ipc_message_macros.h"
#include "webkit/quota/quota_types.h"
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 2a7a839..2798a26 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -16,10 +16,12 @@
#include "content/common/renderer_preferences.h"
#include "content/common/webkit_param_traits.h"
#include "content/common/window_container_type.h"
+#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_platform_file.h"
#include "media/base/media_log_event.h"
#include "net/base/host_port_pair.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction.h"
diff --git a/content/content_common.gypi b/content/content_common.gypi
index 717c9a7..3e067c1 100644
--- a/content/content_common.gypi
+++ b/content/content_common.gypi
@@ -9,6 +9,7 @@
'type': 'static_library',
'dependencies': [
'../base/base.gyp:base',
+ '../gpu/gpu.gyp:gpu_ipc',
'../ipc/ipc.gyp:ipc',
'../media/media.gyp:media',
'../net/net.gyp:net',
diff --git a/ipc/ipc_fuzzing_tests.cc b/ipc/ipc_fuzzing_tests.cc
index 7c96587..c7076cc 100644
--- a/ipc/ipc_fuzzing_tests.cc
+++ b/ipc/ipc_fuzzing_tests.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -11,12 +11,31 @@
#include "base/threading/platform_thread.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_channel_proxy.h"
-#include "ipc/ipc_message_utils.h"
-#include "ipc/ipc_message_utils_impl.h"
#include "ipc/ipc_tests.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/multiprocess_func_list.h"
+// IPC messages for testing ---------------------------------------------------
+
+#define IPC_MESSAGE_IMPL
+#include "ipc/ipc_message_macros.h"
+
+#define IPC_MESSAGE_START TestMsgStart
+
+// Generic message class that is an int followed by a wstring.
+IPC_MESSAGE_CONTROL2(MsgClassIS, int, std::wstring)
+
+// Generic message class that is a wstring followed by an int.
+IPC_MESSAGE_CONTROL2(MsgClassSI, std::wstring, int)
+
+// Message to create a mutex in the IPC server, using the received name.
+IPC_MESSAGE_CONTROL2(MsgDoMutex, std::wstring, int)
+
+// Used to generate an ID for a message that should not exist.
+IPC_MESSAGE_CONTROL0(MsgUnhandled)
+
+// ----------------------------------------------------------------------------
+
TEST(IPCMessageIntegrity, ReadBeyondBufferStr) {
//This was BUG 984408.
uint32 v1 = kuint32max - 1;
@@ -96,46 +115,6 @@ TEST(IPCMessageIntegrity, ReadVectorTooLarge2) {
EXPECT_FALSE(ReadParam(&m, &iter, &vec));
}
-// We don't actually use the messages defined in this file, but we do this
-// to get to the IPC macros.
-#include "ipc/ipc_sync_message_unittest.h"
-
-enum IPCMessageIds {
- UNUSED_IPC_TYPE,
- SERVER_FIRST_IPC_TYPE, // 1st Test message tag.
- SERVER_SECOND_IPC_TYPE, // 2nd Test message tag.
- SERVER_THIRD_IPC_TYPE, // 3rd Test message tag.
- CLIENT_MALFORMED_IPC, // Sent to client if server detects bad message.
- CLIENT_UNHANDLED_IPC // Sent to client if server detects unhanded IPC.
-};
-
-// Generic message class that is an int followed by a wstring.
-class MsgClassIS : public IPC::MessageWithTuple< Tuple2<int, std::wstring> > {
- public:
- enum { ID = SERVER_FIRST_IPC_TYPE };
- MsgClassIS(const int& arg1, const std::wstring& arg2)
- : IPC::MessageWithTuple< Tuple2<int, std::wstring> >(
- MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1, arg2)) {}
-};
-
-// Generic message class that is a wstring followed by an int.
-class MsgClassSI : public IPC::MessageWithTuple< Tuple2<std::wstring, int> > {
- public:
- enum { ID = SERVER_SECOND_IPC_TYPE };
- MsgClassSI(const std::wstring& arg1, const int& arg2)
- : IPC::MessageWithTuple< Tuple2<std::wstring, int> >(
- MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1, arg2)) {}
-};
-
-// Message to create a mutex in the IPC server, using the received name.
-class MsgDoMutex : public IPC::MessageWithTuple< Tuple2<std::wstring, int> > {
- public:
- enum { ID = SERVER_THIRD_IPC_TYPE };
- MsgDoMutex(const std::wstring& mutex_name, const int& unused)
- : IPC::MessageWithTuple< Tuple2<std::wstring, int> >(
- MSG_ROUTING_CONTROL, ID, MakeRefTuple(mutex_name, unused)) {}
-};
-
class SimpleListener : public IPC::Channel::Listener {
public:
SimpleListener() : other_(NULL) {
@@ -202,7 +181,7 @@ class FuzzerServerListener : public SimpleListener {
}
void ReplyMsgNotHandled(uint32 type_id) {
- RoundtripAckReply(FUZZER_ROUTING_ID, CLIENT_UNHANDLED_IPC, type_id);
+ RoundtripAckReply(FUZZER_ROUTING_ID, MsgUnhandled::ID, type_id);
Cleanup();
}
@@ -249,7 +228,7 @@ class FuzzerClientListener : public SimpleListener {
}
bool ExpectMsgNotHandled(uint32 type_id) {
- return ExpectMessage(type_id, CLIENT_UNHANDLED_IPC);
+ return ExpectMessage(type_id, MsgUnhandled::ID);
}
private:
diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h
index f0b847d..63faa48 100644
--- a/ipc/ipc_message_macros.h
+++ b/ipc/ipc_message_macros.h
@@ -194,6 +194,11 @@
#define IPC_STRUCT_MEMBER(type, name) type name;
#define IPC_STRUCT_END() };
+// Override this to force message classes to be exported.
+#ifndef IPC_MESSAGE_EXPORT
+#define IPC_MESSAGE_EXPORT
+#endif
+
// Message macros collect specific numbers of arguments and funnel them into
// the common message generation macro. These should never be redefined.
#define IPC_MESSAGE_CONTROL0(msg_class) \
@@ -412,6 +417,174 @@
#define IPC_SYNC_MESSAGE_ROUTED5_4(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out, type4_out) \
IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 5, 4, (type1_in, type2_in, type3_in, type4_in, type5_in), (type1_out, type2_out, type3_out, type4_out))
+// The following macros define the common set of methods provided by ASYNC
+// message classes.
+#define IPC_ASYNC_MESSAGE_METHODS_GENERIC \
+ template<class T, class S, class Method> \
+ static bool Dispatch(const Message* msg, T* obj, S* sender, Method func) { \
+ Schema::Param p; \
+ if (Read(msg, &p)) { \
+ DispatchToMethod(obj, func, p); \
+ return true; \
+ } \
+ return false; \
+ }
+#define IPC_ASYNC_MESSAGE_METHODS_1 \
+ IPC_ASYNC_MESSAGE_METHODS_GENERIC \
+ template<class T, class S, typename TA> \
+ static bool Dispatch(const Message* msg, T* obj, S* sender, \
+ void (T::*func)(const Message&, TA)) { \
+ Schema::Param p; \
+ if (Read(msg, &p)) { \
+ (obj->*func)(*msg, p.a); \
+ return true; \
+ } \
+ return false; \
+ }
+#define IPC_ASYNC_MESSAGE_METHODS_2 \
+ IPC_ASYNC_MESSAGE_METHODS_GENERIC \
+ template<class T, class S, typename TA, typename TB> \
+ static bool Dispatch(const Message* msg, T* obj, S* sender, \
+ void (T::*func)(const Message&, TA, TB)) { \
+ Schema::Param p; \
+ if (Read(msg, &p)) { \
+ (obj->*func)(*msg, p.a, p.b); \
+ return true; \
+ } \
+ return false; \
+ } \
+ template<typename TA, typename TB> \
+ static bool Read(const IPC::Message* msg, TA* a, TB* b) { \
+ Schema::Param p; \
+ if (!Read(msg, &p)) \
+ return false; \
+ *a = p.a; \
+ *b = p.b; \
+ return true; \
+ }
+#define IPC_ASYNC_MESSAGE_METHODS_3 \
+ IPC_ASYNC_MESSAGE_METHODS_GENERIC \
+ template<class T, class S, typename TA, typename TB, typename TC> \
+ static bool Dispatch(const Message* msg, T* obj, S* sender, \
+ void (T::*func)(const Message&, TA, TB, TC)) { \
+ Schema::Param p; \
+ if (Read(msg, &p)) { \
+ (obj->*func)(*msg, p.a, p.b, p.c); \
+ return true; \
+ } \
+ return false; \
+ } \
+ template<typename TA, typename TB, typename TC> \
+ static bool Read(const IPC::Message* msg, TA* a, TB* b, TC* c) { \
+ Schema::Param p; \
+ if (!Read(msg, &p)) \
+ return false; \
+ *a = p.a; \
+ *b = p.b; \
+ *c = p.c; \
+ return true; \
+ }
+#define IPC_ASYNC_MESSAGE_METHODS_4 \
+ IPC_ASYNC_MESSAGE_METHODS_GENERIC \
+ template<class T, class S, typename TA, typename TB, typename TC, \
+ typename TD> \
+ static bool Dispatch(const Message* msg, T* obj, S* sender, \
+ void (T::*func)(const Message&, TA, TB, TC, TD)) { \
+ Schema::Param p; \
+ if (Read(msg, &p)) { \
+ (obj->*func)(*msg, p.a, p.b, p.c, p.d); \
+ return true; \
+ } \
+ return false; \
+ } \
+ template<typename TA, typename TB, typename TC, typename TD> \
+ static bool Read(const IPC::Message* msg, TA* a, TB* b, TC* c, TD* d) { \
+ Schema::Param p; \
+ if (!Read(msg, &p)) \
+ return false; \
+ *a = p.a; \
+ *b = p.b; \
+ *c = p.c; \
+ *d = p.d; \
+ return true; \
+ }
+#define IPC_ASYNC_MESSAGE_METHODS_5 \
+ IPC_ASYNC_MESSAGE_METHODS_GENERIC \
+ template<class T, class S, typename TA, typename TB, typename TC, \
+ typename TD, typename TE> \
+ static bool Dispatch(const Message* msg, T* obj, S* sender, \
+ void (T::*func)(const Message&, TA, TB, TC, TD, TE)) { \
+ Schema::Param p; \
+ if (Read(msg, &p)) { \
+ (obj->*func)(*msg, p.a, p.b, p.c, p.d, p.e); \
+ return true; \
+ } \
+ return false; \
+ } \
+ template<typename TA, typename TB, typename TC, typename TD, typename TE> \
+ static bool Read(const IPC::Message* msg, TA* a, TB* b, TC* c, TD* d, \
+ TE* e) { \
+ Schema::Param p; \
+ if (!Read(msg, &p)) \
+ return false; \
+ *a = p.a; \
+ *b = p.b; \
+ *c = p.c; \
+ *d = p.d; \
+ *e = p.e; \
+ return true; \
+ }
+
+// The following macros define the common set of methods provided by SYNC
+// message classes.
+#define IPC_SYNC_MESSAGE_METHODS_GENERIC \
+ template<class T, class S, class Method> \
+ static bool Dispatch(const Message* msg, T* obj, S* sender, Method func) { \
+ Schema::SendParam send_params; \
+ bool ok = ReadSendParam(msg, &send_params); \
+ return Schema::DispatchWithSendParams(ok, send_params, msg, obj, sender, \
+ func); \
+ } \
+ template<class T, class Method> \
+ static bool DispatchDelayReply(const Message* msg, T* obj, Method func) { \
+ Schema::SendParam send_params; \
+ bool ok = ReadSendParam(msg, &send_params); \
+ return Schema::DispatchDelayReplyWithSendParams(ok, send_params, msg, \
+ obj, func); \
+ }
+#define IPC_SYNC_MESSAGE_METHODS_0 \
+ IPC_SYNC_MESSAGE_METHODS_GENERIC
+#define IPC_SYNC_MESSAGE_METHODS_1 \
+ IPC_SYNC_MESSAGE_METHODS_GENERIC \
+ template<typename TA> \
+ static void WriteReplyParams(Message* reply, TA a) { \
+ Schema::WriteReplyParams(reply, a); \
+ }
+#define IPC_SYNC_MESSAGE_METHODS_2 \
+ IPC_SYNC_MESSAGE_METHODS_GENERIC \
+ template<typename TA, typename TB> \
+ static void WriteReplyParams(Message* reply, TA a, TB b) { \
+ Schema::WriteReplyParams(reply, a, b); \
+ }
+#define IPC_SYNC_MESSAGE_METHODS_3 \
+ IPC_SYNC_MESSAGE_METHODS_GENERIC \
+ template<typename TA, typename TB, typename TC> \
+ static void WriteReplyParams(Message* reply, TA a, TB b, TC c) { \
+ Schema::WriteReplyParams(reply, a, b, c); \
+ }
+#define IPC_SYNC_MESSAGE_METHODS_4 \
+ IPC_SYNC_MESSAGE_METHODS_GENERIC \
+ template<typename TA, typename TB, typename TC, typename TD> \
+ static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d) { \
+ Schema::WriteReplyParams(reply, a, b, c, d); \
+ }
+#define IPC_SYNC_MESSAGE_METHODS_5 \
+ IPC_SYNC_MESSAGE_METHODS_GENERIC \
+ template<typename TA, typename TB, typename TC, typename TD, typename TE> \
+ static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d, TE e) { \
+ Schema::WriteReplyParams(reply, a, b, c, d, e); \
+ }
+
// Common message macro which dispatches into one of the 6 (sync x kind)
// routines. There is a way that these 6 cases can be lumped together,
// but the macros get very complicated in that case.
@@ -424,6 +597,7 @@
#define IPC_EMPTY_CONTROL_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \
class msg_class : public IPC::Message { \
public: \
+ typedef IPC::Message Schema; \
enum { ID = IPC_MESSAGE_ID() }; \
msg_class() : IPC::Message(MSG_ROUTING_CONTROL, ID, PRIORITY_NORMAL) {} \
};
@@ -431,50 +605,66 @@
#define IPC_EMPTY_ROUTED_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \
class msg_class : public IPC::Message { \
public: \
+ typedef IPC::Message Schema; \
enum { ID = IPC_MESSAGE_ID() }; \
msg_class(int32 routing_id) \
: IPC::Message(routing_id, ID, PRIORITY_NORMAL) {} \
};
#define IPC_ASYNC_CONTROL_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \
- class msg_class : \
- public IPC::MessageWithTuple<IPC_TUPLE_IN_##in_cnt in_list> { \
+ class IPC_MESSAGE_EXPORT msg_class : public IPC::Message { \
public: \
+ typedef IPC::MessageSchema<IPC_TUPLE_IN_##in_cnt in_list> Schema; \
+ typedef Schema::Param Param; \
enum { ID = IPC_MESSAGE_ID() }; \
msg_class(IPC_TYPE_IN_##in_cnt in_list); \
virtual ~msg_class(); \
+ static bool Read(const Message* msg, Schema::Param* p); \
static void Log(std::string* name, const Message* msg, std::string* l); \
+ IPC_ASYNC_MESSAGE_METHODS_##in_cnt \
};
#define IPC_ASYNC_ROUTED_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \
- class msg_class : \
- public IPC::MessageWithTuple<IPC_TUPLE_IN_##in_cnt in_list> { \
+ class IPC_MESSAGE_EXPORT msg_class : public IPC::Message { \
public: \
+ typedef IPC::MessageSchema<IPC_TUPLE_IN_##in_cnt in_list> Schema; \
+ typedef Schema::Param Param; \
enum { ID = IPC_MESSAGE_ID() }; \
msg_class(int32 routing_id IPC_COMMA_##in_cnt \
IPC_TYPE_IN_##in_cnt in_list); \
virtual ~msg_class(); \
+ static bool Read(const Message* msg, Schema::Param* p); \
static void Log(std::string* name, const Message* msg, std::string* l); \
+ IPC_ASYNC_MESSAGE_METHODS_##in_cnt \
};
#define IPC_SYNC_CONTROL_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \
- class msg_class : \
- public IPC::MessageWithReply<IPC_TUPLE_IN_##in_cnt in_list, \
- IPC_TUPLE_OUT_##out_cnt out_list> { \
+ class IPC_MESSAGE_EXPORT msg_class : public IPC::SyncMessage { \
public: \
+ typedef IPC::SyncMessageSchema<IPC_TUPLE_IN_##in_cnt in_list, \
+ IPC_TUPLE_OUT_##out_cnt out_list> Schema; \
+ typedef Schema::ReplyParam ReplyParam; \
+ typedef Schema::SendParam SendParam; \
enum { ID = IPC_MESSAGE_ID() }; \
msg_class(IPC_TYPE_IN_##in_cnt in_list \
IPC_COMMA_AND_##in_cnt(IPC_COMMA_##out_cnt) \
IPC_TYPE_OUT_##out_cnt out_list); \
virtual ~msg_class(); \
+ static bool ReadSendParam(const Message* msg, Schema::SendParam* p); \
+ static bool ReadReplyParam( \
+ const Message* msg, \
+ TupleTypes<ReplyParam>::ValueTuple* p); \
static void Log(std::string* name, const Message* msg, std::string* l); \
+ IPC_SYNC_MESSAGE_METHODS_##out_cnt \
};
#define IPC_SYNC_ROUTED_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \
- class msg_class : \
- public IPC::MessageWithReply<IPC_TUPLE_IN_##in_cnt in_list, \
- IPC_TUPLE_OUT_##out_cnt out_list> { \
+ class IPC_MESSAGE_EXPORT msg_class : public IPC::SyncMessage { \
public: \
+ typedef IPC::SyncMessageSchema<IPC_TUPLE_IN_##in_cnt in_list, \
+ IPC_TUPLE_OUT_##out_cnt out_list> Schema; \
+ typedef Schema::ReplyParam ReplyParam; \
+ typedef Schema::SendParam SendParam; \
enum { ID = IPC_MESSAGE_ID() }; \
msg_class(int32 routing_id \
IPC_COMMA_OR_##in_cnt(IPC_COMMA_##out_cnt) \
@@ -482,7 +672,12 @@
IPC_COMMA_AND_##in_cnt(IPC_COMMA_##out_cnt) \
IPC_TYPE_OUT_##out_cnt out_list); \
virtual ~msg_class(); \
+ static bool ReadSendParam(const Message* msg, Schema::SendParam* p); \
+ static bool ReadReplyParam( \
+ const Message* msg, \
+ TupleTypes<ReplyParam>::ValueTuple* p); \
static void Log(std::string* name, const Message* msg, std::string* l); \
+ IPC_SYNC_MESSAGE_METHODS_##out_cnt \
};
#if defined(IPC_MESSAGE_IMPL)
@@ -501,30 +696,42 @@
#define IPC_ASYNC_CONTROL_IMPL(msg_class, in_cnt, out_cnt, in_list, out_list) \
msg_class::msg_class(IPC_TYPE_IN_##in_cnt in_list) : \
- IPC::MessageWithTuple<IPC_TUPLE_IN_##in_cnt in_list> \
- (MSG_ROUTING_CONTROL, ID, IPC_NAME_IN_##in_cnt in_list) \
- {} \
- msg_class::~msg_class() {}
+ IPC::Message(MSG_ROUTING_CONTROL, ID, PRIORITY_NORMAL) { \
+ Schema::Write(this, IPC_NAME_IN_##in_cnt in_list); \
+ } \
+ msg_class::~msg_class() {} \
+ bool msg_class::Read(const Message* msg, Schema::Param* p) { \
+ return Schema::Read(msg, p); \
+ }
#define IPC_ASYNC_ROUTED_IMPL(msg_class, in_cnt, out_cnt, in_list, out_list) \
msg_class::msg_class(int32 routing_id IPC_COMMA_##in_cnt \
IPC_TYPE_IN_##in_cnt in_list) : \
- IPC::MessageWithTuple<IPC_TUPLE_IN_##in_cnt in_list> \
- (routing_id, ID, IPC_NAME_IN_##in_cnt in_list) \
- {} \
- msg_class::~msg_class() {}
+ IPC::Message(routing_id, ID, PRIORITY_NORMAL) { \
+ Schema::Write(this, IPC_NAME_IN_##in_cnt in_list); \
+ } \
+ msg_class::~msg_class() {} \
+ bool msg_class::Read(const Message* msg, Schema::Param* p) { \
+ return Schema::Read(msg, p); \
+ }
#define IPC_SYNC_CONTROL_IMPL(msg_class, in_cnt, out_cnt, in_list, out_list) \
msg_class::msg_class(IPC_TYPE_IN_##in_cnt in_list \
IPC_COMMA_AND_##in_cnt(IPC_COMMA_##out_cnt) \
IPC_TYPE_OUT_##out_cnt out_list) : \
- IPC::MessageWithReply<IPC_TUPLE_IN_##in_cnt in_list, \
- IPC_TUPLE_OUT_##out_cnt out_list> \
- (MSG_ROUTING_CONTROL, ID, \
- IPC_NAME_IN_##in_cnt in_list, \
- IPC_NAME_OUT_##out_cnt out_list) \
- {} \
- msg_class::~msg_class() {}
+ IPC::SyncMessage(MSG_ROUTING_CONTROL, ID, PRIORITY_NORMAL, \
+ new IPC::ParamDeserializer<Schema::ReplyParam>( \
+ IPC_NAME_OUT_##out_cnt out_list)) { \
+ Schema::Write(this, IPC_NAME_IN_##in_cnt in_list); \
+ } \
+ msg_class::~msg_class() {} \
+ bool msg_class::ReadSendParam(const Message* msg, Schema::SendParam* p) { \
+ return Schema::ReadSendParam(msg, p); \
+ } \
+ bool msg_class::ReadReplyParam(const Message* msg, \
+ TupleTypes<ReplyParam>::ValueTuple* p) { \
+ return Schema::ReadReplyParam(msg, p); \
+ }
#define IPC_SYNC_ROUTED_IMPL(msg_class, in_cnt, out_cnt, in_list, out_list) \
msg_class::msg_class(int32 routing_id \
@@ -532,13 +739,19 @@
IPC_TYPE_IN_##in_cnt in_list \
IPC_COMMA_AND_##in_cnt(IPC_COMMA_##out_cnt) \
IPC_TYPE_OUT_##out_cnt out_list) : \
- IPC::MessageWithReply<IPC_TUPLE_IN_##in_cnt in_list, \
- IPC_TUPLE_OUT_##out_cnt out_list> \
- (routing_id, ID, \
- IPC_NAME_IN_##in_cnt in_list, \
- IPC_NAME_OUT_##out_cnt out_list) \
- {} \
- msg_class::~msg_class() {}
+ IPC::SyncMessage(routing_id, ID, PRIORITY_NORMAL, \
+ new IPC::ParamDeserializer<Schema::ReplyParam>( \
+ IPC_NAME_OUT_##out_cnt out_list)) { \
+ Schema::Write(this, IPC_NAME_IN_##in_cnt in_list); \
+ } \
+ msg_class::~msg_class() {} \
+ bool msg_class::ReadSendParam(const Message* msg, Schema::SendParam* p) { \
+ return Schema::ReadSendParam(msg, p); \
+ } \
+ bool msg_class::ReadReplyParam(const Message* msg, \
+ TupleTypes<ReplyParam>::ValueTuple* p) { \
+ return Schema::ReadReplyParam(msg, p); \
+ }
#define IPC_EMPTY_MESSAGE_LOG(msg_class)
@@ -550,8 +763,8 @@
*name = #msg_class; \
if (!msg || !l) \
return; \
- Param p; \
- if (Read(msg, &p)) \
+ Schema::Param p; \
+ if (Schema::Read(msg, &p)) \
IPC::LogParam(p, l); \
}
@@ -564,13 +777,13 @@
if (!msg || !l) \
return; \
if (msg->is_sync()) { \
- TupleTypes<SendParam>::ValueTuple p; \
- if (ReadSendParam(msg, &p)) \
+ TupleTypes<Schema::SendParam>::ValueTuple p; \
+ if (Schema::ReadSendParam(msg, &p)) \
IPC::LogParam(p, l); \
AddOutputParamsToLog(msg, l); \
} else { \
- TupleTypes<ReplyParam>::ValueTuple p; \
- if (ReadReplyParam(msg, &p)) \
+ TupleTypes<Schema::ReplyParam>::ValueTuple p; \
+ if (Schema::ReadReplyParam(msg, &p)) \
IPC::LogParam(p, l); \
} \
}
@@ -722,7 +935,8 @@ LogFunctionMap g_log_function_mapping;
#define IPC_MESSAGE_FORWARD(msg_class, obj, member_func) \
case msg_class::ID: \
- msg_is_ok__ = msg_class::Dispatch(&ipc_message__, obj, this, &member_func); \
+ msg_is_ok__ = msg_class::Dispatch(&ipc_message__, obj, this, \
+ &member_func); \
break;
#define IPC_MESSAGE_HANDLER(msg_class, member_func) \
@@ -730,7 +944,8 @@ LogFunctionMap g_log_function_mapping;
#define IPC_MESSAGE_FORWARD_DELAY_REPLY(msg_class, obj, member_func) \
case msg_class::ID: \
- msg_is_ok__ = msg_class::DispatchDelayReply(&ipc_message__, obj, &member_func); \
+ msg_is_ok__ = msg_class::DispatchDelayReply(&ipc_message__, obj, \
+ &member_func); \
break;
#define IPC_MESSAGE_HANDLER_DELAY_REPLY(msg_class, member_func) \
diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h
index ae7490c..9da9eba4 100644
--- a/ipc/ipc_message_utils.h
+++ b/ipc/ipc_message_utils.h
@@ -944,136 +944,13 @@ struct ParamTraits< Tuple5<A, B, C, D, E> > {
// Used for asynchronous messages.
template <class ParamType>
-class MessageWithTuple : public Message {
+class MessageSchema {
public:
typedef ParamType Param;
typedef typename TupleTypes<ParamType>::ParamTuple RefParam;
- // The constructor and the Read() method's templated implementations are in
- // ipc_message_utils_impl.h. The subclass constructor and Log() methods call
- // the templated versions of these and make sure there are instantiations in
- // those translation units.
- MessageWithTuple(int32 routing_id, uint32 type, const RefParam& p);
-
+ static void Write(Message* msg, const RefParam& p) IPC_MSG_NOINLINE;
static bool Read(const Message* msg, Param* p) IPC_MSG_NOINLINE;
-
- // Generic dispatcher. Should cover most cases.
- template<class T, class S, class Method>
- static bool Dispatch(const Message* msg, T* obj, S* sender, Method func) {
- Param p;
- if (Read(msg, &p)) {
- DispatchToMethod(obj, func, p);
- return true;
- }
- return false;
- }
-
- // The following dispatchers exist for the case where the callback function
- // needs the message as well. They assume that "Param" is a type of Tuple
- // (except the one arg case, as there is no Tuple1).
- template<class T, class S, typename TA>
- static bool Dispatch(const Message* msg, T* obj, S* sender,
- void (T::*func)(const Message&, TA)) {
- Param p;
- if (Read(msg, &p)) {
- (obj->*func)(*msg, p.a);
- return true;
- }
- return false;
- }
-
- template<class T, class S, typename TA, typename TB>
- static bool Dispatch(const Message* msg, T* obj, S* sender,
- void (T::*func)(const Message&, TA, TB)) {
- Param p;
- if (Read(msg, &p)) {
- (obj->*func)(*msg, p.a, p.b);
- return true;
- }
- return false;
- }
-
- template<class T, class S, typename TA, typename TB, typename TC>
- static bool Dispatch(const Message* msg, T* obj, S* sender,
- void (T::*func)(const Message&, TA, TB, TC)) {
- Param p;
- if (Read(msg, &p)) {
- (obj->*func)(*msg, p.a, p.b, p.c);
- return true;
- }
- return false;
- }
-
- template<class T, class S, typename TA, typename TB, typename TC, typename TD>
- static bool Dispatch(const Message* msg, T* obj, S* sender,
- void (T::*func)(const Message&, TA, TB, TC, TD)) {
- Param p;
- if (Read(msg, &p)) {
- (obj->*func)(*msg, p.a, p.b, p.c, p.d);
- return true;
- }
- return false;
- }
-
- template<class T, class S, typename TA, typename TB, typename TC, typename TD,
- typename TE>
- static bool Dispatch(const Message* msg, T* obj, S* sender,
- void (T::*func)(const Message&, TA, TB, TC, TD, TE)) {
- Param p;
- if (Read(msg, &p)) {
- (obj->*func)(*msg, p.a, p.b, p.c, p.d, p.e);
- return true;
- }
- return false;
- }
-
- // Functions used to do manual unpacking. Only used by the automation code,
- // these should go away once that code uses SyncChannel.
- template<typename TA, typename TB>
- static bool Read(const IPC::Message* msg, TA* a, TB* b) {
- ParamType params;
- if (!Read(msg, &params))
- return false;
- *a = params.a;
- *b = params.b;
- return true;
- }
-
- template<typename TA, typename TB, typename TC>
- static bool Read(const IPC::Message* msg, TA* a, TB* b, TC* c) {
- ParamType params;
- if (!Read(msg, &params))
- return false;
- *a = params.a;
- *b = params.b;
- *c = params.c;
- return true;
- }
-
- template<typename TA, typename TB, typename TC, typename TD>
- static bool Read(const IPC::Message* msg, TA* a, TB* b, TC* c, TD* d) {
- ParamType params;
- if (!Read(msg, &params))
- return false;
- *a = params.a;
- *b = params.b;
- *c = params.c;
- *d = params.d;
- return true;
- }
-
- template<typename TA, typename TB, typename TC, typename TD, typename TE>
- static bool Read(const IPC::Message* msg, TA* a, TB* b, TC* c, TD* d, TE* e) {
- ParamType params;
- if (!Read(msg, &params))
- return false;
- *a = params.a;
- *b = params.b;
- *c = params.c;
- *d = params.d;
- *e = params.e;
- return true;
- }
};
// defined in ipc_logging.cc
@@ -1139,57 +1016,52 @@ class ParamDeserializer : public MessageReplyDeserializer {
// Used for synchronous messages.
template <class SendParamType, class ReplyParamType>
-class MessageWithReply : public SyncMessage {
+class SyncMessageSchema {
public:
typedef SendParamType SendParam;
typedef typename TupleTypes<SendParam>::ParamTuple RefSendParam;
typedef ReplyParamType ReplyParam;
- MessageWithReply(int32 routing_id, uint32 type,
- const RefSendParam& send, const ReplyParam& reply);
+ static void Write(Message* msg, const RefSendParam& send) IPC_MSG_NOINLINE;
static bool ReadSendParam(const Message* msg, SendParam* p) IPC_MSG_NOINLINE;
static bool ReadReplyParam(
const Message* msg,
typename TupleTypes<ReplyParam>::ValueTuple* p) IPC_MSG_NOINLINE;
template<class T, class S, class Method>
- static bool Dispatch(const Message* msg, T* obj, S* sender, Method func) {
- SendParam send_params;
- Message* reply = GenerateReply(msg);
- bool error;
- if (ReadSendParam(msg, &send_params)) {
+ static bool DispatchWithSendParams(bool ok, const SendParam& send_params,
+ const Message* msg, T* obj, S* sender,
+ Method func) {
+ Message* reply = SyncMessage::GenerateReply(msg);
+ if (ok) {
typename TupleTypes<ReplyParam>::ValueTuple reply_params;
DispatchToMethod(obj, func, send_params, &reply_params);
WriteParam(reply, reply_params);
- error = false;
LogReplyParamsToMessage(reply_params, msg);
} else {
NOTREACHED() << "Error deserializing message " << msg->type();
reply->set_reply_error();
- error = true;
}
-
sender->Send(reply);
- return !error;
+ return ok;
}
template<class T, class Method>
- static bool DispatchDelayReply(const Message* msg, T* obj, Method func) {
- SendParam send_params;
- Message* reply = GenerateReply(msg);
- bool error;
- if (ReadSendParam(msg, &send_params)) {
+ static bool DispatchDelayReplyWithSendParams(bool ok,
+ const SendParam& send_params,
+ const Message* msg, T* obj,
+ Method func) {
+ Message* reply = SyncMessage::GenerateReply(msg);
+ if (ok) {
Tuple1<Message&> t = MakeRefTuple(*reply);
ConnectMessageAndReply(msg, reply);
DispatchToMethod(obj, func, send_params, &t);
- error = false;
} else {
NOTREACHED() << "Error deserializing message " << msg->type();
reply->set_reply_error();
obj->Send(reply);
- error = true;
}
- return !error;
+ return ok;
}
template<typename TA>
diff --git a/ipc/ipc_message_utils_impl.h b/ipc/ipc_message_utils_impl.h
index 98e62c8..f078b2a 100644
--- a/ipc/ipc_message_utils_impl.h
+++ b/ipc/ipc_message_utils_impl.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -12,14 +12,12 @@
namespace IPC {
template <class ParamType>
-MessageWithTuple<ParamType>::MessageWithTuple(
- int32 routing_id, uint32 type, const RefParam& p)
- : Message(routing_id, type, PRIORITY_NORMAL) {
- WriteParam(this, p);
+void MessageSchema<ParamType>::Write(Message* msg, const RefParam& p) {
+ WriteParam(msg, p);
}
template <class ParamType>
-bool MessageWithTuple<ParamType>::Read(const Message* msg, Param* p) {
+bool MessageSchema<ParamType>::Read(const Message* msg, Param* p) {
void* iter = NULL;
if (ReadParam(msg, &iter, p))
return true;
@@ -27,29 +25,22 @@ bool MessageWithTuple<ParamType>::Read(const Message* msg, Param* p) {
return false;
}
-// We can't migrate the template for Log() to MessageWithTuple, because each
-// subclass needs to have Log() to call Read(), which instantiates the above
-// template.
-
template <class SendParamType, class ReplyParamType>
-MessageWithReply<SendParamType, ReplyParamType>::MessageWithReply(
- int32 routing_id, uint32 type,
- const RefSendParam& send,
- const ReplyParam& reply)
- : SyncMessage(routing_id, type, PRIORITY_NORMAL,
- new ParamDeserializer<ReplyParam>(reply)) {
- WriteParam(this, send);
+void SyncMessageSchema<SendParamType, ReplyParamType>::Write(
+ Message* msg,
+ const RefSendParam& send) {
+ WriteParam(msg, send);
}
template <class SendParamType, class ReplyParamType>
-bool MessageWithReply<SendParamType, ReplyParamType>::ReadSendParam(
+bool SyncMessageSchema<SendParamType, ReplyParamType>::ReadSendParam(
const Message* msg, SendParam* p) {
void* iter = SyncMessage::GetDataIterator(msg);
return ReadParam(msg, &iter, p);
}
template <class SendParamType, class ReplyParamType>
-bool MessageWithReply<SendParamType, ReplyParamType>::ReadReplyParam(
+bool SyncMessageSchema<SendParamType, ReplyParamType>::ReadReplyParam(
const Message* msg, typename TupleTypes<ReplyParam>::ValueTuple* p) {
void* iter = SyncMessage::GetDataIterator(msg);
return ReadParam(msg, &iter, p);
diff --git a/ipc/sync_socket_unittest.cc b/ipc/sync_socket_unittest.cc
index 1a4ae13..79cf6c3 100644
--- a/ipc/sync_socket_unittest.cc
+++ b/ipc/sync_socket_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -10,12 +10,7 @@
#include "base/message_loop.h"
#include "base/process_util.h"
-#include "build/build_config.h"
-#include "ipc/ipc_channel.h"
#include "ipc/ipc_channel_proxy.h"
-#include "ipc/ipc_message_macros.h"
-#include "ipc/ipc_message_utils.h"
-#include "ipc/ipc_message_utils_impl.h"
#include "ipc/ipc_tests.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/multiprocess_func_list.h"
@@ -24,74 +19,34 @@
#include "base/file_descriptor_posix.h"
#endif
-enum IPCMessageIds {
- UNUSED_IPC_TYPE,
- SERVER_FIRST_IPC_TYPE, // SetHandle message sent to server.
- SERVER_SECOND_IPC_TYPE, // Shutdown message sent to server.
- CLIENT_FIRST_IPC_TYPE // Response message sent to client.
-};
+// IPC messages for testing ---------------------------------------------------
-namespace {
-const char kHelloString[] = "Hello, SyncSocket Client";
-const size_t kHelloStringLength = arraysize(kHelloString);
-} // namespace
+#define IPC_MESSAGE_IMPL
+#include "ipc/ipc_message_macros.h"
+
+#define IPC_MESSAGE_START TestMsgStart
-// Message class to pass a base::SyncSocket::Handle to another process.
-// This is not as easy as it sounds, because of the differences in transferring
+// Message class to pass a base::SyncSocket::Handle to another process. This
+// is not as easy as it sounds, because of the differences in transferring
// Windows HANDLEs versus posix file descriptors.
#if defined(OS_WIN)
-class MsgClassSetHandle
- : public IPC::MessageWithTuple< Tuple1<base::SyncSocket::Handle> > {
- public:
- enum { ID = SERVER_FIRST_IPC_TYPE };
- explicit MsgClassSetHandle(const base::SyncSocket::Handle arg1)
- : IPC::MessageWithTuple< Tuple1<base::SyncSocket::Handle> >(
- MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1)) {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MsgClassSetHandle);
-};
+IPC_MESSAGE_CONTROL1(MsgClassSetHandle, base::SyncSocket::Handle)
#elif defined(OS_POSIX)
-class MsgClassSetHandle
- : public IPC::MessageWithTuple< Tuple1<base::FileDescriptor> > {
- public:
- enum { ID = SERVER_FIRST_IPC_TYPE };
- explicit MsgClassSetHandle(const base::FileDescriptor& arg1)
- : IPC::MessageWithTuple< Tuple1<base::FileDescriptor> >(
- MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1)) {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MsgClassSetHandle);
-};
-#else
-# error "What platform?"
-#endif // defined(OS_WIN)
+IPC_MESSAGE_CONTROL1(MsgClassSetHandle, base::FileDescriptor)
+#endif
// Message class to pass a response to the server.
-class MsgClassResponse
- : public IPC::MessageWithTuple< Tuple1<std::string> > {
- public:
- enum { ID = CLIENT_FIRST_IPC_TYPE };
- explicit MsgClassResponse(const std::string& arg1)
- : IPC::MessageWithTuple< Tuple1<std::string> >(
- MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1)) {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MsgClassResponse);
-};
+IPC_MESSAGE_CONTROL1(MsgClassResponse, std::string)
// Message class to tell the server to shut down.
-class MsgClassShutdown
- : public IPC::MessageWithTuple< Tuple0 > {
- public:
- enum { ID = SERVER_SECOND_IPC_TYPE };
- MsgClassShutdown()
- : IPC::MessageWithTuple< Tuple0 >(
- MSG_ROUTING_CONTROL, ID, MakeTuple()) {}
+IPC_MESSAGE_CONTROL0(MsgClassShutdown)
- private:
- DISALLOW_COPY_AND_ASSIGN(MsgClassShutdown);
-};
+// ----------------------------------------------------------------------------
+
+namespace {
+const char kHelloString[] = "Hello, SyncSocket Client";
+const size_t kHelloStringLength = arraysize(kHelloString);
+} // namespace
// The SyncSocket server listener class processes two sorts of
// messages from the client.
diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi
index e6c9cea..9f648ec 100644
--- a/webkit/glue/webkit_glue.gypi
+++ b/webkit/glue/webkit_glue.gypi
@@ -104,7 +104,7 @@
'type': 'static_library',
'dependencies': [
'<(DEPTH)/base/base.gyp:base_i18n',
- '<(DEPTH)/base/base.gyp:base_static',
+ '<(DEPTH)/base/base.gyp:base_static',
'<(DEPTH)/gpu/gpu.gyp:gles2_implementation',
'<(DEPTH)/net/net.gyp:net',
'<(DEPTH)/ppapi/ppapi.gyp:ppapi_c',