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 CHROME_COMMON_PEPPER_PLUGIN_REGISTRY_H_ | 5 #ifndef CHROME_COMMON_PEPPER_PLUGIN_REGISTRY_H_ |
6 #define CHROME_COMMON_PEPPER_PLUGIN_REGISTRY_H_ | 6 #define CHROME_COMMON_PEPPER_PLUGIN_REGISTRY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
14 #include "webkit/glue/plugins/pepper_plugin_module.h" | 14 #include "webkit/plugins/ppapi/plugin_module.h" |
15 | 15 |
16 struct PepperPluginInfo { | 16 struct PepperPluginInfo { |
17 PepperPluginInfo(); | 17 PepperPluginInfo(); |
18 ~PepperPluginInfo(); | 18 ~PepperPluginInfo(); |
19 | 19 |
20 // Indicates internal plugins for which there's not actually a library. | 20 // Indicates internal plugins for which there's not actually a library. |
21 // Defaults to false. | 21 // Defaults to false. |
22 bool is_internal; | 22 bool is_internal; |
23 | 23 |
24 // True when this plugin should be run out of process. Defaults to false. | 24 // True when this plugin should be run out of process. Defaults to false. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // access to the plugins before entering the sandbox. | 57 // access to the plugins before entering the sandbox. |
58 static void PreloadModules(); | 58 static void PreloadModules(); |
59 | 59 |
60 // Returns true if the given plugin is a pepper plugin that should be run | 60 // Returns true if the given plugin is a pepper plugin that should be run |
61 // out of process. | 61 // out of process. |
62 bool RunOutOfProcessForPlugin(const FilePath& path) const; | 62 bool RunOutOfProcessForPlugin(const FilePath& path) const; |
63 | 63 |
64 // Returns a preloaded module for the given path. This only works for | 64 // Returns a preloaded module for the given path. This only works for |
65 // non-out-of-process plugins since we preload them so they will run in the | 65 // non-out-of-process plugins since we preload them so they will run in the |
66 // sandbox. Returns NULL if the plugin hasn't been preloaded. | 66 // sandbox. Returns NULL if the plugin hasn't been preloaded. |
67 pepper::PluginModule* GetModule(const FilePath& path) const; | 67 webkit::ppapi::PluginModule* GetModule(const FilePath& path) const; |
68 | 68 |
69 ~PepperPluginRegistry(); | 69 ~PepperPluginRegistry(); |
70 | 70 |
71 private: | 71 private: |
72 static void GetPluginInfoFromSwitch(std::vector<PepperPluginInfo>* plugins); | 72 static void GetPluginInfoFromSwitch(std::vector<PepperPluginInfo>* plugins); |
73 static void GetExtraPlugins(std::vector<PepperPluginInfo>* plugins); | 73 static void GetExtraPlugins(std::vector<PepperPluginInfo>* plugins); |
74 | 74 |
75 struct InternalPluginInfo : public PepperPluginInfo { | 75 struct InternalPluginInfo : public PepperPluginInfo { |
76 InternalPluginInfo(); // Sets |is_internal|. | 76 InternalPluginInfo(); // Sets |is_internal|. |
77 pepper::PluginModule::EntryPoints entry_points; | 77 webkit::ppapi::PluginModule::EntryPoints entry_points; |
78 }; | 78 }; |
79 typedef std::vector<InternalPluginInfo> InternalPluginInfoList; | 79 typedef std::vector<InternalPluginInfo> InternalPluginInfoList; |
80 static void GetInternalPluginInfo(InternalPluginInfoList* plugin_info); | 80 static void GetInternalPluginInfo(InternalPluginInfoList* plugin_info); |
81 | 81 |
82 PepperPluginRegistry(); | 82 PepperPluginRegistry(); |
83 | 83 |
84 typedef scoped_refptr<pepper::PluginModule> ModuleHandle; | 84 typedef scoped_refptr<webkit::ppapi::PluginModule> ModuleHandle; |
85 typedef std::map<FilePath, ModuleHandle> ModuleMap; | 85 typedef std::map<FilePath, ModuleHandle> ModuleMap; |
86 ModuleMap modules_; | 86 ModuleMap modules_; |
87 }; | 87 }; |
88 | 88 |
89 #endif // CHROME_COMMON_PEPPER_PLUGIN_REGISTRY_H_ | 89 #endif // CHROME_COMMON_PEPPER_PLUGIN_REGISTRY_H_ |
OLD | NEW |