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

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

Issue 2320923002: Add a full Blimp integration test. (Closed)
Patch Set: Fix build break with chrome embedder Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « blimp/client/core/compositor/BUILD.gn ('k') | blimp/client/core/compositor/blimp_compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/core/compositor/blimp_compositor.h
diff --git a/blimp/client/core/compositor/blimp_compositor.h b/blimp/client/core/compositor/blimp_compositor.h
index 79da0b8035d162fe2ac808fe014fb557db6286f5..f32c490585f100317f055a213b0294d1a7e65661 100644
--- a/blimp/client/core/compositor/blimp_compositor.h
+++ b/blimp/client/core/compositor/blimp_compositor.h
@@ -6,6 +6,7 @@
#define BLIMP_CLIENT_CORE_COMPOSITOR_BLIMP_COMPOSITOR_H_
#include <memory>
+#include <vector>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
@@ -96,6 +97,11 @@ class BlimpCompositor : public cc::LayerTreeHostClient,
// virtual for testing.
virtual bool OnTouchEvent(const ui::MotionEvent& motion_event);
+ // Notifies |callback| when all pending commits have been drawn to the screen.
+ // If this compositor is destroyed or becomes hidden |callback| will be
+ // notified.
+ void NotifyWhenDonePendingCommits(base::Closure callback);
+
// Called to forward the compositor message from the remote server
// LayerTreeHost of the render widget for this compositor.
// virtual for testing.
@@ -171,6 +177,11 @@ class BlimpCompositor : public cc::LayerTreeHostClient,
// associated state.
void DestroyLayerTreeHost();
+ // Updates |pending_commit_trackers_|, decrementing the count and, if 0,
+ // notifying the callback. If |flush| is true, flushes all entries regardless
+ // of the count.
+ void CheckPendingCommitCounts(bool flush);
+
// The unique identifier for the render widget for this compositor.
const int render_widget_id_;
@@ -210,6 +221,17 @@ class BlimpCompositor : public cc::LayerTreeHostClient,
// widget.
std::unique_ptr<BlimpInputManager> input_manager_;
+ // The number of times a START_COMMIT proto has been received but a call to
+ // DidCommitAndDrawFrame hasn't been seen. This should track the number of
+ // outstanding commits.
+ size_t outstanding_commits_;
+
+ // When NotifyWhenDonePendingCommitsis called |outstanding_commits_| is copied
+ // along with the |callback| into this vector. Each time
+ // DidCommitAndDrawFrame is called these entries get decremented. If they hit
+ // 0 the callback is triggered.
+ std::vector<std::pair<size_t, base::Closure>> pending_commit_trackers_;
+
base::WeakPtrFactory<BlimpCompositor> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(BlimpCompositor);
« no previous file with comments | « blimp/client/core/compositor/BUILD.gn ('k') | blimp/client/core/compositor/blimp_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698