[DevTools] [PowerProfiler] Fix for browser crash with active timeline recording for...
commita5f1381df5298cece7fb7c2d3b446b7d5478b629
authorvivek.vg@samsung.com <vivek.vg@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 20 Jun 2014 19:33:44 +0000 (20 19:33 +0000)
committervivek.vg@samsung.com <vivek.vg@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 20 Jun 2014 19:33:44 +0000 (20 19:33 +0000)
tree9689e2af93dfe85780a5723c67b7e6895c8ace41
parentac4a1b1e79b0877aad2a41344f479f1d4341b205
[DevTools] [PowerProfiler] Fix for browser crash with active timeline recording for capturing power.

The PowerProfilerService is a singleton class. It stores the PowerProfilerObserver to notify
about the power events. With the active timeline recording, the DevToolsPowerHandler registers
itself as the observer. When the tab close event occurs, the DevToolsPowerHandler is killed.
But the PowerProfilerService still contains a dangling reference to the observer thereby
causing the crash.

With this CL, DevToolsPowerHandler will remove itself from the observer to avoid the dangling
reference with the PowerProfilerService.

BUG=383725

Review URL: https://codereview.chromium.org/332623003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278798 0039d316-1c4b-4281-b951-d872f2087c98
content/browser/devtools/devtools_power_handler.cc
content/browser/power_profiler/power_profiler_service.cc