| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // 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 | 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // Each call to Register() has to be matched with a call to Unregister(). | 63 // Each call to Register() has to be matched with a call to Unregister(). |
| 64 virtual uint32 Register(PluginDispatcher* plugin_dispatcher) = 0; | 64 virtual uint32 Register(PluginDispatcher* plugin_dispatcher) = 0; |
| 65 virtual void Unregister(uint32 plugin_dispatcher_id) = 0; | 65 virtual void Unregister(uint32 plugin_dispatcher_id) = 0; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 // Constructor for the plugin side. The init and shutdown functions will be | 68 // Constructor for the plugin side. The init and shutdown functions will be |
| 69 // will be automatically called when requested by the renderer side. The | 69 // will be automatically called when requested by the renderer side. The |
| 70 // module ID will be set upon receipt of the InitializeModule message. | 70 // module ID will be set upon receipt of the InitializeModule message. |
| 71 // | 71 // |
| 72 // You must call InitPluginWithChannel after the constructor. | 72 // You must call InitPluginWithChannel after the constructor. |
| 73 PluginDispatcher(base::ProcessHandle remote_process_handle, | 73 PluginDispatcher(PP_GetInterface_Func get_interface, |
| 74 PP_GetInterface_Func get_interface, | |
| 75 bool incognito); | 74 bool incognito); |
| 76 virtual ~PluginDispatcher(); | 75 virtual ~PluginDispatcher(); |
| 77 | 76 |
| 78 // The plugin side maintains a mapping from PP_Instance to Dispatcher so | 77 // The plugin side maintains a mapping from PP_Instance to Dispatcher so |
| 79 // that we can send the messages to the right channel if there are multiple | 78 // that we can send the messages to the right channel if there are multiple |
| 80 // renderers sharing the same plugin. This mapping is maintained by | 79 // renderers sharing the same plugin. This mapping is maintained by |
| 81 // DidCreateInstance/DidDestroyInstance. | 80 // DidCreateInstance/DidDestroyInstance. |
| 82 static PluginDispatcher* GetForInstance(PP_Instance instance); | 81 static PluginDispatcher* GetForInstance(PP_Instance instance); |
| 83 | 82 |
| 84 // Same as GetForInstance but retrieves the instance from the given resource | 83 // Same as GetForInstance but retrieves the instance from the given resource |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // incognito mode. | 167 // incognito mode. |
| 169 bool incognito_; | 168 bool incognito_; |
| 170 | 169 |
| 171 DISALLOW_COPY_AND_ASSIGN(PluginDispatcher); | 170 DISALLOW_COPY_AND_ASSIGN(PluginDispatcher); |
| 172 }; | 171 }; |
| 173 | 172 |
| 174 } // namespace proxy | 173 } // namespace proxy |
| 175 } // namespace ppapi | 174 } // namespace ppapi |
| 176 | 175 |
| 177 #endif // PPAPI_PROXY_PLUGIN_DISPATCHER_H_ | 176 #endif // PPAPI_PROXY_PLUGIN_DISPATCHER_H_ |
| OLD | NEW |