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

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

Issue 291001: Moved Pepper delegate definition to chrome\renderer to allow it to use... (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/glue/plugins/plugin_instance.h » ('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 29377)
+++ webkit/glue/plugins/plugin_host.cc (working copy)
@@ -18,6 +18,7 @@
#include "webkit/default_plugin/default_plugin_shared.h"
#include "webkit/glue/glue_util.h"
#include "webkit/glue/webplugininfo.h"
+#include "webkit/glue/webplugin_delegate.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/plugins/plugin_instance.h"
#include "webkit/glue/plugins/plugin_lib.h"
@@ -667,7 +668,9 @@
NPRenderContext* context) {
scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id);
if (plugin) {
- return plugin->InitializeRenderContext(type, context);
+ webkit_glue::WebPluginDelegate* delegate = plugin->webplugin()->delegate();
+ // Set up the renderer for the specified type.
+ return delegate->InitializeRenderContext(type, context);
}
return NPERR_GENERIC_ERROR;
}
@@ -675,10 +678,18 @@
static NPError FlushRenderContext(NPP id,
NPRenderContext* context,
NPFlushRenderContextCallbackPtr callback,
- void* userData) {
+ void* user_data) {
scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id);
if (plugin) {
- return plugin->FlushRenderContext(context, callback, userData);
+ webkit_glue::WebPluginDelegate* delegate = plugin->webplugin()->delegate();
+ // Do the flush.
+ NPError err = delegate->FlushRenderContext(context);
+ // Invoke the callback to inform the caller the work was done.
+ if (callback != NULL) {
+ (*callback)(context, err, user_data);
+ }
+ // Return any errors.
+ return err;
}
return NPERR_GENERIC_ERROR;
}
@@ -975,29 +986,6 @@
}
}
-#if defined(PEPPER_APIS_ENABLED)
-NPError NPN_InitializeRenderContext(NPP id,
- NPRenderType type,
- NPRenderContext* context) {
- scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id);
- if (plugin) {
- return plugin->InitializeRenderContext(type, context);
- }
- return NPERR_GENERIC_ERROR;
-}
-
-NPError NPN_FlushRenderContext(NPP id,
- NPRenderContext* context,
- NPFlushRenderContextCallbackPtr callback,
- void* userData) {
- scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id);
- if (plugin) {
- return plugin->FlushRenderContext(context, callback, userData);
- }
- return NPERR_GENERIC_ERROR;
-}
-#endif // defined(PEPPER_APIS_ENABLED)
-
NPError NPN_GetValueForURL(NPP id,
NPNURLVariable variable,
const char *url,
« no previous file with comments | « third_party/npapi/bindings/npapi.h ('k') | webkit/glue/plugins/plugin_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698