Reviewers: kjellander, tandrii(chromium),

Message:
PTAL. Code dup removed. Fragile base class problem introduced...

Description:
[test] Refactoring: Remove code duplication in perf runner.

BUG=484208
LOG=n
[email protected]
NOTRY=true

Please review this at https://codereview.chromium.org/1139833003/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+6, -4 lines):
  M tools/run_perf.py


Index: tools/run_perf.py
diff --git a/tools/run_perf.py b/tools/run_perf.py
index 501aacedbbc05fe8582a65349cd34662a5649231..b09d5b5ed596fcc53d453fe239368a071595eb7b 100755
--- a/tools/run_perf.py
+++ b/tools/run_perf.py
@@ -464,6 +464,10 @@ def FlattenRunnables(node, node_cb):


 class Platform(object):
+  def __init__(self, options):
+    self.shell_dir = options.shell_dir
+    self.extra_flags = options.extra_flags.split()
+
   @staticmethod
   def GetPlatform(options):
     if options.arch.startswith("android"):
@@ -474,8 +478,7 @@ class Platform(object):

 class DesktopPlatform(Platform):
   def __init__(self, options):
-    self.shell_dir = options.shell_dir
-    self.extra_flags = options.extra_flags.split()
+    super(DesktopPlatform, self).__init__(options)

   def PreExecution(self):
     pass
@@ -512,8 +515,7 @@ class AndroidPlatform(Platform):  # pragma: no cover
   DEVICE_DIR = "/data/local/tmp/v8/"

   def __init__(self, options):
-    self.shell_dir = options.shell_dir
-    self.extra_flags = options.extra_flags.split()
+    super(AndroidPlatform, self).__init__(options)
     LoadAndroidBuildTools(options.android_build_tools)

     if not options.device:


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to