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

Unified Diff: tools/telemetry/telemetry/core/chrome/system_info_backend.py

Issue 21682002: Expose GPU information to Telemetry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactored more code into WebSocketBrowserConnection on nduca's request. Created 7 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
Index: tools/telemetry/telemetry/core/chrome/system_info_backend.py
diff --git a/tools/telemetry/telemetry/core/chrome/system_info_backend.py b/tools/telemetry/telemetry/core/chrome/system_info_backend.py
new file mode 100644
index 0000000000000000000000000000000000000000..ba4fe1dbc6b9c5e0b5a7395655bb60ac50b54a7b
--- /dev/null
+++ b/tools/telemetry/telemetry/core/chrome/system_info_backend.py
@@ -0,0 +1,23 @@
+# Copyright (c) 2013 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.
+
+from telemetry.core import system_info
+from telemetry.core.chrome import websocket_browser_connection as browser_conn
+from telemetry.core.chrome import camel_case_converter as camel_case
+
+
+class SystemInfoBackend(object):
+ def __init__(self, devtools_port):
+ self._conn = browser_conn.WebSocketBrowserConnection(devtools_port)
+
+ def Close(self):
+ self._conn.Close()
+
+ def GetSystemInfo(self, timeout=10):
+ req = {'method': 'SystemInfo.getInfo'}
+ res = self._conn.SyncRequest(req, timeout)
+ if 'error' in res:
+ return None
+ return system_info.SystemInfo.FromDict(
+ camel_case.CamelCaseConverter.FromCamelCase(res['result']))

Powered by Google App Engine
This is Rietveld 408576698