summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authortsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-15 19:28:46 +0000
committertsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-15 19:28:46 +0000
commit60f7a30e61fbd87d54755a177b61cc9d9389fb04 (patch)
tree345ca8e154e198f02fd340905d8caa93d79a4e0b /chrome/common
parent2dafda9acd4c494504f0f8cef1cc244c2188c84a (diff)
downloadchromium_src-60f7a30e61fbd87d54755a177b61cc9d9389fb04.zip
chromium_src-60f7a30e61fbd87d54755a177b61cc9d9389fb04.tar.gz
chromium_src-60f7a30e61fbd87d54755a177b61cc9d9389fb04.tar.bz2
Convert service messages to new format, remove internal.h file.
Review URL: http://codereview.chromium.org/6694029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78252 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/common_message_generator.h14
-rw-r--r--chrome/common/service_messages.cc47
-rw-r--r--chrome/common/service_messages.h80
-rw-r--r--chrome/common/service_messages_internal.h64
4 files changed, 65 insertions, 140 deletions
diff --git a/chrome/common/common_message_generator.h b/chrome/common/common_message_generator.h
index af25053..a681f73 100644
--- a/chrome/common/common_message_generator.h
+++ b/chrome/common/common_message_generator.h
@@ -8,18 +8,6 @@
#include "chrome/common/clipboard_messages.h"
#include "chrome/common/indexed_db_messages.h"
#include "chrome/common/safebrowsing_messages.h"
+#include "chrome/common/service_messages.h"
#include "chrome/common/speech_input_messages.h"
#include "chrome/common/utility_messages.h"
-
-#if 0 // This feature is not yet enabled for these files.
-
-#include "chrome/common/automation_messages.h"
-#include "chrome/common/devtools_messages.h"
-#include "chrome/common/dom_storage_messages.h"
-#include "chrome/common/nacl_messages.h"
-#include "chrome/common/pepper_file_messages.h"
-#include "chrome/common/pepper_messages.h"
-#include "chrome/common/render_messages.h"
-#include "chrome/common/service_messages.h"
-
-#endif
diff --git a/chrome/common/service_messages.cc b/chrome/common/service_messages.cc
deleted file mode 100644
index b221881..0000000
--- a/chrome/common/service_messages.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2010 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.
-
-#include "chrome/common/remoting/chromoting_host_info.h"
-#include "ipc/ipc_channel_handle.h"
-
-#define IPC_MESSAGE_IMPL
-#include "chrome/common/service_messages.h"
-
-namespace IPC {
-
-void ParamTraits<remoting::ChromotingHostInfo> ::Write(
- Message* m, const param_type& p) {
- WriteParam(m, p.host_id);
- WriteParam(m, p.hostname);
- WriteParam(m, p.public_key);
- WriteParam(m, p.enabled);
- WriteParam(m, p.login);
-}
-
-bool ParamTraits<remoting::ChromotingHostInfo> ::Read(
- const Message* m, void** iter, param_type* p) {
- bool ret = ReadParam(m, iter, &p->host_id);
- ret = ret && ReadParam(m, iter, &p->hostname);
- ret = ret && ReadParam(m, iter, &p->public_key);
- ret = ret && ReadParam(m, iter, &p->enabled);
- ret = ret && ReadParam(m, iter, &p->login);
- return ret;
-}
-
-void ParamTraits<remoting::ChromotingHostInfo> ::Log(
- const param_type& p, std::string* l) {
- l->append("(");
- LogParam(p.host_id, l);
- l->append(", ");
- LogParam(p.hostname, l);
- l->append(", ");
- LogParam(p.public_key, l);
- l->append(", ");
- LogParam(p.enabled, l);
- l->append(", ");
- LogParam(p.login, l);
- l->append(")");
-}
-
-} // namespace IPC
diff --git a/chrome/common/service_messages.h b/chrome/common/service_messages.h
index 1f8d75e..9d15df4 100644
--- a/chrome/common/service_messages.h
+++ b/chrome/common/service_messages.h
@@ -2,25 +2,73 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_SERVICE_MESSAGES_H_
-#define CHROME_COMMON_SERVICE_MESSAGES_H_
+// Multiply-included message file, no traditional include guard.
+#include <string>
-#include "chrome/common/service_messages_internal.h"
+#include "chrome/common/remoting/chromoting_host_info.h"
+#include "ipc/ipc_channel_handle.h"
+#include "ipc/ipc_message_macros.h"
-namespace remoting {
-struct ChromotingHostInfo;
-} // namespace remoting
+#define IPC_MESSAGE_START ServiceMsgStart
-namespace IPC {
+IPC_STRUCT_TRAITS_BEGIN(remoting::ChromotingHostInfo)
+ IPC_STRUCT_TRAITS_MEMBER(host_id)
+ IPC_STRUCT_TRAITS_MEMBER(hostname)
+ IPC_STRUCT_TRAITS_MEMBER(public_key)
+ IPC_STRUCT_TRAITS_MEMBER(enabled)
+ IPC_STRUCT_TRAITS_MEMBER(login)
+IPC_STRUCT_TRAITS_END()
-template <>
-struct ParamTraits<remoting::ChromotingHostInfo> {
- typedef remoting::ChromotingHostInfo param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* p);
- static void Log(const param_type& p, std::string* l);
-};
+//-----------------------------------------------------------------------------
+// Service process messages:
+// These are messages from the browser to the service process.
+// Tell the service process to enable the cloud proxy passing in the lsid
+// of the account to be used.
+IPC_MESSAGE_CONTROL1(ServiceMsg_EnableCloudPrintProxy,
+ std::string /* lsid */)
+// Tell the service process to enable the cloud proxy passing in specific
+// tokens to be used.
+IPC_MESSAGE_CONTROL2(ServiceMsg_EnableCloudPrintProxyWithTokens,
+ std::string, /* token for cloudprint service */
+ std::string /* token for Google Talk service */)
+// Tell the service process to disable the cloud proxy.
+IPC_MESSAGE_CONTROL0(ServiceMsg_DisableCloudPrintProxy)
-} // namespace IPC
+// Requests a message back on whether the cloud print proxy is
+// enabled.
+IPC_MESSAGE_CONTROL0(ServiceMsg_IsCloudPrintProxyEnabled)
+
+// Set credentials used by the RemotingHost.
+IPC_MESSAGE_CONTROL2(ServiceMsg_SetRemotingHostCredentials,
+ std::string, /* username */
+ std::string /* token for XMPP */)
+
+// Enabled remoting host.
+IPC_MESSAGE_CONTROL0(ServiceMsg_EnableRemotingHost)
+
+// Disable remoting host.
+IPC_MESSAGE_CONTROL0(ServiceMsg_DisableRemotingHost)
+
+// Get remoting host status information.
+IPC_MESSAGE_CONTROL0(ServiceMsg_GetRemotingHostInfo)
+
+// Tell the service process to shutdown.
+IPC_MESSAGE_CONTROL0(ServiceMsg_Shutdown)
+
+// Tell the service process that an update is available.
+IPC_MESSAGE_CONTROL0(ServiceMsg_UpdateAvailable)
+
+//-----------------------------------------------------------------------------
+// Service process host messages:
+// These are messages from the service process to the browser.
+// Sent when the cloud print proxy has an authentication error.
+IPC_MESSAGE_CONTROL0(ServiceHostMsg_CloudPrintProxy_AuthError)
+
+// Sent as a response to a request for enablement status.
+IPC_MESSAGE_CONTROL2(ServiceHostMsg_CloudPrintProxy_IsEnabled,
+ bool, /* Is the proxy enabled? */
+ std::string /* Email address of account */)
+
+IPC_MESSAGE_CONTROL1(ServiceHostMsg_RemotingHost_HostInfo,
+ remoting::ChromotingHostInfo /* host_info */)
-#endif // CHROME_COMMON_SERVICE_MESSAGES_H_
diff --git a/chrome/common/service_messages_internal.h b/chrome/common/service_messages_internal.h
deleted file mode 100644
index 5c35def..0000000
--- a/chrome/common/service_messages_internal.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) 2010 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.
-
-#include <string>
-
-#include "ipc/ipc_message_macros.h"
-
-#include "chrome/common/remoting/chromoting_host_info.h"
-
-#define IPC_MESSAGE_START ServiceMsgStart
-
-//------------------------------------------------------------------------------
-// Service process messages:
-// These are messages from the browser to the service process.
-// Tell the service process to enable the cloud proxy passing in the lsid
-// of the account to be used.
-IPC_MESSAGE_CONTROL1(ServiceMsg_EnableCloudPrintProxy,
- std::string /* lsid */)
-// Tell the service process to enable the cloud proxy passing in specific
-// tokens to be used.
-IPC_MESSAGE_CONTROL2(ServiceMsg_EnableCloudPrintProxyWithTokens,
- std::string, /* token for cloudprint service */
- std::string /* token for Google Talk service */)
-// Tell the service process to disable the cloud proxy.
-IPC_MESSAGE_CONTROL0(ServiceMsg_DisableCloudPrintProxy)
-
-// Requests a message back on whether the cloud print proxy is
-// enabled.
-IPC_MESSAGE_CONTROL0(ServiceMsg_IsCloudPrintProxyEnabled)
-
-// Set credentials used by the RemotingHost.
-IPC_MESSAGE_CONTROL2(ServiceMsg_SetRemotingHostCredentials,
- std::string, /* username */
- std::string /* token for XMPP */)
-
-// Enabled remoting host.
-IPC_MESSAGE_CONTROL0(ServiceMsg_EnableRemotingHost)
-
-// Disable remoting host.
-IPC_MESSAGE_CONTROL0(ServiceMsg_DisableRemotingHost)
-
-// Get remoting host status information.
-IPC_MESSAGE_CONTROL0(ServiceMsg_GetRemotingHostInfo)
-
-// Tell the service process to shutdown.
-IPC_MESSAGE_CONTROL0(ServiceMsg_Shutdown)
-
-// Tell the service process that an update is available.
-IPC_MESSAGE_CONTROL0(ServiceMsg_UpdateAvailable)
-
-//------------------------------------------------------------------------------
-// Service process host messages:
-// These are messages from the service process to the browser.
-// Sent when the cloud print proxy has an authentication error.
-IPC_MESSAGE_CONTROL0(ServiceHostMsg_CloudPrintProxy_AuthError)
-
-// Sent as a response to a request for enablement status.
-IPC_MESSAGE_CONTROL2(ServiceHostMsg_CloudPrintProxy_IsEnabled,
- bool, /* Is the proxy enabled? */
- std::string /* Email address of account */)
-
-IPC_MESSAGE_CONTROL1(ServiceHostMsg_RemotingHost_HostInfo,
- remoting::ChromotingHostInfo /* host_info */)