| 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> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // loaded. | 57 // loaded. |
| 58 webkit::ppapi::PluginModule* GetLiveModule(const FilePath& path); | 58 webkit::ppapi::PluginModule* GetLiveModule(const FilePath& path); |
| 59 | 59 |
| 60 // Notifies the registry that a new non-preloaded module has been created. | 60 // Notifies the registry that a new non-preloaded module has been created. |
| 61 // This is normally called for out-of-process plugins. Once this is called, | 61 // This is normally called for out-of-process plugins. Once this is called, |
| 62 // the module is available to be returned by GetModule(). The module will | 62 // the module is available to be returned by GetModule(). The module will |
| 63 // automatically unregister itself by calling PluginModuleDestroyed(). | 63 // automatically unregister itself by calling PluginModuleDestroyed(). |
| 64 void AddLiveModule(const FilePath& path, webkit::ppapi::PluginModule* module); | 64 void AddLiveModule(const FilePath& path, webkit::ppapi::PluginModule* module); |
| 65 | 65 |
| 66 // ModuleLifetime implementation. | 66 // ModuleLifetime implementation. |
| 67 virtual void PluginModuleDead(webkit::ppapi::PluginModule* dead_module); | 67 virtual void PluginModuleDead( |
| 68 webkit::ppapi::PluginModule* dead_module) OVERRIDE; |
| 68 | 69 |
| 69 private: | 70 private: |
| 70 PepperPluginRegistry(); | 71 PepperPluginRegistry(); |
| 71 | 72 |
| 72 // All known pepper plugins. | 73 // All known pepper plugins. |
| 73 std::vector<content::PepperPluginInfo> plugin_list_; | 74 std::vector<content::PepperPluginInfo> plugin_list_; |
| 74 | 75 |
| 75 // Plugins that have been preloaded so they can be executed in-process in | 76 // Plugins that have been preloaded so they can be executed in-process in |
| 76 // the renderer (the sandbox prevents on-demand loading). | 77 // the renderer (the sandbox prevents on-demand loading). |
| 77 typedef std::map<FilePath, scoped_refptr<webkit::ppapi::PluginModule> > | 78 typedef std::map<FilePath, scoped_refptr<webkit::ppapi::PluginModule> > |
| 78 OwningModuleMap; | 79 OwningModuleMap; |
| 79 OwningModuleMap preloaded_modules_; | 80 OwningModuleMap preloaded_modules_; |
| 80 | 81 |
| 81 // A list of non-owning pointers to all currently-live plugin modules. This | 82 // A list of non-owning pointers to all currently-live plugin modules. This |
| 82 // includes both preloaded ones in preloaded_modules_, and out-of-process | 83 // includes both preloaded ones in preloaded_modules_, and out-of-process |
| 83 // modules whose lifetime is managed externally. This will contain only | 84 // modules whose lifetime is managed externally. This will contain only |
| 84 // non-crashed modules. If an out-of-process module crashes, it may | 85 // non-crashed modules. If an out-of-process module crashes, it may |
| 85 // continue as long as there are WebKit references to it, but it will not | 86 // continue as long as there are WebKit references to it, but it will not |
| 86 // appear in this list. | 87 // appear in this list. |
| 87 typedef std::map<FilePath, webkit::ppapi::PluginModule*> NonOwningModuleMap; | 88 typedef std::map<FilePath, webkit::ppapi::PluginModule*> NonOwningModuleMap; |
| 88 NonOwningModuleMap live_modules_; | 89 NonOwningModuleMap live_modules_; |
| 89 | 90 |
| 90 DISALLOW_COPY_AND_ASSIGN(PepperPluginRegistry); | 91 DISALLOW_COPY_AND_ASSIGN(PepperPluginRegistry); |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 #endif // CONTENT_COMMON_PEPPER_PLUGIN_REGISTRY_H_ | 94 #endif // CONTENT_COMMON_PEPPER_PLUGIN_REGISTRY_H_ |
| OLD | NEW |