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

Side by Side Diff: cc/output/swap_promise.h

Issue 1178963003: Trace main thread commit in flow events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Naming and comments improvements. Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « cc/output/latency_info_swap_promise.cc ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_OUTPUT_SWAP_PROMISE_H_ 5 #ifndef CC_OUTPUT_SWAP_PROMISE_H_
6 #define CC_OUTPUT_SWAP_PROMISE_H_ 6 #define CC_OUTPUT_SWAP_PROMISE_H_
7 7
8 #include "cc/output/compositor_frame_metadata.h" 8 #include "cc/output/compositor_frame_metadata.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 21 matching lines...) Expand all
32 // DidActivate() ; DidNotSwap() 32 // DidActivate() ; DidNotSwap()
33 // 33 //
34 // Clients that wish to use SwapPromise should have a subclass that defines 34 // Clients that wish to use SwapPromise should have a subclass that defines
35 // the behavior of DidActivate(), DidSwap() and DidNotSwap(). Notice that the 35 // the behavior of DidActivate(), DidSwap() and DidNotSwap(). Notice that the
36 // promise can be broken at either main or impl thread, e.g. commit fails on 36 // promise can be broken at either main or impl thread, e.g. commit fails on
37 // main thread, new frame data has no actual damage so 37 // main thread, new frame data has no actual damage so
38 // LayerTreeHostImpl::SwapBuffers() bails out early on impl thread, so don't 38 // LayerTreeHostImpl::SwapBuffers() bails out early on impl thread, so don't
39 // assume that Did*() methods are called at a particular thread. It is better 39 // assume that Did*() methods are called at a particular thread. It is better
40 // to let the subclass carry thread-safe member data and operate on that 40 // to let the subclass carry thread-safe member data and operate on that
41 // member data in Did*(). 41 // member data in Did*().
42 //
Yufeng Shen (Slow to review) 2015/06/16 17:54:16 extra line
42 class CC_EXPORT SwapPromise { 43 class CC_EXPORT SwapPromise {
43 public: 44 public:
44 enum DidNotSwapReason { 45 enum DidNotSwapReason {
45 SWAP_FAILS, 46 SWAP_FAILS,
46 COMMIT_FAILS, 47 COMMIT_FAILS,
47 COMMIT_NO_UPDATE, 48 COMMIT_NO_UPDATE,
48 ACTIVATION_FAILS, 49 ACTIVATION_FAILS,
49 }; 50 };
50 51
51 SwapPromise() {} 52 SwapPromise() {}
52 virtual ~SwapPromise() {} 53 virtual ~SwapPromise() {}
53 54
54 virtual void DidActivate() = 0; 55 virtual void DidActivate() = 0;
55 virtual void DidSwap(CompositorFrameMetadata* metadata) = 0; 56 virtual void DidSwap(CompositorFrameMetadata* metadata) = 0;
56 virtual void DidNotSwap(DidNotSwapReason reason) = 0; 57 virtual void DidNotSwap(DidNotSwapReason reason) = 0;
58 // OnCommit is only called for LatencyInfoSwapPromise
59 virtual void OnCommit() {}
Yufeng Shen (Slow to review) 2015/06/16 17:54:16 Should not mention subclass's behavior, only menti
57 60
58 // A non-zero trace id identifies a trace flow object that is embedded in the 61 // A non-zero trace id identifies a trace flow object that is embedded in the
59 // swap promise. This can be used for registering additional flow steps to 62 // swap promise. This can be used for registering additional flow steps to
60 // visualize the object's path through the system. 63 // visualize the object's path through the system.
61 virtual int64 TraceId() const = 0; 64 virtual int64 TraceId() const = 0;
62 }; 65 };
63 66
64 } // namespace cc 67 } // namespace cc
65 68
66 #endif // CC_OUTPUT_SWAP_PROMISE_H_ 69 #endif // CC_OUTPUT_SWAP_PROMISE_H_
OLDNEW
« no previous file with comments | « cc/output/latency_info_swap_promise.cc ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698