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

Unified Diff: content/browser/renderer_host/delegated_frame_host.cc

Issue 2583803002: Reland of Getting rid of CompositorFrameMetadata::satisfies_sequences (Closed)
Patch Set: 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 | « cc/surfaces/surface_manager.cc ('k') | ui/android/delegated_frame_host_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/delegated_frame_host.cc
diff --git a/content/browser/renderer_host/delegated_frame_host.cc b/content/browser/renderer_host/delegated_frame_host.cc
index a4f25901f2fb99f10e4cb829d16e638931ef8e1e..8aec164def9b00973a061795c7f77117f880cb96 100644
--- a/content/browser/renderer_host/delegated_frame_host.cc
+++ b/content/browser/renderer_host/delegated_frame_host.cc
@@ -40,14 +40,16 @@
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) {
cc::Surface* surface = manager->GetSurfaceForId(id);
@@ -513,8 +515,8 @@
// manager must outlive compositors using it.
client_->DelegatedFrameHostGetLayer()->SetShowSurface(
cc::SurfaceId(frame_sink_id_, local_frame_id_),
- base::Bind(&SatisfyCallback, base::Unretained(manager)),
- base::Bind(&RequireCallback, base::Unretained(manager)), frame_size,
+ base::Bind(&SatisfyCallback, manager->GetWeakPtr()),
+ base::Bind(&RequireCallback, manager->GetWeakPtr()), frame_size,
frame_device_scale_factor);
current_surface_size_ = frame_size;
current_scale_factor_ = frame_device_scale_factor;
« no previous file with comments | « cc/surfaces/surface_manager.cc ('k') | ui/android/delegated_frame_host_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698