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

Unified Diff: tools/android/loading/devtools_monitor.py

Issue 2672803002: [Telemetry refactor] Migrate clients to new JavaScript API (batch 3) (Closed)
Patch Set: add comment on tools/android Created 3 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/android/loading/devtools_monitor.py
diff --git a/tools/android/loading/devtools_monitor.py b/tools/android/loading/devtools_monitor.py
index b64e468d5c210c447c8cd7178214f27413e93382..aa6ba53a1ca5b9d2c2e2f14ce6ecd73e52b17199 100644
--- a/tools/android/loading/devtools_monitor.py
+++ b/tools/android/loading/devtools_monitor.py
@@ -288,6 +288,11 @@ class DevToolsConnection(object):
Returns:
The return value from the JavaScript expression.
"""
+ # Note: Clients may be tempted to do naive string interpolation to inject
+ # Python values into the JavaScript expression, which could lead to syntax
+ # errors during evaluation (e.g. injecting strings with special characters).
+ # If this becomes an issue, consider extending the interface of this method
+ # as in: https://github.com/catapult-project/catapult/issues/3028
response = self.SyncRequest('Runtime.evaluate', {
'expression': expression,
'returnByValue': True})

Powered by Google App Engine
This is Rietveld 408576698