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

Unified Diff: tools/telemetry/telemetry/core/platform/mac_platform_backend.py

Issue 20766003: [Telemetry] Add the ability to flush the system file cache to platform. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simpler Android support Created 7 years, 5 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
Index: tools/telemetry/telemetry/core/platform/mac_platform_backend.py
diff --git a/tools/telemetry/telemetry/core/platform/mac_platform_backend.py b/tools/telemetry/telemetry/core/platform/mac_platform_backend.py
index 7582090de34619517cd324b8845ce52a1c112958..8e707151fa4f32360fe6b4e33b026ba78ef574b7 100644
--- a/tools/telemetry/telemetry/core/platform/mac_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/mac_platform_backend.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import os
+import subprocess
try:
import resource # pylint: disable=F0401
except ImportError:
@@ -61,3 +62,11 @@ class MacPlatformBackend(posix_platform_backend.PosixPlatformBackend):
return 'mountainlion'
#if os_version.startswith('13.'):
# return 'mavericks'
+
+ def CanFlushIndividualFilesFromSystemCache(self):
+ return False
+
+ def FlushEntireSystemCache(self):
+ p = subprocess.Popen(['purge'])
+ p.wait()
+ assert p.returncode == 0, 'Failed to flush system cache'

Powered by Google App Engine
This is Rietveld 408576698