Chromium Code Reviews| Index: content/common/p2p_messages.h |
| diff --git a/content/common/p2p_messages.h b/content/common/p2p_messages.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a5e5b33f247a9bba3a8d8b261d0590fdc844291a |
| --- /dev/null |
| +++ b/content/common/p2p_messages.h |
| @@ -0,0 +1,58 @@ |
| +// 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. |
| + |
| +// IPC messages for the P2P Transport API. |
| + |
| +#ifndef CONTENT_COMMON_P2P_MESSAGES_H_ |
| +#define CONTENT_COMMON_P2P_MESSAGES_H_ |
| + |
| +#include "content/common/p2p_sockets.h" |
| +#include "ipc/ipc_message_macros.h" |
| + |
| +#define IPC_MESSAGE_START P2PMsgStart |
| + |
| +IPC_MESSAGE_ROUTED2(P2PMsg_OnSocketCreated, |
|
jam
2011/03/02 00:39:24
nit: please add comments like the other ipc messag
Sergey Ulanov
2011/03/02 11:00:47
Done.
|
| + int /* socket_id */, |
| + P2PSocketAddress /* socket_address */) |
| + |
| +IPC_MESSAGE_ROUTED1(P2PMsg_OnError, |
| + int /* socket_id */) |
| + |
| +IPC_MESSAGE_ROUTED3(P2PMsg_OnDataReceived, |
| + int /* socket_id */, |
| + P2PSocketAddress /* socket_address */, |
| + std::vector<char> /* data */) |
| + |
| +IPC_MESSAGE_ROUTED3(P2PHostMsg_CreateSocket, |
| + P2PSocketType /* type */, |
| + int /* socket_id */, |
| + P2PSocketAddress /* remote_address */) |
| + |
| +// TODO(sergeyu): Use shared memory to pass the data. |
| +IPC_MESSAGE_ROUTED3(P2PHostMsg_Send, |
| + int /* socket_id */, |
| + P2PSocketAddress /* socket_address */, |
| + std::vector<char> /* data */) |
| + |
| +IPC_MESSAGE_ROUTED1(P2PHostMsg_DestroySocket, |
| + int /* socket_id */) |
| + |
| +namespace IPC { |
| + |
| +template <> |
| +struct ParamTraits<P2PSocketAddress> { |
| + typedef P2PSocketAddress 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); |
| +}; |
| + |
| +template <> |
| +struct SimilarTypeTraits<P2PSocketType> { |
| + typedef int Type; |
| +}; |
| + |
| +} // namespace IPC |
| + |
| +#endif // CONTENT_COMMON_P2P_MESSAGES_H_ |