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

Side by Side Diff: cc/base/latency_info_swap_promise.cc

Issue 240163005: Deliver IPC messages together with SwapCompositorFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
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 #include "cc/base/latency_info_swap_promise.h" 5 #include "cc/base/latency_info_swap_promise.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace { 9 namespace {
10 ui::LatencyComponentType DidNotSwapReasonToLatencyComponentType( 10 ui::LatencyComponentType DidNotSwapReasonToLatencyComponentType(
(...skipping 14 matching lines...) Expand all
25 25
26 namespace cc { 26 namespace cc {
27 27
28 LatencyInfoSwapPromise::LatencyInfoSwapPromise(const ui::LatencyInfo& latency) 28 LatencyInfoSwapPromise::LatencyInfoSwapPromise(const ui::LatencyInfo& latency)
29 : latency_(latency) { 29 : latency_(latency) {
30 } 30 }
31 31
32 LatencyInfoSwapPromise::~LatencyInfoSwapPromise() { 32 LatencyInfoSwapPromise::~LatencyInfoSwapPromise() {
33 } 33 }
34 34
35 void LatencyInfoSwapPromise::DidSwap(CompositorFrameMetadata* metadata) { 35 void LatencyInfoSwapPromise::DidSwap(int source_frame_number,
36 CompositorFrameMetadata* metadata) {
36 DCHECK(!latency_.terminated); 37 DCHECK(!latency_.terminated);
37 metadata->latency_info.push_back(latency_); 38 metadata->latency_info.push_back(latency_);
38 } 39 }
39 40
40 void LatencyInfoSwapPromise::DidNotSwap(DidNotSwapReason reason) { 41 void LatencyInfoSwapPromise::DidNotSwap(DidNotSwapReason reason) {
41 latency_.AddLatencyNumber(DidNotSwapReasonToLatencyComponentType(reason), 42 latency_.AddLatencyNumber(DidNotSwapReasonToLatencyComponentType(reason),
42 0, 0); 43 0, 0);
43 // TODO(miletus): Turn this back on once per-event LatencyInfo tracking 44 // TODO(miletus): Turn this back on once per-event LatencyInfo tracking
44 // is enabled in GPU side. 45 // is enabled in GPU side.
45 // DCHECK(latency_.terminated); 46 // DCHECK(latency_.terminated);
46 } 47 }
47 48
48 } // namespace cc 49 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698