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