OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "config.h" |
| 6 #include "platform/MemoryPurgeController.h" |
| 7 |
| 8 #include "public/platform/Platform.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 MemoryPurgeController::MemoryPurgeController() |
| 13 : m_deviceKind(Platform::current()->isLowEndDeviceMode() ? LowEnd : NotSpeci
fied) |
| 14 { |
| 15 } |
| 16 |
| 17 void MemoryPurgeController::didBecomeInactive() |
| 18 { |
| 19 purgeMemory(Inactive); |
| 20 } |
| 21 |
| 22 void MemoryPurgeController::purgeMemory(MemoryPurgeMode purgeMode) |
| 23 { |
| 24 for (auto& listener : m_listeners) |
| 25 listener->purgeMemory(purgeMode, m_deviceKind); |
| 26 } |
| 27 |
| 28 } // namespace blink |
OLD | NEW |