OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PLUGIN_DISPATCHER_H_ | 5 #ifndef PPAPI_PROXY_PLUGIN_DISPATCHER_H_ |
6 #define PPAPI_PROXY_PLUGIN_DISPATCHER_H_ | 6 #define PPAPI_PROXY_PLUGIN_DISPATCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 // The plugin side maintains a mapping from PP_Instance to Dispatcher so | 43 // The plugin side maintains a mapping from PP_Instance to Dispatcher so |
44 // that we can send the messages to the right channel if there are multiple | 44 // that we can send the messages to the right channel if there are multiple |
45 // renderers sharing the same plugin. This mapping is maintained by | 45 // renderers sharing the same plugin. This mapping is maintained by |
46 // DidCreateInstance/DidDestroyInstance. | 46 // DidCreateInstance/DidDestroyInstance. |
47 static PluginDispatcher* GetForInstance(PP_Instance instance); | 47 static PluginDispatcher* GetForInstance(PP_Instance instance); |
48 | 48 |
49 static const void* GetInterfaceFromDispatcher(const char* interface); | 49 static const void* GetInterfaceFromDispatcher(const char* interface); |
50 | 50 |
51 // Dispatcher overrides. | 51 // Dispatcher overrides. |
| 52 virtual bool InitWithChannel(Delegate* delegate, |
| 53 const IPC::ChannelHandle& channel_handle, |
| 54 bool is_client); |
52 virtual bool IsPlugin() const; | 55 virtual bool IsPlugin() const; |
53 | 56 |
54 // IPC::Channel::Listener implementation. | 57 // IPC::Channel::Listener implementation. |
55 virtual bool OnMessageReceived(const IPC::Message& msg); | 58 virtual bool OnMessageReceived(const IPC::Message& msg); |
56 virtual void OnChannelError(); | 59 virtual void OnChannelError(); |
57 | 60 |
58 // Keeps track of which dispatcher to use for each instance, active instances | 61 // Keeps track of which dispatcher to use for each instance, active instances |
59 // and tracks associated data like the current size. | 62 // and tracks associated data like the current size. |
60 void DidCreateInstance(PP_Instance instance); | 63 void DidCreateInstance(PP_Instance instance); |
61 void DidDestroyInstance(PP_Instance instance); | 64 void DidDestroyInstance(PP_Instance instance); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 typedef base::hash_map<PP_Instance, InstanceData> InstanceDataMap; | 97 typedef base::hash_map<PP_Instance, InstanceData> InstanceDataMap; |
95 InstanceDataMap instance_map_; | 98 InstanceDataMap instance_map_; |
96 | 99 |
97 DISALLOW_COPY_AND_ASSIGN(PluginDispatcher); | 100 DISALLOW_COPY_AND_ASSIGN(PluginDispatcher); |
98 }; | 101 }; |
99 | 102 |
100 } // namespace proxy | 103 } // namespace proxy |
101 } // namespace pp | 104 } // namespace pp |
102 | 105 |
103 #endif // PPAPI_PROXY_PLUGIN_DISPATCHER_H_ | 106 #endif // PPAPI_PROXY_PLUGIN_DISPATCHER_H_ |
OLD | NEW |