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

Side by Side Diff: cc/memory_history.cc

Issue 12471007: Part 8 of cc/ directory shuffles: resources (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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/memory_history.h ('k') | cc/nine_patch_layer.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 2012 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/memory_history.h"
6
7 namespace cc {
8
9 // static
10 scoped_ptr<MemoryHistory> MemoryHistory::Create() {
11 return make_scoped_ptr(new MemoryHistory());
12 }
13
14 MemoryHistory::MemoryHistory() {}
15
16 void MemoryHistory::SaveEntry(const MemoryHistory::Entry& entry) {
17 ring_buffer_.SaveToBuffer(entry);
18 }
19
20 void MemoryHistory::GetMinAndMax(size_t* min, size_t* max) const {
21 *min = std::numeric_limits<size_t>::max();
22 *max = 0;
23
24 for (RingBufferType::Iterator it = ring_buffer_.Begin(); it; ++it) {
25 size_t bytes_total = it->bytes_total();
26
27 if (bytes_total < *min)
28 *min = bytes_total;
29 if (bytes_total > *max)
30 *max = bytes_total;
31 }
32
33 if (*min > *max)
34 *min = *max;
35 }
36
37 } // namespace cc
OLDNEW
« no previous file with comments | « cc/memory_history.h ('k') | cc/nine_patch_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698