| 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 CONTENT_COMMON_PEPPER_PLUGIN_REGISTRY_H_ | 5 #ifndef CONTENT_COMMON_PEPPER_PLUGIN_REGISTRY_H_ |
| 6 #define CONTENT_COMMON_PEPPER_PLUGIN_REGISTRY_H_ | 6 #define CONTENT_COMMON_PEPPER_PLUGIN_REGISTRY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
| 15 #include "content/common/content_export.h" |
| 15 #include "ppapi/proxy/proxy_channel.h" | 16 #include "ppapi/proxy/proxy_channel.h" |
| 16 #include "webkit/plugins/ppapi/plugin_delegate.h" | 17 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| 17 #include "webkit/plugins/ppapi/plugin_module.h" | 18 #include "webkit/plugins/ppapi/plugin_module.h" |
| 18 #include "webkit/plugins/webplugininfo.h" | 19 #include "webkit/plugins/webplugininfo.h" |
| 19 | 20 |
| 20 struct PepperPluginInfo { | 21 struct CONTENT_EXPORT PepperPluginInfo { |
| 21 PepperPluginInfo(); | 22 PepperPluginInfo(); |
| 22 ~PepperPluginInfo(); | 23 ~PepperPluginInfo(); |
| 23 | 24 |
| 24 webkit::WebPluginInfo ToWebPluginInfo() const; | 25 webkit::WebPluginInfo ToWebPluginInfo() const; |
| 25 | 26 |
| 26 // Indicates internal plugins for which there's not actually a library. | 27 // Indicates internal plugins for which there's not actually a library. |
| 27 // These plugins are implemented in the Chrome binary using a separate set | 28 // These plugins are implemented in the Chrome binary using a separate set |
| 28 // of entry points (see internal_entry_points below). | 29 // of entry points (see internal_entry_points below). |
| 29 // Defaults to false. | 30 // Defaults to false. |
| 30 bool is_internal; | 31 bool is_internal; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 ~PepperPluginRegistry(); | 65 ~PepperPluginRegistry(); |
| 65 | 66 |
| 66 static PepperPluginRegistry* GetInstance(); | 67 static PepperPluginRegistry* GetInstance(); |
| 67 | 68 |
| 68 // Computes the list of known pepper plugins. | 69 // Computes the list of known pepper plugins. |
| 69 // | 70 // |
| 70 // This method is static so that it can be used by the browser process, which | 71 // This method is static so that it can be used by the browser process, which |
| 71 // has no need to load the pepper plugin modules. It will re-compute the | 72 // has no need to load the pepper plugin modules. It will re-compute the |
| 72 // plugin list every time it is called. Generally, code in the registry should | 73 // plugin list every time it is called. Generally, code in the registry should |
| 73 // be using the cached plugin_list_ instead. | 74 // be using the cached plugin_list_ instead. |
| 74 static void ComputeList(std::vector<PepperPluginInfo>* plugins); | 75 CONTENT_EXPORT static void ComputeList( |
| 76 std::vector<PepperPluginInfo>* plugins); |
| 75 | 77 |
| 76 // Loads the (native) libraries but does not initialize them (i.e., does not | 78 // Loads the (native) libraries but does not initialize them (i.e., does not |
| 77 // call PPP_InitializeModule). This is needed by the zygote on Linux to get | 79 // call PPP_InitializeModule). This is needed by the zygote on Linux to get |
| 78 // access to the plugins before entering the sandbox. | 80 // access to the plugins before entering the sandbox. |
| 79 static void PreloadModules(); | 81 static void PreloadModules(); |
| 80 | 82 |
| 81 // Retrieves the information associated with the given plugin info. The | 83 // Retrieves the information associated with the given plugin info. The |
| 82 // return value will be NULL if there is no such plugin. | 84 // return value will be NULL if there is no such plugin. |
| 83 // | 85 // |
| 84 // The returned pointer is owned by the PluginRegistry. | 86 // The returned pointer is owned by the PluginRegistry. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // non-crashed modules. If an out-of-process module crashes, it may | 124 // non-crashed modules. If an out-of-process module crashes, it may |
| 123 // continue as long as there are WebKit references to it, but it will not | 125 // continue as long as there are WebKit references to it, but it will not |
| 124 // appear in this list. | 126 // appear in this list. |
| 125 typedef std::map<FilePath, webkit::ppapi::PluginModule*> NonOwningModuleMap; | 127 typedef std::map<FilePath, webkit::ppapi::PluginModule*> NonOwningModuleMap; |
| 126 NonOwningModuleMap live_modules_; | 128 NonOwningModuleMap live_modules_; |
| 127 | 129 |
| 128 DISALLOW_COPY_AND_ASSIGN(PepperPluginRegistry); | 130 DISALLOW_COPY_AND_ASSIGN(PepperPluginRegistry); |
| 129 }; | 131 }; |
| 130 | 132 |
| 131 #endif // CONTENT_COMMON_PEPPER_PLUGIN_REGISTRY_H_ | 133 #endif // CONTENT_COMMON_PEPPER_PLUGIN_REGISTRY_H_ |
| OLD | NEW |