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

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

Issue 340050: Add the plumbing and test code for plugins opening files from the sandbox. Th... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | « webkit/glue/pepper/pepper.h ('k') | webkit/glue/plugins/webplugin_delegate_impl.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 30698)
+++ webkit/glue/plugins/plugin_host.cc (working copy)
@@ -702,6 +702,14 @@
// TODO(sehr) implement render context destruction.
return NPERR_GENERIC_ERROR;
}
+
+static NPError OpenFileInSandbox(NPP id, const char* file_name, void** handle) {
+ scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id);
+ if (!plugin)
+ return NPERR_GENERIC_ERROR;
+ webkit_glue::WebPluginDelegate* delegate = plugin->webplugin()->delegate();
+ return delegate->OpenFileInSandbox(file_name, handle);
+}
#endif // defined(PEPPER_APIS_ENABLED)
NPError NPN_GetValue(NPP id, NPNVariable variable, void *value) {
@@ -862,7 +870,8 @@
static const NPPepperExtensions kExtensions = {
InitializeRenderContext,
FlushRenderContext,
- DestroyRenderContext
+ DestroyRenderContext,
+ OpenFileInSandbox,
};
// Return a pointer to the canonical function table.
NPPepperExtensions* extensions =
« no previous file with comments | « webkit/glue/pepper/pepper.h ('k') | webkit/glue/plugins/webplugin_delegate_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698