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

Side by Side Diff: cc/debug/latency_info.cc

Issue 13874002: Switch LatencyInfo struct to use a map. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
« no previous file with comments | « cc/debug/latency_info.h ('k') | content/common/cc_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 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/debug/latency_info.h"
6
7 #include <algorithm>
8
9 namespace cc {
10
11 void LatencyInfo::MergeWith(const LatencyInfo& other) {
12 for (LatencyMap::const_iterator b = other.latency_numbers.begin();
13 b != other.latency_numbers.end(); ++b) {
14 AddLatencyNumber(b->first.first, b->first.second, b->second);
15 }
16 }
17
18 void LatencyInfo::AddLatencyNumber(LatencyComponent component,
19 int64 id, int64 number) {
nduca 2013/04/09 23:15:08 lgtm numer-> component_sequence_number? lets ev
20 LatencyMap::key_type key = std::make_pair(component, id);
21 LatencyMap::iterator f = latency_numbers.find(key);
22 if (f == latency_numbers.end())
23 latency_numbers[key] = number;
24 else
25 f->second = std::max(number, f->second);
26 }
27
28 } // namespace cc
29
OLDNEW
« no previous file with comments | « cc/debug/latency_info.h ('k') | content/common/cc_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698