| 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 WEBKIT_PLUGINS_PPAPI_PLUGIN_INTERFACE_FACTORY_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PLUGIN_INTERFACE_FACTORY_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_INTERFACE_FACTORY_H_ | 6 #define CONTENT_RENDERER_PEPPER_PLUGIN_INTERFACE_FACTORY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
| 13 #include "webkit/plugins/webkit_plugins_export.h" | 13 #include "content/common/content_export.h" |
| 14 | 14 |
| 15 namespace webkit { | 15 namespace webkit { |
| 16 namespace ppapi { | 16 namespace ppapi { |
| 17 | 17 |
| 18 // This class provides functionality to manage custom PPAPI interface | 18 // This class provides functionality to manage custom PPAPI interface |
| 19 // factories. | 19 // factories. |
| 20 class PpapiInterfaceFactoryManager { | 20 class PpapiInterfaceFactoryManager { |
| 21 public: | 21 public: |
| 22 typedef const void* (InterfaceFactory)(const std::string& interface_name); | 22 typedef const void* (InterfaceFactory)(const std::string& interface_name); |
| 23 | 23 |
| 24 // Registers a custom PPAPI interface factory. | 24 // Registers a custom PPAPI interface factory. |
| 25 WEBKIT_PLUGINS_EXPORT void RegisterFactory(InterfaceFactory* factory); | 25 CONTENT_EXPORT void RegisterFactory(InterfaceFactory* factory); |
| 26 | 26 |
| 27 // Unregisters the custom PPAPI interface factory passed in. | 27 // Unregisters the custom PPAPI interface factory passed in. |
| 28 WEBKIT_PLUGINS_EXPORT void UnregisterFactory(InterfaceFactory* factory); | 28 CONTENT_EXPORT void UnregisterFactory(InterfaceFactory* factory); |
| 29 | 29 |
| 30 // Returns a pointer to the interface identified by the name passed in. | 30 // Returns a pointer to the interface identified by the name passed in. |
| 31 // Returns NULL if no factory handles this interface. | 31 // Returns NULL if no factory handles this interface. |
| 32 const void* GetInterface(const std::string& interface_name); | 32 const void* GetInterface(const std::string& interface_name); |
| 33 | 33 |
| 34 // Returns a pointer to the global instance of the | 34 // Returns a pointer to the global instance of the |
| 35 // PpapiInterfaceFactoryManager class. | 35 // PpapiInterfaceFactoryManager class. |
| 36 WEBKIT_PLUGINS_EXPORT static PpapiInterfaceFactoryManager* GetInstance(); | 36 CONTENT_EXPORT static PpapiInterfaceFactoryManager* GetInstance(); |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 friend struct base::DefaultLazyInstanceTraits<PpapiInterfaceFactoryManager>; | 39 friend struct base::DefaultLazyInstanceTraits<PpapiInterfaceFactoryManager>; |
| 40 | 40 |
| 41 PpapiInterfaceFactoryManager(); | 41 PpapiInterfaceFactoryManager(); |
| 42 ~PpapiInterfaceFactoryManager(); | 42 ~PpapiInterfaceFactoryManager(); |
| 43 | 43 |
| 44 typedef std::vector<InterfaceFactory*> FactoryList; | 44 typedef std::vector<InterfaceFactory*> FactoryList; |
| 45 | 45 |
| 46 // List of registered factories. | 46 // List of registered factories. |
| 47 FactoryList interface_factory_list_; | 47 FactoryList interface_factory_list_; |
| 48 | 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(PpapiInterfaceFactoryManager); | 49 DISALLOW_COPY_AND_ASSIGN(PpapiInterfaceFactoryManager); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // namespace ppapi | 52 } // namespace ppapi |
| 53 } // namespace webkit | 53 } // namespace webkit |
| 54 | 54 |
| 55 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_INTERFACE_FACTORY_H_ | 55 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_INTERFACE_FACTORY_H_ |
| 56 | 56 |
| OLD | NEW |