OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "config.h" | 5 #include "config.h" |
6 #include "platform/MemoryPurgeController.h" | 6 #include "platform/MemoryPurgeController.h" |
7 | 7 |
8 #include "platform/TraceEvent.h" | 8 #include "platform/TraceEvent.h" |
9 #include "public/platform/Platform.h" | 9 #include "public/platform/Platform.h" |
10 #include "wtf/Partitions.h" | 10 #include "wtf/Partitions.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 DEFINE_TRACE(MemoryPurgeClient) | 21 DEFINE_TRACE(MemoryPurgeClient) |
22 { | 22 { |
23 } | 23 } |
24 | 24 |
25 MemoryPurgeController::MemoryPurgeController() | 25 MemoryPurgeController::MemoryPurgeController() |
26 : m_deviceKind(Platform::current()->isLowEndDeviceMode() ? DeviceKind::LowEn
d : DeviceKind::NotSpecified) | 26 : m_deviceKind(Platform::current()->isLowEndDeviceMode() ? DeviceKind::LowEn
d : DeviceKind::NotSpecified) |
27 , m_inactiveTimer(this, &MemoryPurgeController::pageInactiveTask) | 27 , m_inactiveTimer(this, &MemoryPurgeController::pageInactiveTask) |
28 { | 28 { |
29 } | 29 } |
30 | 30 |
31 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(MemoryPurgeController); | 31 MemoryPurgeController::~MemoryPurgeController() |
| 32 { |
| 33 } |
32 | 34 |
33 void MemoryPurgeController::pageBecameActive() | 35 void MemoryPurgeController::pageBecameActive() |
34 { | 36 { |
35 m_inactiveTimer.stop(); | 37 m_inactiveTimer.stop(); |
36 } | 38 } |
37 | 39 |
38 void MemoryPurgeController::pageBecameInactive() | 40 void MemoryPurgeController::pageBecameInactive() |
39 { | 41 { |
40 if (!m_inactiveTimer.isActive()) | 42 if (!m_inactiveTimer.isActive()) |
41 m_inactiveTimer.startOneShot(kInactiveTimerIntervalInSecond, BLINK_FROM_
HERE); | 43 m_inactiveTimer.startOneShot(kInactiveTimerIntervalInSecond, BLINK_FROM_
HERE); |
(...skipping 13 matching lines...) Expand all Loading... |
55 } | 57 } |
56 | 58 |
57 DEFINE_TRACE(MemoryPurgeController) | 59 DEFINE_TRACE(MemoryPurgeController) |
58 { | 60 { |
59 #if ENABLE(OILPAN) | 61 #if ENABLE(OILPAN) |
60 visitor->trace(m_clients); | 62 visitor->trace(m_clients); |
61 #endif | 63 #endif |
62 } | 64 } |
63 | 65 |
64 } // namespace blink | 66 } // namespace blink |
OLD | NEW |