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

Side by Side Diff: content/browser/renderer_host/browser_compositor_view_mac.mm

Issue 2656893003: Let DelegateFrameHost in Mac and Android use correct FrameSinkId during creation (Closed)
Patch Set: more comments Created 3 years, 10 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/browser_compositor_view_mac.h" 5 #include "content/browser/renderer_host/browser_compositor_view_mac.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 BrowserThread::UI, FROM_HERE, base::Bind(&ReleaseSpareCompositors)); 161 BrowserThread::UI, FROM_HERE, base::Bind(&ReleaseSpareCompositors));
162 } 162 }
163 163
164 //////////////////////////////////////////////////////////////////////////////// 164 ////////////////////////////////////////////////////////////////////////////////
165 // BrowserCompositorMac 165 // BrowserCompositorMac
166 166
167 BrowserCompositorMac::BrowserCompositorMac( 167 BrowserCompositorMac::BrowserCompositorMac(
168 ui::AcceleratedWidgetMacNSView* accelerated_widget_mac_ns_view, 168 ui::AcceleratedWidgetMacNSView* accelerated_widget_mac_ns_view,
169 BrowserCompositorMacClient* client, 169 BrowserCompositorMacClient* client,
170 bool render_widget_host_is_hidden, 170 bool render_widget_host_is_hidden,
171 bool ns_view_attached_to_window) 171 bool ns_view_attached_to_window,
172 const cc::FrameSinkId& frame_sink_id)
172 : client_(client), 173 : client_(client),
173 accelerated_widget_mac_ns_view_(accelerated_widget_mac_ns_view), 174 accelerated_widget_mac_ns_view_(accelerated_widget_mac_ns_view),
174 weak_factory_(this) { 175 weak_factory_(this) {
175 g_browser_compositor_count += 1; 176 g_browser_compositor_count += 1;
176 177
177 root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); 178 root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
178 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); 179 delegated_frame_host_.reset(new DelegatedFrameHost(frame_sink_id, this));
179 delegated_frame_host_.reset(new DelegatedFrameHost(
180 factory->GetContextFactoryPrivate()->AllocateFrameSinkId(), this));
181 180
182 SetRenderWidgetHostIsHidden(render_widget_host_is_hidden); 181 SetRenderWidgetHostIsHidden(render_widget_host_is_hidden);
183 SetNSViewAttachedToWindow(ns_view_attached_to_window); 182 SetNSViewAttachedToWindow(ns_view_attached_to_window);
184 } 183 }
185 184
186 BrowserCompositorMac::~BrowserCompositorMac() { 185 BrowserCompositorMac::~BrowserCompositorMac() {
187 // Ensure that copy callbacks completed or cancelled during further tear-down 186 // Ensure that copy callbacks completed or cancelled during further tear-down
188 // do not call back into this. 187 // do not call back into this.
189 weak_factory_.InvalidateWeakPtrs(); 188 weak_factory_.InvalidateWeakPtrs();
190 189
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 467
469 const cc::BeginFrameArgs& BrowserCompositorMac::LastUsedBeginFrameArgs() const { 468 const cc::BeginFrameArgs& BrowserCompositorMac::LastUsedBeginFrameArgs() const {
470 return last_begin_frame_args_; 469 return last_begin_frame_args_;
471 } 470 }
472 471
473 void BrowserCompositorMac::OnBeginFrameSourcePausedChanged(bool paused) { 472 void BrowserCompositorMac::OnBeginFrameSourcePausedChanged(bool paused) {
474 // Only used on Android WebView. 473 // Only used on Android WebView.
475 } 474 }
476 475
477 } // namespace content 476 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698