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

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

Issue 2835763002: Use swap-promise to improve first* paint times (Closed)
Patch Set: remove printfs Created 3 years, 7 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
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_OUTPUT_REPORT_TIME_SWAP_PROMISE_H_
6 #define CC_OUTPUT_REPORT_TIME_SWAP_PROMISE_H_
7
8 #include "base/callback.h"
9 #include "cc/output/swap_promise.h"
10
11 namespace base {
12 class SingleThreadTaskRunner;
13 }
14
15 namespace cc {
16
17 using ReportTimeCallback = base::Callback<void(bool, double)>;
18
19 class CC_EXPORT ReportTimeSwapPromise : public SwapPromise {
20 public:
21 ReportTimeSwapPromise(
22 ReportTimeCallback callback,
23 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
24 ~ReportTimeSwapPromise() override;
25
26 void DidActivate() override {}
27 void WillSwap(CompositorFrameMetadata* metadata) override {}
28 void DidSwap() override;
29 DidNotSwapAction DidNotSwap(DidNotSwapReason reason) override;
30
31 int64_t TraceId() const override;
32
33 private:
34 ReportTimeCallback callback_;
35 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
36 };
37
38 } // namespace cc
39
40 #endif // CC_OUTPUT_REPORT_TIME_SWAP_PROMISE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698