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 WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_MODULE_H_ | 5 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_MODULE_H_ |
6 #define WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_MODULE_H_ | 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_MODULE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/native_library.h" | 12 #include "base/native_library.h" |
| 13 #include "base/process.h" |
13 #include "base/ref_counted.h" | 14 #include "base/ref_counted.h" |
14 #include "base/scoped_ptr.h" | 15 #include "base/scoped_ptr.h" |
15 #include "base/weak_ptr.h" | 16 #include "base/weak_ptr.h" |
16 #include "ppapi/c/pp_module.h" | 17 #include "ppapi/c/pp_module.h" |
17 #include "ppapi/c/ppb.h" | 18 #include "ppapi/c/ppb.h" |
18 | 19 |
19 class FilePath; | 20 class FilePath; |
20 class MessageLoop; | 21 class MessageLoop; |
21 typedef struct NPObject NPObject; | 22 typedef struct NPObject NPObject; |
22 struct PPB_Core; | 23 struct PPB_Core; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 PPP_ShutdownModuleFunc shutdown_module; | 68 PPP_ShutdownModuleFunc shutdown_module; |
68 }; | 69 }; |
69 | 70 |
70 ~PluginModule(); | 71 ~PluginModule(); |
71 | 72 |
72 static scoped_refptr<PluginModule> CreateModule(const FilePath& path); | 73 static scoped_refptr<PluginModule> CreateModule(const FilePath& path); |
73 static scoped_refptr<PluginModule> CreateInternalModule( | 74 static scoped_refptr<PluginModule> CreateInternalModule( |
74 EntryPoints entry_points); | 75 EntryPoints entry_points); |
75 static scoped_refptr<PluginModule> CreateOutOfProcessModule( | 76 static scoped_refptr<PluginModule> CreateOutOfProcessModule( |
76 MessageLoop* ipc_message_loop, | 77 MessageLoop* ipc_message_loop, |
| 78 base::ProcessHandle plugin_process_handle, |
77 const IPC::ChannelHandle& handle, | 79 const IPC::ChannelHandle& handle, |
78 base::WaitableEvent* shutdown_event); | 80 base::WaitableEvent* shutdown_event); |
79 | 81 |
80 static const PPB_Core* GetCore(); | 82 static const PPB_Core* GetCore(); |
81 | 83 |
82 PP_Module pp_module() const { return pp_module_; } | 84 PP_Module pp_module() const { return pp_module_; } |
83 | 85 |
84 void set_name(const std::string& name) { name_ = name; } | 86 void set_name(const std::string& name) { name_ = name; } |
85 const std::string& name() const { return name_; } | 87 const std::string& name() const { return name_; } |
86 | 88 |
(...skipping 28 matching lines...) Expand all Loading... |
115 // Tracks all live PluginObjects. | 117 // Tracks all live PluginObjects. |
116 void AddPluginObject(PluginObject* plugin_object); | 118 void AddPluginObject(PluginObject* plugin_object); |
117 void RemovePluginObject(PluginObject* plugin_object); | 119 void RemovePluginObject(PluginObject* plugin_object); |
118 | 120 |
119 private: | 121 private: |
120 PluginModule(); | 122 PluginModule(); |
121 | 123 |
122 bool InitFromEntryPoints(const EntryPoints& entry_points); | 124 bool InitFromEntryPoints(const EntryPoints& entry_points); |
123 bool InitFromFile(const FilePath& path); | 125 bool InitFromFile(const FilePath& path); |
124 bool InitForOutOfProcess(MessageLoop* ipc_message_loop, | 126 bool InitForOutOfProcess(MessageLoop* ipc_message_loop, |
| 127 base::ProcessHandle remote_process, |
125 const IPC::ChannelHandle& handle, | 128 const IPC::ChannelHandle& handle, |
126 base::WaitableEvent* shutdown_event); | 129 base::WaitableEvent* shutdown_event); |
127 static bool LoadEntryPoints(const base::NativeLibrary& library, | 130 static bool LoadEntryPoints(const base::NativeLibrary& library, |
128 EntryPoints* entry_points); | 131 EntryPoints* entry_points); |
129 | 132 |
130 // Dispatcher for out-of-process plugins. This will be null when the plugin | 133 // Dispatcher for out-of-process plugins. This will be null when the plugin |
131 // is being run in-process. | 134 // is being run in-process. |
132 scoped_ptr<pp::proxy::HostDispatcher> dispatcher_; | 135 scoped_ptr<pp::proxy::HostDispatcher> dispatcher_; |
133 | 136 |
134 PP_Module pp_module_; | 137 PP_Module pp_module_; |
(...skipping 25 matching lines...) Expand all Loading... |
160 | 163 |
161 typedef std::set<PluginObject*> PluginObjectSet; | 164 typedef std::set<PluginObject*> PluginObjectSet; |
162 PluginObjectSet live_plugin_objects_; | 165 PluginObjectSet live_plugin_objects_; |
163 | 166 |
164 DISALLOW_COPY_AND_ASSIGN(PluginModule); | 167 DISALLOW_COPY_AND_ASSIGN(PluginModule); |
165 }; | 168 }; |
166 | 169 |
167 } // namespace pepper | 170 } // namespace pepper |
168 | 171 |
169 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_MODULE_H_ | 172 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_MODULE_H_ |
OLD | NEW |