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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | |
11 | 10 |
12 #include "webkit/glue/plugins/pepper_plugin_module.h" | 11 #include "webkit/glue/plugins/pepper_plugin_module.h" |
13 | 12 |
14 struct PepperPluginInfo { | 13 struct PepperPluginInfo { |
15 FilePath path; // Internal plugins are of the form "internal-[name]". | 14 FilePath path; |
16 std::vector<std::string> mime_types; | 15 std::vector<std::string> mime_types; |
17 }; | 16 }; |
18 | 17 |
19 // This class holds references to all of the known pepper plugin modules. | 18 // This class holds references to all of the known pepper plugin modules. |
20 class PepperPluginRegistry { | 19 class PepperPluginRegistry { |
21 public: | 20 public: |
22 static PepperPluginRegistry* GetInstance(); | 21 static PepperPluginRegistry* GetInstance(); |
23 | 22 |
24 // Returns the list of known pepper plugins. This method is static so that | 23 // Returns the list of known pepper plugins. This method is static so that |
25 // it can be used by the browser process, which has no need to load the | 24 // it can be used by the browser process, which has no need to load the |
26 // pepper plugin modules. | 25 // pepper plugin modules. |
27 static void GetList(std::vector<PepperPluginInfo>* plugins); | 26 static void GetList(std::vector<PepperPluginInfo>* plugins); |
28 | 27 |
29 pepper::PluginModule* GetModule(const FilePath& path) const; | 28 pepper::PluginModule* GetModule(const FilePath& path) const; |
30 | 29 |
31 private: | 30 private: |
32 static void GetPluginInfoFromSwitch(std::vector<PepperPluginInfo>* plugins); | |
33 | |
34 struct InternalPluginInfo : public PepperPluginInfo { | |
35 pepper::PluginModule::EntryPoints entry_points; | |
36 }; | |
37 typedef std::vector<InternalPluginInfo> InternalPluginInfoList; | |
38 static void GetInternalPluginInfo(InternalPluginInfoList* plugin_info); | |
39 | |
40 PepperPluginRegistry(); | 31 PepperPluginRegistry(); |
41 | 32 |
42 typedef scoped_refptr<pepper::PluginModule> ModuleHandle; | 33 typedef scoped_refptr<pepper::PluginModule> ModuleHandle; |
43 typedef std::map<FilePath, ModuleHandle> ModuleMap; | 34 typedef std::map<FilePath, ModuleHandle> ModuleMap; |
44 ModuleMap modules_; | 35 ModuleMap modules_; |
45 }; | 36 }; |
46 | 37 |
47 #endif // CHROME_COMMON_PEPPER_PLUGIN_REGISTRY_H_ | 38 #endif // CHROME_COMMON_PEPPER_PLUGIN_REGISTRY_H_ |
OLD | NEW |