Chromium Code Reviews| 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: |
| { |