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 27 matching lines...) Expand all Loading... |
52 // access to the plugins before entering the sandbox. | 52 // access to the plugins before entering the sandbox. |
53 static void PreloadModules(); | 53 static void PreloadModules(); |
54 | 54 |
55 // Returns true if the given plugin is a pepper plugin that should be run | 55 // Returns true if the given plugin is a pepper plugin that should be run |
56 // out of process. | 56 // out of process. |
57 bool RunOutOfProcessForPlugin(const FilePath& path) const; | 57 bool RunOutOfProcessForPlugin(const FilePath& path) const; |
58 | 58 |
59 // Returns a preloaded module for the given path. This only works for | 59 // Returns a preloaded module for the given path. This only works for |
60 // non-out-of-process plugins since we preload them so they will run in the | 60 // non-out-of-process plugins since we preload them so they will run in the |
61 // sandbox. Returns NULL if the plugin hasn't been preloaded. | 61 // sandbox. Returns NULL if the plugin hasn't been preloaded. |
62 pepper::PluginModule* GetModule(const FilePath& path) const; | 62 webkit::plugins::ppapi::PluginModule* GetModule(const FilePath& path) const; |
63 | 63 |
64 ~PepperPluginRegistry(); | 64 ~PepperPluginRegistry(); |
65 | 65 |
66 private: | 66 private: |
67 static void GetPluginInfoFromSwitch(std::vector<PepperPluginInfo>* plugins); | 67 static void GetPluginInfoFromSwitch(std::vector<PepperPluginInfo>* plugins); |
68 static void GetExtraPlugins(std::vector<PepperPluginInfo>* plugins); | 68 static void GetExtraPlugins(std::vector<PepperPluginInfo>* plugins); |
69 | 69 |
70 struct InternalPluginInfo : public PepperPluginInfo { | 70 struct InternalPluginInfo : public PepperPluginInfo { |
71 InternalPluginInfo(); // Sets |is_internal|. | 71 InternalPluginInfo(); // Sets |is_internal|. |
72 pepper::PluginModule::EntryPoints entry_points; | 72 webkit::plugins::ppapi::PluginModule::EntryPoints entry_points; |
73 }; | 73 }; |
74 typedef std::vector<InternalPluginInfo> InternalPluginInfoList; | 74 typedef std::vector<InternalPluginInfo> InternalPluginInfoList; |
75 static void GetInternalPluginInfo(InternalPluginInfoList* plugin_info); | 75 static void GetInternalPluginInfo(InternalPluginInfoList* plugin_info); |
76 | 76 |
77 PepperPluginRegistry(); | 77 PepperPluginRegistry(); |
78 | 78 |
79 typedef scoped_refptr<pepper::PluginModule> ModuleHandle; | 79 typedef scoped_refptr<webkit::plugins::ppapi::PluginModule> ModuleHandle; |
80 typedef std::map<FilePath, ModuleHandle> ModuleMap; | 80 typedef std::map<FilePath, ModuleHandle> ModuleMap; |
81 ModuleMap modules_; | 81 ModuleMap modules_; |
82 }; | 82 }; |
83 | 83 |
84 #endif // CHROME_COMMON_PEPPER_PLUGIN_REGISTRY_H_ | 84 #endif // CHROME_COMMON_PEPPER_PLUGIN_REGISTRY_H_ |
OLD | NEW |