OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/memory/discardable_memory_manager.h" | 5 #include "base/memory/discardable_memory_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/containers/adapters.h" | 8 #include "base/containers/adapters.h" |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/containers/mru_cache.h" | 10 #include "base/containers/mru_cache.h" |
11 #include "base/debug/crash_logging.h" | 11 #include "base/debug/crash_logging.h" |
12 #include "base/debug/trace_event.h" | |
13 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
14 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
| 14 #include "base/trace_event/trace_event.h" |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 namespace internal { | 17 namespace internal { |
18 | 18 |
19 DiscardableMemoryManager::DiscardableMemoryManager( | 19 DiscardableMemoryManager::DiscardableMemoryManager( |
20 size_t memory_limit, | 20 size_t memory_limit, |
21 size_t soft_memory_limit, | 21 size_t soft_memory_limit, |
22 TimeDelta hard_memory_limit_expiration_time) | 22 TimeDelta hard_memory_limit_expiration_time) |
23 : allocations_(AllocationMap::NO_AUTO_EVICT), | 23 : allocations_(AllocationMap::NO_AUTO_EVICT), |
24 bytes_allocated_(0u), | 24 bytes_allocated_(0u), |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 base::debug::SetCrashKeyValue(kDiscardableMemoryUsageKey, | 237 base::debug::SetCrashKeyValue(kDiscardableMemoryUsageKey, |
238 Uint64ToString(new_bytes_allocated)); | 238 Uint64ToString(new_bytes_allocated)); |
239 } | 239 } |
240 | 240 |
241 TimeTicks DiscardableMemoryManager::Now() const { | 241 TimeTicks DiscardableMemoryManager::Now() const { |
242 return TimeTicks::Now(); | 242 return TimeTicks::Now(); |
243 } | 243 } |
244 | 244 |
245 } // namespace internal | 245 } // namespace internal |
246 } // namespace base | 246 } // namespace base |
OLD | NEW |