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/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // The plugin side maintains a mapping from PP_Instance to Dispatcher so | 81 // The plugin side maintains a mapping from PP_Instance to Dispatcher so |
82 // that we can send the messages to the right channel if there are multiple | 82 // that we can send the messages to the right channel if there are multiple |
83 // renderers sharing the same plugin. This mapping is maintained by | 83 // renderers sharing the same plugin. This mapping is maintained by |
84 // DidCreateInstance/DidDestroyInstance. | 84 // DidCreateInstance/DidDestroyInstance. |
85 static PluginDispatcher* GetForInstance(PP_Instance instance); | 85 static PluginDispatcher* GetForInstance(PP_Instance instance); |
86 | 86 |
87 // Same as GetForInstance but retrieves the instance from the given resource | 87 // Same as GetForInstance but retrieves the instance from the given resource |
88 // object as a convenience. Returns NULL on failure. | 88 // object as a convenience. Returns NULL on failure. |
89 static PluginDispatcher* GetForResource(const Resource* resource); | 89 static PluginDispatcher* GetForResource(const Resource* resource); |
90 | 90 |
91 static const void* GetInterfaceFromDispatcher(const char* interface); | 91 static const void* GetInterfaceFromDispatcher( |
| 92 const char* dispatcher_interface); |
92 | 93 |
93 // You must call this function before anything else. Returns true on success. | 94 // You must call this function before anything else. Returns true on success. |
94 // The delegate pointer must outlive this class, ownership is not | 95 // The delegate pointer must outlive this class, ownership is not |
95 // transferred. | 96 // transferred. |
96 bool InitPluginWithChannel(PluginDelegate* delegate, | 97 bool InitPluginWithChannel(PluginDelegate* delegate, |
97 const IPC::ChannelHandle& channel_handle, | 98 const IPC::ChannelHandle& channel_handle, |
98 bool is_client); | 99 bool is_client); |
99 | 100 |
100 // Dispatcher overrides. | 101 // Dispatcher overrides. |
101 virtual bool IsPlugin() const; | 102 virtual bool IsPlugin() const; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 168 |
168 uint32 plugin_dispatcher_id_; | 169 uint32 plugin_dispatcher_id_; |
169 | 170 |
170 DISALLOW_COPY_AND_ASSIGN(PluginDispatcher); | 171 DISALLOW_COPY_AND_ASSIGN(PluginDispatcher); |
171 }; | 172 }; |
172 | 173 |
173 } // namespace proxy | 174 } // namespace proxy |
174 } // namespace ppapi | 175 } // namespace ppapi |
175 | 176 |
176 #endif // PPAPI_PROXY_PLUGIN_DISPATCHER_H_ | 177 #endif // PPAPI_PROXY_PLUGIN_DISPATCHER_H_ |
OLD | NEW |