OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PPAPI_PROXY_HOST_DISPATCHER_H_ | 5 #ifndef PPAPI_PROXY_HOST_DISPATCHER_H_ |
6 #define PPAPI_PROXY_HOST_DISPATCHER_H_ | 6 #define PPAPI_PROXY_HOST_DISPATCHER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
| 12 #include "base/process.h" |
12 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
13 #include "ppapi/c/pp_instance.h" | 14 #include "ppapi/c/pp_instance.h" |
14 #include "ppapi/proxy/dispatcher.h" | 15 #include "ppapi/proxy/dispatcher.h" |
15 #include "ppapi/proxy/plugin_resource_tracker.h" | 16 #include "ppapi/proxy/plugin_resource_tracker.h" |
16 #include "ppapi/proxy/plugin_var_tracker.h" | 17 #include "ppapi/proxy/plugin_var_tracker.h" |
17 | 18 |
18 struct PPB_Var_Deprecated; | 19 struct PPB_Var_Deprecated; |
19 | 20 |
20 namespace base { | 21 namespace base { |
21 class WaitableEvent; | 22 class WaitableEvent; |
22 } | 23 } |
23 | 24 |
24 namespace IPC { | 25 namespace IPC { |
25 class SyncChannel; | 26 class SyncChannel; |
26 } | 27 } |
27 | 28 |
28 namespace pp { | 29 namespace pp { |
29 namespace proxy { | 30 namespace proxy { |
30 | 31 |
31 class InterfaceProxy; | 32 class InterfaceProxy; |
32 class VarSerialization; | 33 class VarSerialization; |
33 | 34 |
34 class HostDispatcher : public Dispatcher { | 35 class HostDispatcher : public Dispatcher { |
35 public: | 36 public: |
36 // Constructor for the renderer side. | 37 // Constructor for the renderer side. |
37 // | 38 // |
38 // You must call Dispatcher::InitWithChannel after the constructor. | 39 // You must call Dispatcher::InitWithChannel after the constructor. |
39 HostDispatcher(const PPB_Var_Deprecated* var_interface, | 40 HostDispatcher(base::ProcessHandle host_process_handle, |
| 41 const PPB_Var_Deprecated* var_interface, |
40 PP_Module module, | 42 PP_Module module, |
41 GetInterfaceFunc local_get_interface); | 43 GetInterfaceFunc local_get_interface); |
42 ~HostDispatcher(); | 44 ~HostDispatcher(); |
43 | 45 |
44 // The host side maintains a mapping from PP_Instance to Dispatcher so | 46 // The host side maintains a mapping from PP_Instance to Dispatcher so |
45 // that we can send the messages to the right channel. | 47 // that we can send the messages to the right channel. |
46 static HostDispatcher* GetForInstance(PP_Instance instance); | 48 static HostDispatcher* GetForInstance(PP_Instance instance); |
47 static void SetForInstance(PP_Instance instance, | 49 static void SetForInstance(PP_Instance instance, |
48 HostDispatcher* dispatcher); | 50 HostDispatcher* dispatcher); |
49 static void RemoveForInstance(PP_Instance instance); | 51 static void RemoveForInstance(PP_Instance instance); |
50 | 52 |
51 // Dispatcher overrides. | 53 // Dispatcher overrides. |
52 virtual bool IsPlugin() const { return false; } | 54 virtual bool IsPlugin() const { return false; } |
53 | 55 |
54 private: | 56 private: |
55 DISALLOW_COPY_AND_ASSIGN(HostDispatcher); | 57 DISALLOW_COPY_AND_ASSIGN(HostDispatcher); |
56 }; | 58 }; |
57 | 59 |
58 } // namespace proxy | 60 } // namespace proxy |
59 } // namespace pp | 61 } // namespace pp |
60 | 62 |
61 #endif // PPAPI_PROXY_HOST_DISPATCHER_H_ | 63 #endif // PPAPI_PROXY_HOST_DISPATCHER_H_ |
OLD | NEW |