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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2774373002: Use MojoCompositorFrameSink in RendererCompositorFrameSink (Closed)
Patch Set: Rebased, dedup IPC Created 3 years, 8 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
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 64a8536833705070081eeb176530892c5a82825c..4c027b5d7ced1fa4e29c050b8b678f756e070691 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -703,6 +703,7 @@ RenderProcessHostImpl::RenderProcessHostImpl(
#endif
instance_weak_factory_(
new base::WeakPtrFactory<RenderProcessHostImpl>(this)),
+ frame_sink_provider_(id_),
weak_factory_(this) {
widget_helper_ = new RenderWidgetHelper();
@@ -1243,6 +1244,10 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
base::Unretained(this)));
AddUIThreadInterface(registry.get(),
+ base::Bind(&RenderProcessHostImpl::BindFrameSinkProvider,
+ base::Unretained(this)));
+
+ AddUIThreadInterface(registry.get(),
base::Bind(&OffscreenCanvasSurfaceFactoryImpl::Create));
AddUIThreadInterface(
registry.get(),
@@ -1369,6 +1374,11 @@ void RenderProcessHostImpl::CreateOffscreenCanvasCompositorFrameSinkProvider(
offscreen_canvas_provider_->Add(std::move(request));
}
+void RenderProcessHostImpl::BindFrameSinkProvider(
+ mojom::FrameSinkProviderRequest request) {
+ frame_sink_provider_.Bind(std::move(request));
+}
+
void RenderProcessHostImpl::CreateStoragePartitionService(
mojo::InterfaceRequest<mojom::StoragePartitionService> request) {
// DO NOT REMOVE THIS COMMAND LINE CHECK WITHOUT SECURITY REVIEW!
@@ -2758,6 +2768,11 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead,
if (delayed_cleanup_needed_)
Cleanup();
+ // If RenderProcessHostImpl is reused, the next renderer will send a new
+ // request for FrameSinkProvider so make sure frame_sink_provider_ is ready
+ // for that.
+ frame_sink_provider_.Unbind();
+
// This object is not deleted at this point and might be reused later.
// TODO(darin): clean this up
}
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | content/browser/renderer_host/render_widget_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698