| Index: tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py
|
| diff --git a/tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py b/tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py
|
| index 3bbe6bf823fea02ea4f64a7c62e8649e2215e2b9..14cf6f7e4a2d566421ca8b61e1c59a2a1f3955ae 100644
|
| --- a/tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py
|
| +++ b/tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py
|
| @@ -122,5 +122,19 @@ class TCMallocHeapProfiler(profiler.Profiler):
|
| options.AppendExtraBrowserArgs('--no-sandbox')
|
| options.AppendExtraBrowserArgs('--enable-memory-benchmarking')
|
|
|
| + @classmethod
|
| + def WillCloseBrowser(cls, browser_backend, platform_backend):
|
| + # The tcmalloc_heap_profiler dumps files at regular
|
| + # intervals (~20 secs).
|
| + # This is a minor optimization to ensure it'll dump the last file when
|
| + # the test completes.
|
| + for i in xrange(len(browser_backend.browser.tabs)):
|
| + browser_backend.browser.tabs[i].ExecuteJavaScript("""
|
| + if (chrome && chrome.memoryBenchmarking) {
|
| + chrome.memoryBenchmarking.heapProfilerDump('renderer', 'final');
|
| + chrome.memoryBenchmarking.heapProfilerDump('browser', 'final');
|
| + }
|
| + """)
|
| +
|
| def CollectProfile(self):
|
| return self._platform_profiler.CollectProfile()
|
|
|