| 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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 class PluginDispatcher : public Dispatcher { | 32 class PluginDispatcher : public Dispatcher { |
| 33 public: | 33 public: |
| 34 // Constructor for the plugin side. The init and shutdown functions will be | 34 // Constructor for the plugin side. The init and shutdown functions will be |
| 35 // will be automatically called when requested by the renderer side. The | 35 // will be automatically called when requested by the renderer side. The |
| 36 // module ID will be set upon receipt of the InitializeModule message. | 36 // module ID will be set upon receipt of the InitializeModule message. |
| 37 // | 37 // |
| 38 // You must call Dispatcher::InitWithChannel after the constructor. | 38 // You must call Dispatcher::InitWithChannel after the constructor. |
| 39 PluginDispatcher(base::ProcessHandle remote_process_handle, | 39 PluginDispatcher(base::ProcessHandle remote_process_handle, |
| 40 GetInterfaceFunc get_interface); | 40 GetInterfaceFunc get_interface); |
| 41 ~PluginDispatcher(); | 41 virtual ~PluginDispatcher(); |
| 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. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 typedef base::hash_map<PP_Instance, InstanceData> InstanceDataMap; | 94 typedef base::hash_map<PP_Instance, InstanceData> InstanceDataMap; |
| 95 InstanceDataMap instance_map_; | 95 InstanceDataMap instance_map_; |
| 96 | 96 |
| 97 DISALLOW_COPY_AND_ASSIGN(PluginDispatcher); | 97 DISALLOW_COPY_AND_ASSIGN(PluginDispatcher); |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 } // namespace proxy | 100 } // namespace proxy |
| 101 } // namespace pp | 101 } // namespace pp |
| 102 | 102 |
| 103 #endif // PPAPI_PROXY_PLUGIN_DISPATCHER_H_ | 103 #endif // PPAPI_PROXY_PLUGIN_DISPATCHER_H_ |
| OLD | NEW |