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

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

Issue 164133002: [Telemetry] Refactor mac power monitoring to use the base PowerMonitor class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Follow review Created 6 years, 10 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/factory.py
diff --git a/tools/telemetry/telemetry/core/platform/factory.py b/tools/telemetry/telemetry/core/platform/factory.py
new file mode 100644
index 0000000000000000000000000000000000000000..ae136a92dc65072950b6320e487719046a42cd5b
--- /dev/null
+++ b/tools/telemetry/telemetry/core/platform/factory.py
@@ -0,0 +1,21 @@
+# Copyright 2014 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.
+
+import sys
+
+from telemetry import decorators
+from telemetry.core.platform import linux_platform_backend
+from telemetry.core.platform import mac_platform_backend
+from telemetry.core.platform import win_platform_backend
+
+@decorators.Cache
+def GetPlatformBackendForCurrentOS():
+ if sys.platform.startswith('linux'):
+ return linux_platform_backend.LinuxPlatformBackend()
+ elif sys.platform == 'darwin':
+ return mac_platform_backend.MacPlatformBackend()
+ elif sys.platform == 'win32':
+ return win_platform_backend.WinPlatformBackend()
+ else:
+ raise NotImplementedError()

Powered by Google App Engine
This is Rietveld 408576698