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

Unified Diff: content/renderer/pepper/renderer_ppapi_host_impl.cc

Issue 15947004: Allow renderer to create pepper ResourceHosts in the browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | « content/renderer/pepper/renderer_ppapi_host_impl.h ('k') | ppapi/host/ppapi_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/renderer_ppapi_host_impl.cc
diff --git a/content/renderer/pepper/renderer_ppapi_host_impl.cc b/content/renderer/pepper/renderer_ppapi_host_impl.cc
index e1b1a4a93d6f52aa77599d812850127518972dfd..93f050f9ab02f0e8c9390205e1a94f3e16e46c3f 100644
--- a/content/renderer/pepper/renderer_ppapi_host_impl.cc
+++ b/content/renderer/pepper/renderer_ppapi_host_impl.cc
@@ -8,12 +8,14 @@
#include "base/logging.h"
#include "base/process_util.h"
#include "content/common/sandbox_util.h"
+#include "content/renderer/pepper/pepper_browser_connection.h"
#include "content/renderer/pepper/pepper_graphics_2d_host.h"
#include "content/renderer/pepper/pepper_in_process_resource_creation.h"
#include "content/renderer/pepper/pepper_in_process_router.h"
#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
#include "content/renderer/render_view_impl.h"
#include "content/renderer/render_widget_fullscreen_pepper.h"
+#include "ipc/ipc_message.h"
#include "ppapi/host/ppapi_host.h"
#include "ppapi/proxy/host_dispatcher.h"
#include "third_party/WebKit/public/platform/WebRect.h"
@@ -271,6 +273,29 @@ bool RendererPpapiHostImpl::IsRunningInProcess() const {
return is_running_in_process_;
}
+void RendererPpapiHostImpl::CreateBrowserResourceHost(
+ PP_Instance instance,
+ const IPC::Message& nested_msg,
+ const base::Callback<void(int)>& callback) const {
+ PluginInstance* instance_object = GetAndValidateInstance(instance);
+ if (!instance_object)
+ callback.Run(0);
+
+ // Since we're the embedder, we can make assumptions about the delegate on
+ // the instance.
+ PepperPluginDelegateImpl* delegate =
+ static_cast<PepperPluginDelegateImpl*>(instance_object->delegate());
+ if (!delegate)
+ callback.Run(0);
+
+ PepperBrowserConnection* browser_connection =
+ delegate->pepper_browser_connection();
+ browser_connection->SendBrowserCreate(module_->GetPluginChildId(),
+ instance,
+ nested_msg,
+ callback);
+}
+
PluginInstance* RendererPpapiHostImpl::GetAndValidateInstance(
PP_Instance pp_instance) const {
PluginInstance* instance = HostGlobals::Get()->GetInstance(pp_instance);
« no previous file with comments | « content/renderer/pepper/renderer_ppapi_host_impl.h ('k') | ppapi/host/ppapi_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698