Index: Source/platform/MemoryPurgeController.cpp |
diff --git a/Source/platform/MemoryPurgeController.cpp b/Source/platform/MemoryPurgeController.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..03d09cb95b804d59bbbc4cfb0e903dfd82f368a0 |
--- /dev/null |
+++ b/Source/platform/MemoryPurgeController.cpp |
@@ -0,0 +1,30 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "config.h" |
+#include "platform/MemoryPurgeController.h" |
+ |
+#include "public/platform/Platform.h" |
+ |
+namespace blink { |
+ |
+MemoryPurgeController::MemoryPurgeController() |
+ : m_deviceKind(Platform::current()->isLowEndDeviceMode() ? DeviceKind::LowEnd : DeviceKind::NotSpecified) |
+{ |
+} |
+ |
+void MemoryPurgeController::purgeMemory(MemoryPurgeMode purgeMode) |
+{ |
+ for (auto& client : m_clients) |
+ client->purgeMemory(purgeMode, m_deviceKind); |
+} |
+ |
+DEFINE_TRACE(MemoryPurgeController) |
+{ |
+#if ENABLE(OILPAN) |
+ visitor->trace(m_clients); |
+#endif |
+} |
+ |
+} // namespace blink |