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

Unified Diff: blimp/client/core/compositor/blimp_compositor.cc

Issue 2537943002: Getting rid of CompositorFrameMetadata::satisfies_sequences (Closed)
Patch Set: x Created 4 years 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
« no previous file with comments | « no previous file | cc/ipc/cc_param_traits_macros.h » ('j') | cc/layers/surface_layer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/core/compositor/blimp_compositor.cc
diff --git a/blimp/client/core/compositor/blimp_compositor.cc b/blimp/client/core/compositor/blimp_compositor.cc
index edafad482814c074fa7fddfe9e1c665d7a0e44df..186bb40399febe22f3ac3128b4bdca72bd4d37b9 100644
--- a/blimp/client/core/compositor/blimp_compositor.cc
+++ b/blimp/client/core/compositor/blimp_compositor.cc
@@ -40,16 +40,20 @@ namespace client {
namespace {
-void SatisfyCallback(cc::SurfaceManager* manager,
+void SatisfyCallback(base::WeakPtr<cc::SurfaceManager> manager,
const cc::SurfaceSequence& sequence) {
+ if (!manager)
+ return;
std::vector<uint32_t> sequences;
sequences.push_back(sequence.sequence);
manager->DidSatisfySequences(sequence.frame_sink_id, &sequences);
}
-void RequireCallback(cc::SurfaceManager* manager,
+void RequireCallback(base::WeakPtr<cc::SurfaceManager> manager,
const cc::SurfaceId& id,
const cc::SurfaceSequence& sequence) {
+ if (!manager)
+ return;
cc::Surface* surface = manager->GetSurfaceForId(id);
if (!surface) {
LOG(ERROR) << "Attempting to require callback on nonexistent surface";
@@ -330,8 +334,8 @@ void BlimpCompositor::SubmitCompositorFrame(cc::CompositorFrame frame) {
cc::SurfaceManager* surface_manager =
GetEmbedderDeps()->GetSurfaceManager();
scoped_refptr<cc::SurfaceLayer> content_layer = cc::SurfaceLayer::Create(
- base::Bind(&SatisfyCallback, base::Unretained(surface_manager)),
- base::Bind(&RequireCallback, base::Unretained(surface_manager)));
+ base::Bind(&SatisfyCallback, surface_manager->GetWeakPtr()),
+ base::Bind(&RequireCallback, surface_manager->GetWeakPtr()));
content_layer->SetSurfaceId(
cc::SurfaceId(surface_factory_->frame_sink_id(), local_frame_id_), 1.f,
surface_size);
« no previous file with comments | « no previous file | cc/ipc/cc_param_traits_macros.h » ('j') | cc/layers/surface_layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698