Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Unified Diff: Source/platform/MemoryPurgeController.cpp

Issue 1303203002: Add MemoryPurgeController (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/MemoryPurgeController.h ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/platform/MemoryPurgeController.h ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698