summaryrefslogtreecommitdiffstats
path: root/content/common/p2p_messages.h
blob: 36935af83a58f8723bb19b596568f21fe9f2dd04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// 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.
// Multiply-included message file, hence no include guard.

#include "content/common/p2p_sockets.h"
#include "ipc/ipc_message_macros.h"
#include "net/base/ip_endpoint.h"

#define IPC_MESSAGE_START P2PMsgStart

IPC_ENUM_TRAITS(P2PSocketType)

// P2P Socket messages sent from the browser to the renderer.

IPC_MESSAGE_ROUTED2(P2PMsg_OnSocketCreated,
                    int /* socket_id */,
                    net::IPEndPoint /* socket_address */)

IPC_MESSAGE_ROUTED1(P2PMsg_OnError,
                    int /* socket_id */)

IPC_MESSAGE_ROUTED3(P2PMsg_OnDataReceived,
                    int /* socket_id */,
                    net::IPEndPoint /* socket_address */,
                    std::vector<char> /* data */)

// P2P Socket messages sent from the renderer to the browser.

IPC_MESSAGE_ROUTED3(P2PHostMsg_CreateSocket,
                    P2PSocketType /* type */,
                    int /* socket_id */,
                    net::IPEndPoint /* remote_address */)

// TODO(sergeyu): Use shared memory to pass the data.
IPC_MESSAGE_ROUTED3(P2PHostMsg_Send,
                    int /* socket_id */,
                    net::IPEndPoint /* socket_address */,
                    std::vector<char> /* data */)

IPC_MESSAGE_ROUTED1(P2PHostMsg_DestroySocket,
                    int /* socket_id */)