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

Unified Diff: content/public/browser/android/synchronous_compositor.h

Issue 2347563003: Added FrameFuture class (Closed)
Patch Set: Code review 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
Index: content/public/browser/android/synchronous_compositor.h
diff --git a/content/public/browser/android/synchronous_compositor.h b/content/public/browser/android/synchronous_compositor.h
index 5b8b72328f5d55ff681c725f1c29db00564eca41..a4d5b40e91edb64c96fc6df5772c0a8f946d5b65 100644
--- a/content/public/browser/android/synchronous_compositor.h
+++ b/content/public/browser/android/synchronous_compositor.h
@@ -10,6 +10,7 @@
#include <memory>
#include "base/memory/ref_counted.h"
+#include "base/synchronization/waitable_event.h"
#include "base/time/time.h"
#include "cc/resources/returned_resource.h"
#include "content/common/content_export.h"
@@ -59,6 +60,23 @@ class CONTENT_EXPORT SynchronousCompositor {
DISALLOW_COPY_AND_ASSIGN(Frame);
};
+ class FrameFuture : public base::RefCountedThreadSafe<FrameFuture> {
+ public:
+ FrameFuture();
+ void setFrame(std::unique_ptr<Frame> frame);
+ std::unique_ptr<Frame> getFrame();
+
+ private:
+ friend class base::RefCountedThreadSafe<FrameFuture>;
+ ~FrameFuture();
+
+ base::WaitableEvent waitable_event_;
+ std::unique_ptr<Frame> frame_;
+#if DCHECK_IS_ON()
+ bool waited_ = false;
+#endif
+ };
+
// "On demand" hardware draw. Parameters are used by compositor for this draw.
// |viewport_size| is the current size to improve results during resize.
// |viewport_rect_for_tile_priority| and |transform_for_tile_priority| are
« no previous file with comments | « content/browser/android/synchronous_compositor_host.cc ('k') | content/public/browser/android/synchronous_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698