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

Side by Side Diff: content/browser/frame_sink_provider_impl.cc

Issue 2774373002: Use MojoCompositorFrameSink in RendererCompositorFrameSink (Closed)
Patch Set: Fixed mac 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 #include "content/browser/frame_sink_provider_impl.h"
5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6
7 namespace content {
8
9 FrameSinkProviderImpl::FrameSinkProviderImpl(int32_t process_id)
10 : process_id_(process_id), binding_(this) {}
11
12 FrameSinkProviderImpl::~FrameSinkProviderImpl() = default;
13
14 void FrameSinkProviderImpl::Bind(mojom::FrameSinkProviderRequest request) {
15 if (binding_.is_bound()) {
Fady Samuel 2017/04/10 02:28:37 Should this be a DCHECK instead or can a malicious
Saman Sami 2017/04/10 02:37:47 Since the request comes from the renderer, I think
16 LOG(ERROR) << "Received multiple requests for FrameSinkProvider. "
17 << "There should be only one instance per renderer.";
18 return;
19 }
20 binding_.Bind(std::move(request));
21 }
22
23 void FrameSinkProviderImpl::CreateForWidget(
24 int32_t widget_id,
Fady Samuel 2017/04/10 02:28:37 routing ID right?
Saman Sami 2017/04/10 02:37:47 Those two are basically synonymous (I'm pretty sur
25 cc::mojom::MojoCompositorFrameSinkRequest request,
26 cc::mojom::MojoCompositorFrameSinkClientPtr client) {
27 RenderWidgetHostImpl* render_widget_host_impl =
28 RenderWidgetHostImpl::FromID(process_id_, widget_id);
29 if (!render_widget_host_impl) {
30 LOG(ERROR) << "No RenderWidgetHost exists with id " << widget_id;
31 return;
32 }
33 render_widget_host_impl->RequestMojoCompositorFrameSink(std::move(request),
34 std::move(client));
35 }
36
37 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698