Index: cc/output/promise.h |
diff --git a/cc/output/promise.h b/cc/output/promise.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..61bf537bc47b192d0f6d3aa249fa3830de9ba745 |
--- /dev/null |
+++ b/cc/output/promise.h |
@@ -0,0 +1,50 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CC_OUTPUT_PROMISE_H_ |
+#define CC_OUTPUT_PROMISE_H_ |
+ |
+#include "base/basictypes.h" |
+#include "cc/base/cc_export.h" |
+#include "cc/output/compositor_frame_metadata.h" |
+ |
+namespace cc { |
+ |
+class CC_EXPORT Promise { |
+ public: |
+ struct DidNotSwap { |
+ enum Reason { |
+ UNKNOWN, |
+ SWAP_FAILS, |
+ COMMIT_FAILS, |
+ COMMIT_NO_UPDATE, |
+ }; |
+ }; |
+ struct DidNotActivate { |
+ enum Reason { |
+ UNKNOWN, |
+ ACTIVATION_FAILS, |
+ COMMIT_NO_UPDATE, |
+ COMMIT_FAILS, |
+ }; |
+ }; |
+ |
+ Promise() {} |
+ virtual ~Promise(); |
+ |
+ virtual bool OnDidSwap(CompositorFrameMetadata*); |
+ virtual bool OnDidNotSwap(DidNotSwap::Reason); |
+ |
+ virtual bool OnDidActivate(CompositorFrameMetadata*); |
+ virtual bool OnDidNotActivate(DidNotActivate::Reason); |
+ |
+ // A non-zero trace id identifies a trace flow object that is embedded in the |
+ // swap promise. This can be used for registering additional flow steps to |
+ // visualize the object's path through the system. |
+ virtual int64 TraceId() const = 0; |
+}; |
+ |
+} // namespace cc |
+ |
+#endif // CC_OUTPUT_PROMISE_H_ |