Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: webkit/glue/plugins/plugin_host.cc

Issue 322003: Make Pepper NPN variable return a pointer to an allocated... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/npapi/bindings/npapi.h ('k') | webkit/tools/pepper_test_plugin/README » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/plugin_host.cc
===================================================================
--- webkit/glue/plugins/plugin_host.cc (revision 30107)
+++ webkit/glue/plugins/plugin_host.cc (working copy)
@@ -695,6 +695,12 @@
}
return NPERR_GENERIC_ERROR;
}
+
+static NPError DestroyRenderContext(NPP id,
+ NPRenderContext* context) {
+ // TODO(sehr) implement render context destruction.
+ return NPERR_GENERIC_ERROR;
+}
#endif // defined(PEPPER_APIS_ENABLED)
NPError NPN_GetValue(NPP id, NPNVariable variable, void *value) {
@@ -850,22 +856,21 @@
}
#endif
#if defined(PEPPER_APIS_ENABLED)
- case NPNVInitializeRenderContextFunc:
+ case NPNVPepperExtensions:
{
- NPInitializeRenderContextPtr* func =
- reinterpret_cast<NPInitializeRenderContextPtr*>(value);
- *func = InitializeRenderContext;
+ static const NPPepperExtensions kExtensions = {
+ InitializeRenderContext,
+ FlushRenderContext,
+ DestroyRenderContext
+ };
+ // Make a copy of the canonical function table.
brettw 2009/10/26 23:13:38 Nit: fix comment (you don't copy anymore).
+ NPPepperExtensions* extensions =
+ const_cast<NPPepperExtensions*>(&kExtensions);
+ NPPepperExtensions** exts = reinterpret_cast<NPPepperExtensions**>(value);
+ *exts = extensions;
rv = NPERR_NO_ERROR;
break;
}
- case NPNVFlushRenderContextFunc:
- {
- NPFlushRenderContextPtr* func =
- reinterpret_cast<NPFlushRenderContextPtr*>(value);
- *func = FlushRenderContext;
- rv = NPERR_NO_ERROR;
- break;
- }
#endif // defined(PEPPER_APIS_ENABLED)
default:
{
« no previous file with comments | « third_party/npapi/bindings/npapi.h ('k') | webkit/tools/pepper_test_plugin/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698