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

Unified Diff: content/browser/renderer_host/frame_sink_provider_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/frame_sink_provider_impl.cc
diff --git a/content/browser/renderer_host/frame_sink_provider_impl.cc b/content/browser/renderer_host/frame_sink_provider_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d01ace8d2c1008c2d85789368b5fc8306130e434
--- /dev/null
+++ b/content/browser/renderer_host/frame_sink_provider_impl.cc
@@ -0,0 +1,42 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#include "content/browser/renderer_host/frame_sink_provider_impl.h"
+#include "content/browser/renderer_host/render_widget_host_impl.h"
+
+namespace content {
+
+FrameSinkProviderImpl::FrameSinkProviderImpl(int32_t process_id)
+ : process_id_(process_id), binding_(this) {}
+
+FrameSinkProviderImpl::~FrameSinkProviderImpl() = default;
+
+void FrameSinkProviderImpl::Bind(mojom::FrameSinkProviderRequest request) {
+ if (binding_.is_bound()) {
+ DLOG(ERROR) << "Received multiple requests for FrameSinkProvider. "
+ << "There should be only one instance per renderer.";
+ return;
+ }
+ binding_.Bind(std::move(request));
+}
+
+void FrameSinkProviderImpl::Unbind() {
+ binding_.Close();
+}
+
+void FrameSinkProviderImpl::CreateForWidget(
+ int32_t widget_id,
+ cc::mojom::MojoCompositorFrameSinkRequest request,
+ cc::mojom::MojoCompositorFrameSinkClientPtr client) {
+ RenderWidgetHostImpl* render_widget_host_impl =
+ RenderWidgetHostImpl::FromID(process_id_, widget_id);
+ if (!render_widget_host_impl) {
+ DLOG(ERROR) << "No RenderWidgetHost exists with id " << widget_id
+ << "in process " << process_id_;
+ return;
+ }
+ render_widget_host_impl->RequestMojoCompositorFrameSink(std::move(request),
+ std::move(client));
+}
+
+} // namespace content
« no previous file with comments | « content/browser/renderer_host/frame_sink_provider_impl.h ('k') | content/browser/renderer_host/render_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698