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

Side by Side Diff: content/renderer/child_frame_compositing_helper.cc

Issue 1229413003: DelegatedFrameHost should handle satisfied sequences in frame metadata. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment stating that |satifies_sequences| is cleared on call to SwapDelegatedFrame. Created 5 years, 5 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
« no previous file with comments | « content/renderer/child_frame_compositing_helper.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/child_frame_compositing_helper.h" 5 #include "content/renderer/child_frame_compositing_helper.h"
6 6
7 #include "cc/blink/web_layer_impl.h" 7 #include "cc/blink/web_layer_impl.h"
8 #include "cc/layers/delegated_frame_provider.h" 8 #include "cc/layers/delegated_frame_provider.h"
9 #include "cc/layers/delegated_frame_resource_collection.h" 9 #include "cc/layers/delegated_frame_resource_collection.h"
10 #include "cc/layers/delegated_renderer_layer.h" 10 #include "cc/layers/delegated_renderer_layer.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 // static 272 // static
273 void ChildFrameCompositingHelper::SatisfyCallback( 273 void ChildFrameCompositingHelper::SatisfyCallback(
274 scoped_refptr<ThreadSafeSender> sender, 274 scoped_refptr<ThreadSafeSender> sender,
275 int host_routing_id, 275 int host_routing_id,
276 cc::SurfaceSequence sequence) { 276 cc::SurfaceSequence sequence) {
277 // This may be called on either the main or impl thread. 277 // This may be called on either the main or impl thread.
278 sender->Send(new FrameHostMsg_SatisfySequence(host_routing_id, sequence)); 278 sender->Send(new FrameHostMsg_SatisfySequence(host_routing_id, sequence));
279 } 279 }
280 280
281 // static 281 // static
282 void ChildFrameCompositingHelper::SatisfyCallbackBrowserPlugin(
283 scoped_refptr<ThreadSafeSender> sender,
284 int host_routing_id,
285 int browser_plugin_instance_id,
286 cc::SurfaceSequence sequence) {
287 sender->Send(new BrowserPluginHostMsg_SatisfySequence(
288 host_routing_id, browser_plugin_instance_id, sequence));
289 }
290
291 // static
282 void ChildFrameCompositingHelper::RequireCallback( 292 void ChildFrameCompositingHelper::RequireCallback(
283 scoped_refptr<ThreadSafeSender> sender, 293 scoped_refptr<ThreadSafeSender> sender,
284 int host_routing_id, 294 int host_routing_id,
285 cc::SurfaceId id, 295 cc::SurfaceId id,
286 cc::SurfaceSequence sequence) { 296 cc::SurfaceSequence sequence) {
287 // This may be called on either the main or impl thread. 297 // This may be called on either the main or impl thread.
288 sender->Send(new FrameHostMsg_RequireSequence(host_routing_id, id, sequence)); 298 sender->Send(new FrameHostMsg_RequireSequence(host_routing_id, id, sequence));
289 } 299 }
290 300
291 void ChildFrameCompositingHelper::RequireCallbackBrowserPlugin( 301 void ChildFrameCompositingHelper::RequireCallbackBrowserPlugin(
(...skipping 17 matching lines...) Expand all
309 DCHECK(!delegated_layer_.get()); 319 DCHECK(!delegated_layer_.get());
310 320
311 // Do nothing if we are getting destroyed. 321 // Do nothing if we are getting destroyed.
312 if (!background_layer_.get()) 322 if (!background_layer_.get())
313 return; 323 return;
314 324
315 if (!surface_layer_.get()) { 325 if (!surface_layer_.get()) {
316 scoped_refptr<ThreadSafeSender> sender( 326 scoped_refptr<ThreadSafeSender> sender(
317 RenderThreadImpl::current()->thread_safe_sender()); 327 RenderThreadImpl::current()->thread_safe_sender());
318 cc::SurfaceLayer::SatisfyCallback satisfy_callback = 328 cc::SurfaceLayer::SatisfyCallback satisfy_callback =
319 base::Bind(&ChildFrameCompositingHelper::SatisfyCallback, sender, 329 render_frame_proxy_
320 host_routing_id_); 330 ? base::Bind(&ChildFrameCompositingHelper::SatisfyCallback, sender,
331 host_routing_id_)
332 : base::Bind(
333 &ChildFrameCompositingHelper::SatisfyCallbackBrowserPlugin,
334 sender, host_routing_id_,
335 browser_plugin_->browser_plugin_instance_id());
321 cc::SurfaceLayer::RequireCallback require_callback = 336 cc::SurfaceLayer::RequireCallback require_callback =
322 render_frame_proxy_ 337 render_frame_proxy_
323 ? base::Bind(&ChildFrameCompositingHelper::RequireCallback, sender, 338 ? base::Bind(&ChildFrameCompositingHelper::RequireCallback, sender,
324 host_routing_id_) 339 host_routing_id_)
325 : base::Bind( 340 : base::Bind(
326 &ChildFrameCompositingHelper::RequireCallbackBrowserPlugin, 341 &ChildFrameCompositingHelper::RequireCallbackBrowserPlugin,
327 sender, host_routing_id_, 342 sender, host_routing_id_,
328 browser_plugin_->browser_plugin_instance_id()); 343 browser_plugin_->browser_plugin_instance_id());
329 surface_layer_ = 344 surface_layer_ =
330 cc::SurfaceLayer::Create(cc_blink::WebLayerImpl::LayerSettings(), 345 cc::SurfaceLayer::Create(cc_blink::WebLayerImpl::LayerSettings(),
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 394
380 void ChildFrameCompositingHelper::SetContentsOpaque(bool opaque) { 395 void ChildFrameCompositingHelper::SetContentsOpaque(bool opaque) {
381 opaque_ = opaque; 396 opaque_ = opaque;
382 if (delegated_layer_.get()) 397 if (delegated_layer_.get())
383 delegated_layer_->SetContentsOpaque(opaque_); 398 delegated_layer_->SetContentsOpaque(opaque_);
384 if (surface_layer_.get()) 399 if (surface_layer_.get())
385 surface_layer_->SetContentsOpaque(opaque_); 400 surface_layer_->SetContentsOpaque(opaque_);
386 } 401 }
387 402
388 } // namespace content 403 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/child_frame_compositing_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698