| 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 // TODO: Need mechanism to cleanup the static instance | 5 // TODO: Need mechanism to cleanup the static instance |
| 6 | 6 |
| 7 #ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_HOST_H__ | 7 #ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_HOST_H_ |
| 8 #define WEBKIT_GLUE_PLUGIN_PLUGIN_HOST_H__ | 8 #define WEBKIT_PLUGINS_NPAPI_PLUGIN_HOST_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/ref_counted.h" | 13 #include "base/ref_counted.h" |
| 14 #include "third_party/npapi/bindings/npapi.h" | 14 #include "third_party/npapi/bindings/npapi.h" |
| 15 #include "third_party/npapi/bindings/nphostapi.h" | 15 #include "third_party/npapi/bindings/nphostapi.h" |
| 16 | 16 |
| 17 namespace NPAPI | 17 namespace webkit { |
| 18 { | 18 namespace npapi { |
| 19 |
| 19 class PluginInstance; | 20 class PluginInstance; |
| 20 | 21 |
| 21 // The Plugin Host implements the NPN_xxx functions for NPAPI plugins. | 22 // The Plugin Host implements the NPN_xxx functions for NPAPI plugins. |
| 22 // These are the functions exposed from the Plugin Host for use | 23 // These are the functions exposed from the Plugin Host for use |
| 23 // by the Plugin. | 24 // by the Plugin. |
| 24 // | 25 // |
| 25 // The PluginHost is managed as a singleton. This isn't strictly | 26 // The PluginHost is managed as a singleton. This isn't strictly |
| 26 // necessary, but since the callback functions are all global C | 27 // necessary, but since the callback functions are all global C |
| 27 // functions, there is really no point in having per-instance PluginHosts. | 28 // functions, there is really no point in having per-instance PluginHosts. |
| 28 class PluginHost : public base::RefCounted<PluginHost> { | 29 class PluginHost : public base::RefCounted<PluginHost> { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 51 | 52 |
| 52 virtual ~PluginHost(); | 53 virtual ~PluginHost(); |
| 53 | 54 |
| 54 PluginHost(); | 55 PluginHost(); |
| 55 void InitializeHostFuncs(); | 56 void InitializeHostFuncs(); |
| 56 static scoped_refptr<PluginHost> singleton_; | 57 static scoped_refptr<PluginHost> singleton_; |
| 57 NPNetscapeFuncs host_funcs_; | 58 NPNetscapeFuncs host_funcs_; |
| 58 DISALLOW_COPY_AND_ASSIGN(PluginHost); | 59 DISALLOW_COPY_AND_ASSIGN(PluginHost); |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 } // namespace NPAPI | 62 } // namespace npapi |
| 63 } // namespace webkit |
| 62 | 64 |
| 63 #endif // WEBKIT_GLUE_PLUGIN_PLUGIN_HOST_H__ | 65 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_HOST_H_ |
| OLD | NEW |