| 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 CONTENT_TEST_PLUGIN_PLUGIN_CLIENT_H_ | 5 #ifndef CONTENT_TEST_PLUGIN_PLUGIN_CLIENT_H_ |
| 6 #define CONTENT_TEST_PLUGIN_PLUGIN_CLIENT_H_ | 6 #define CONTENT_TEST_PLUGIN_PLUGIN_CLIENT_H_ |
| 7 | 7 |
| 8 #include "third_party/npapi/bindings/npapi.h" | 8 #include "third_party/npapi/bindings/npapi.h" |
| 9 #include "third_party/npapi/bindings/nphostapi.h" | 9 #include "third_party/npapi/bindings/nphostapi.h" |
| 10 | 10 |
| 11 namespace NPAPIClient { | 11 namespace NPAPIClient { |
| 12 | 12 |
| 13 // A PluginClient is a NPAPI Plugin. This class contains | 13 // A PluginClient is a NPAPI Plugin. This class contains |
| 14 // the bootstrapping functions used by the browser to load | 14 // the bootstrapping functions used by the browser to load |
| 15 // the plugin. | 15 // the plugin. |
| 16 class PluginClient { | 16 class PluginClient { |
| 17 public: | 17 public: |
| 18 // Although not documented in the NPAPI specification, this function | 18 // Although not documented in the NPAPI specification, this function |
| 19 // gets the list of entry points in the NPAPI Plugin (client) for the | 19 // gets the list of entry points in the NPAPI Plugin (client) for the |
| 20 // NPAPI Host to call. | 20 // NPAPI Host to call. |
| 21 static NPError GetEntryPoints(NPPluginFuncs* pFuncs); | 21 static NPError GetEntryPoints(NPPluginFuncs* pFuncs); |
| 22 | 22 |
| 23 // The browser calls this function only once: when a plug-in is loaded, | 23 // The browser calls this function only once: when a plugin is loaded, |
| 24 // before the first instance is created. This is the first function that | 24 // before the first instance is created. This is the first function that |
| 25 // the browser calls. NP_Initialize tells the plug-in that the browser has | 25 // the browser calls. NP_Initialize tells the plugin that the browser has |
| 26 // loaded it and provides global initialization. Allocate any memory or | 26 // loaded it and provides global initialization. Allocate any memory or |
| 27 // resources shared by all instances of your plug-in at this time. | 27 // resources shared by all instances of your plugin at this time. |
| 28 static NPError Initialize(NPNetscapeFuncs* pFuncs); | 28 static NPError Initialize(NPNetscapeFuncs* pFuncs); |
| 29 | 29 |
| 30 // The browser calls this function once after the last instance of your | 30 // The browser calls this function once after the last instance of your |
| 31 // plug-in is destroyed, before unloading the plug-in library itself. Use | 31 // plugin is destroyed, before unloading the plugin library itself. Use |
| 32 // NP_Shutdown to delete any data allocated in NP_Initialize to be shared | 32 // NP_Shutdown to delete any data allocated in NP_Initialize to be shared |
| 33 // by all instances of a plug-in. | 33 // by all instances of a plugin. |
| 34 static NPError Shutdown(); | 34 static NPError Shutdown(); |
| 35 | 35 |
| 36 // The table of functions provided by the host. | 36 // The table of functions provided by the host. |
| 37 static NPNetscapeFuncs *HostFunctions() { return host_functions_; } | 37 static NPNetscapeFuncs *HostFunctions() { return host_functions_; } |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 static NPNetscapeFuncs* host_functions_; | 40 static NPNetscapeFuncs* host_functions_; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace NPAPIClient | 43 } // namespace NPAPIClient |
| 44 | 44 |
| 45 #endif // CONTENT_TEST_PLUGIN_PLUGIN_CLIENT_H_ | 45 #endif // CONTENT_TEST_PLUGIN_PLUGIN_CLIENT_H_ |
| OLD | NEW |