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

Unified Diff: tools/telemetry/telemetry/core/backends/chrome/tracing_backend.py

Issue 309533016: Remove the weak dictionary that maps tab objects to it markers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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/backends/chrome/tracing_backend.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/tracing_backend.py b/tools/telemetry/telemetry/core/backends/chrome/tracing_backend.py
index 9050c2f63091ed52fd0d61574e073dc02fdffd6e..7717df6459ddf4e4bed8ce43aa66da046acb7462 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/tracing_backend.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/tracing_backend.py
@@ -4,10 +4,8 @@
import logging
import re
-import weakref
from telemetry.core.backends.chrome import inspector_websocket
-from telemetry.core.backends.chrome import tracing_timeline_data
# All tracing categories not disabled-by-default
@@ -109,10 +107,6 @@ class TracingBackend(object):
self._category_filter = None
self._nesting = 0
self._tracing_data = []
- # Use a WeakKeyDictionary, because an ordinary dictionary could keep
- # references to Tab objects around until it gets garbage collected.
- # This would prevent telemetry from navigating to another page.
- self._tab_to_marker_mapping = weakref.WeakKeyDictionary()
@property
def is_tracing_running(self):
@@ -164,14 +158,11 @@ class TracingBackend(object):
def _GetTraceResult(self):
assert not self.is_tracing_running
- return tracing_timeline_data.TracingTimelineData(
- self._tracing_data, self._tab_to_marker_mapping)
+ return self._tracing_data
def _GetTraceResultAndReset(self):
result = self._GetTraceResult()
- # Reset tab to marker mapping for the next tracing run. Don't use clear(),
- # because a TraceResult may still hold a reference to the dictionary object.
- self._tab_to_marker_mapping = weakref.WeakKeyDictionary()
+
self._tracing_data = []
return result

Powered by Google App Engine
This is Rietveld 408576698