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

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

Issue 798483004: Implement FlushSystemCacheForDirectory for Chrome OS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove |ignoring| Created 6 years 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/desktop_platform_backend.py
diff --git a/tools/telemetry/telemetry/core/platform/desktop_platform_backend.py b/tools/telemetry/telemetry/core/platform/desktop_platform_backend.py
index 9a5b9224df5f53f0ce889ea223caed286aa0bd04..bbfb5fff5795871cb2428054a780b9531d3f023f 100644
--- a/tools/telemetry/telemetry/core/platform/desktop_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/desktop_platform_backend.py
@@ -14,7 +14,7 @@ class DesktopPlatformBackend(platform_backend.PlatformBackend):
# This is an abstract class. It is OK to have abstract methods.
# pylint: disable=W0223
- def FlushSystemCacheForDirectory(self, directory, ignoring=None):
+ def FlushSystemCacheForDirectory(self, directory):
assert directory and os.path.exists(directory), \
'Target directory %s must exist' % directory
flush_command = support_binaries.FindPath('clear_system_cache',
@@ -22,19 +22,4 @@ class DesktopPlatformBackend(platform_backend.PlatformBackend):
self.GetOSName())
assert flush_command, 'You must build clear_system_cache first'
- args = []
- directory_contents = os.listdir(directory)
- for item in directory_contents:
- if not ignoring or item not in ignoring:
- args.append(os.path.join(directory, item))
-
- # According to msdn:
- # http://msdn.microsoft.com/en-us/library/ms682425%28VS.85%29.aspx
- # there's a maximum allowable command line of 32,768 characters on windows.
- while args:
- # Small note about [:256] and [256:]
- # [:N] will return a list with the first N elements, ie.
- # with [1,2,3,4,5], [:2] -> [1,2], and [2:] -> [3,4,5]
- # with [1,2,3,4,5], [:5] -> [1,2,3,4,5] and [5:] -> []
- subprocess.check_call([flush_command, '--recurse'] + args[:256])
- args = args[256:]
+ subprocess.check_call([flush_command, '--recurse', directory])

Powered by Google App Engine
This is Rietveld 408576698