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

Side by Side Diff: cc/output/forced_redraw_swap_promise.cc

Issue 2185823005: Make RenderViewImpl::OnForceRedraw more robust (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments and add tests Created 4 years, 4 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 2016 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 #include "cc/output/forced_redraw_swap_promise.h"
6
7 #include "base/logging.h"
8 #include "base/trace_event/trace_event.h"
9
10 namespace cc {
11
12 ForcedRedrawSwapPromise::ForcedRedrawSwapPromise(const ui::LatencyInfo& latency)
13 : latency_(latency) {}
14
15 ForcedRedrawSwapPromise::~ForcedRedrawSwapPromise() = default;
16
17 void ForcedRedrawSwapPromise::DidSwap(CompositorFrameMetadata* metadata) {
18 DCHECK(!latency_.terminated());
19 metadata->latency_info.push_back(latency_);
20 }
21
22 SwapPromise::DidNotSwapAction ForcedRedrawSwapPromise::DidNotSwap(
23 DidNotSwapReason reason) {
24 return reason == DidNotSwapReason::SWAP_FAILS
25 ? DidNotSwapAction::KEEP_ACTIVE
26 : DidNotSwapAction::DEFAULT_ACTION;
27 }
28
29 int64_t ForcedRedrawSwapPromise::TraceId() const {
30 return latency_.trace_id();
31 }
32
33 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698