Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / tools / perf / measurements / timeline_controller.py
index 27a1ac6..9206751 100644 (file)
@@ -4,6 +4,7 @@
 from measurements import smooth_gesture_util
 
 from telemetry.core.platform import tracing_category_filter
+from telemetry.core.platform import tracing_options
 from telemetry.timeline.model import TimelineModel
 from telemetry.page.actions import action_runner
 from telemetry.web_perf import timeline_interaction_record as tir_module
@@ -28,13 +29,16 @@ class TimelineController(object):
     # Resets these member variables incase this object is reused.
     self._model = None
     self._renderer_process = None
-    if not tab.browser.supports_tracing:
+    if not tab.browser.platform.tracing_controller.IsChromeTracingSupported(
+      tab.browser):
       raise Exception('Not supported')
     category_filter = tracing_category_filter.TracingCategoryFilter(
         filter_string=self.trace_categories)
     for delay in page.GetSyntheticDelayCategories():
       category_filter.AddSyntheticDelay(delay)
-    tab.browser.StartTracing(category_filter)
+    options = tracing_options.TracingOptions()
+    options.enable_chrome_trace = True
+    tab.browser.platform.tracing_controller.Start(options, category_filter)
 
   def Start(self, tab):
     # Start the smooth marker for all actions.
@@ -46,7 +50,7 @@ class TimelineController(object):
     # End the smooth marker for all actions.
     self._interaction.End()
     # Stop tracing.
-    timeline_data = tab.browser.StopTracing()
+    timeline_data = tab.browser.platform.tracing_controller.Stop()
     self._model = TimelineModel(timeline_data)
     self._renderer_process = self._model.GetRendererProcessFromTabId(tab.id)
     renderer_thread = self.model.GetRendererThreadFromTabId(tab.id)
@@ -76,8 +80,8 @@ class TimelineController(object):
 
 
   def CleanUp(self, tab):
-    if tab.browser.is_tracing_running:
-      tab.browser.StopTracing()
+    if tab.browser.platform.tracing_controller.is_tracing_running:
+      tab.browser.platform.tracing_controller.Stop()
 
   @property
   def model(self):