OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 "components/memory_coordinator/browser/memory_monitor_win.h" | 5 #include "content/browser/memory/memory_monitor_win.h" |
6 | 6 |
7 #include "base/process/process_metrics.h" | 7 #include "base/process/process_metrics.h" |
8 | 8 |
9 // TODO(chrisha): Implement a mechanism for observing swapping, and updating the | 9 // TODO(chrisha): Implement a mechanism for observing swapping, and updating the |
10 // memory threshold on a per machine basis. | 10 // memory threshold on a per machine basis. |
11 | 11 |
12 namespace memory_coordinator { | 12 namespace content { |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 const int kKBperMB = 1024; | 16 const int kKBperMB = 1024; |
17 | 17 |
18 // A global static instance of the default delegate. Used by default by | 18 // A global static instance of the default delegate. Used by default by |
19 // MemoryMonitorWin. | 19 // MemoryMonitorWin. |
20 MemoryMonitorDelegate g_memory_monitor_win_delegate; | 20 MemoryMonitorDelegate g_memory_monitor_win_delegate; |
21 | 21 |
22 } // namespace | 22 } // namespace |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 if (IsLargeMemory(delegate)) | 69 if (IsLargeMemory(delegate)) |
70 return MemoryMonitorWin::kLargeMemoryTargetFreeMB; | 70 return MemoryMonitorWin::kLargeMemoryTargetFreeMB; |
71 return MemoryMonitorWin::kSmallMemoryTargetFreeMB; | 71 return MemoryMonitorWin::kSmallMemoryTargetFreeMB; |
72 } | 72 } |
73 | 73 |
74 // Implementation of factory function defined in memory_monitor.h. | 74 // Implementation of factory function defined in memory_monitor.h. |
75 std::unique_ptr<MemoryMonitor> CreateMemoryMonitor() { | 75 std::unique_ptr<MemoryMonitor> CreateMemoryMonitor() { |
76 return MemoryMonitorWin::Create(&g_memory_monitor_win_delegate); | 76 return MemoryMonitorWin::Create(&g_memory_monitor_win_delegate); |
77 } | 77 } |
78 | 78 |
79 } // namespace memory_coordinator | 79 } // namespace content |
OLD | NEW |