blob: cc8255cd7ad4a037bb62a680d9a06f3843043289 [file] [log] [blame]
[email protected]93df81e2012-08-10 22:22:461// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef PPAPI_PROXY_CONNECTION_H_
6#define PPAPI_PROXY_CONNECTION_H_
7
[email protected]8dd2d2c2013-07-23 21:19:318#include "ipc/ipc_message.h"
9
[email protected]93df81e2012-08-10 22:22:4610namespace IPC {
11class Sender;
12}
13
14namespace ppapi {
15namespace proxy {
16
17// This struct holds the channels that a resource uses to send message to the
18// browser and renderer.
19struct Connection {
[email protected]8dd2d2c2013-07-23 21:19:3120 Connection() : browser_sender(0),
21 renderer_sender(0),
22 in_process(false),
23 browser_sender_routing_id(MSG_ROUTING_NONE) {
[email protected]93df81e2012-08-10 22:22:4624 }
25 Connection(IPC::Sender* browser, IPC::Sender* renderer)
26 : browser_sender(browser),
[email protected]8dd2d2c2013-07-23 21:19:3127 renderer_sender(renderer),
28 in_process(false),
29 browser_sender_routing_id(MSG_ROUTING_NONE) {
30 }
31 Connection(IPC::Sender* browser, IPC::Sender* renderer, int routing_id)
32 : browser_sender(browser),
33 renderer_sender(renderer),
34 in_process(true),
35 browser_sender_routing_id(routing_id) {
[email protected]93df81e2012-08-10 22:22:4636 }
37
38 IPC::Sender* browser_sender;
39 IPC::Sender* renderer_sender;
[email protected]8dd2d2c2013-07-23 21:19:3140 bool in_process;
41 // We need to use a routing ID when a plugin is in-process, and messages are
42 // sent back from the browser to the renderer. This is so that messages are
[email protected]fb44cb0a2013-12-04 00:45:5543 // routed to the proper RenderFrameImpl.
[email protected]8dd2d2c2013-07-23 21:19:3144 int browser_sender_routing_id;
[email protected]93df81e2012-08-10 22:22:4645};
46
47} // namespace proxy
48} // namespace ppapi
49
50
51#endif // PPAPI_PROXY_CONNECTION_H_
52