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 "content/child/child_discardable_shared_memory_manager.h" | 5 #include "content/child/child_discardable_shared_memory_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/debug/crash_logging.h" | 12 #include "base/debug/crash_logging.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/discardable_memory.h" | 14 #include "base/memory/discardable_memory.h" |
15 #include "base/memory/discardable_shared_memory.h" | 15 #include "base/memory/discardable_shared_memory.h" |
16 #include "base/memory/ptr_util.h" | 16 #include "base/memory/ptr_util.h" |
17 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
18 #include "base/process/memory.h" | 18 #include "base/process/memory.h" |
19 #include "base/process/process_metrics.h" | 19 #include "base/process/process_metrics.h" |
20 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
21 #include "base/thread_task_runner_handle.h" | 21 #include "base/threading/thread_task_runner_handle.h" |
22 #include "base/trace_event/memory_dump_manager.h" | 22 #include "base/trace_event/memory_dump_manager.h" |
23 #include "base/trace_event/trace_event.h" | 23 #include "base/trace_event/trace_event.h" |
24 #include "content/common/child_process_messages.h" | 24 #include "content/common/child_process_messages.h" |
25 | 25 |
26 namespace content { | 26 namespace content { |
27 namespace { | 27 namespace { |
28 | 28 |
29 // Default allocation size. | 29 // Default allocation size. |
30 const size_t kAllocationSize = 4 * 1024 * 1024; | 30 const size_t kAllocationSize = 4 * 1024 * 1024; |
31 | 31 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 "discardable-memory-allocated"; | 320 "discardable-memory-allocated"; |
321 base::debug::SetCrashKeyValue(kDiscardableMemoryAllocatedKey, | 321 base::debug::SetCrashKeyValue(kDiscardableMemoryAllocatedKey, |
322 base::Uint64ToString(new_bytes_total)); | 322 base::Uint64ToString(new_bytes_total)); |
323 | 323 |
324 static const char kDiscardableMemoryFreeKey[] = "discardable-memory-free"; | 324 static const char kDiscardableMemoryFreeKey[] = "discardable-memory-free"; |
325 base::debug::SetCrashKeyValue(kDiscardableMemoryFreeKey, | 325 base::debug::SetCrashKeyValue(kDiscardableMemoryFreeKey, |
326 base::Uint64ToString(new_bytes_free)); | 326 base::Uint64ToString(new_bytes_free)); |
327 } | 327 } |
328 | 328 |
329 } // namespace content | 329 } // namespace content |
OLD | NEW |