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

Side by Side Diff: cc/resources/memory_history.h

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 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
« no previous file with comments | « cc/raster/zero_copy_tile_task_worker_pool.cc ('k') | cc/resources/memory_history.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CC_RESOURCES_MEMORY_HISTORY_H_ 5 #ifndef CC_RESOURCES_MEMORY_HISTORY_H_
6 #define CC_RESOURCES_MEMORY_HISTORY_H_ 6 #define CC_RESOURCES_MEMORY_HISTORY_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <memory>
12
11 #include "base/macros.h" 13 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/time/time.h" 14 #include "base/time/time.h"
14 #include "cc/debug/ring_buffer.h" 15 #include "cc/debug/ring_buffer.h"
15 16
16 namespace cc { 17 namespace cc {
17 18
18 // Maintains a history of memory for each frame. 19 // Maintains a history of memory for each frame.
19 class MemoryHistory { 20 class MemoryHistory {
20 public: 21 public:
21 static scoped_ptr<MemoryHistory> Create(); 22 static std::unique_ptr<MemoryHistory> Create();
22 23
23 size_t HistorySize() const { return ring_buffer_.BufferSize(); } 24 size_t HistorySize() const { return ring_buffer_.BufferSize(); }
24 25
25 struct Entry { 26 struct Entry {
26 Entry() 27 Entry()
27 : total_budget_in_bytes(0), 28 : total_budget_in_bytes(0),
28 total_bytes_used(0), 29 total_bytes_used(0),
29 had_enough_memory(false) {} 30 had_enough_memory(false) {}
30 31
31 size_t total_budget_in_bytes; 32 size_t total_budget_in_bytes;
(...skipping 11 matching lines...) Expand all
43 MemoryHistory(); 44 MemoryHistory();
44 45
45 RingBufferType ring_buffer_; 46 RingBufferType ring_buffer_;
46 47
47 DISALLOW_COPY_AND_ASSIGN(MemoryHistory); 48 DISALLOW_COPY_AND_ASSIGN(MemoryHistory);
48 }; 49 };
49 50
50 } // namespace cc 51 } // namespace cc
51 52
52 #endif // CC_RESOURCES_MEMORY_HISTORY_H_ 53 #endif // CC_RESOURCES_MEMORY_HISTORY_H_
OLDNEW
« no previous file with comments | « cc/raster/zero_copy_tile_task_worker_pool.cc ('k') | cc/resources/memory_history.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698