summaryrefslogtreecommitdiffstats
path: root/remoting/host/screen_recorder.cc
diff options
context:
space:
mode:
authordcaiafa@chromium.org <dcaiafa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-26 03:56:59 +0000
committerdcaiafa@chromium.org <dcaiafa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-26 03:56:59 +0000
commit213aa2bbf00ed7db787e0a2a541df1f559cad11e (patch)
tree42d98a3cce4ef1e345bf361e9163abd7875fe4cc /remoting/host/screen_recorder.cc
parent87717d0e2edb64b8d948794d070e9a3fa75ef059 (diff)
downloadchromium_src-213aa2bbf00ed7db787e0a2a541df1f559cad11e.zip
chromium_src-213aa2bbf00ed7db787e0a2a541df1f559cad11e.tar.gz
chromium_src-213aa2bbf00ed7db787e0a2a541df1f559cad11e.tar.bz2
Fix crash on disconnect for Mac
The fix for 120429 introduced a timer in CapturerMac, to release the power assertion after a period of inactivity. Unfortunately, the Capturer is released in a thread other than the one where capturing occurs and where the timer was created. This revision changes the approach by introducing two new methods, Start() and Stop(), to the Capturer abstract class to be called by the screen recorder before and after a session, respectively. This eliminates the need of a timer since there is a deterministic time (Stop) to release the power assertion. Start and Stop are no-ops in the CapturerLinux and CapturerGDI. BUG=124947 TEST=unittests, manual Review URL: http://codereview.chromium.org/10225018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134056 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/screen_recorder.cc')
-rw-r--r--remoting/host/screen_recorder.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/remoting/host/screen_recorder.cc b/remoting/host/screen_recorder.cc
index da9ab8b..ab96a53 100644
--- a/remoting/host/screen_recorder.cc
+++ b/remoting/host/screen_recorder.cc
@@ -68,6 +68,7 @@ void ScreenRecorder::Stop(const base::Closure& done_task) {
DCHECK(!done_task.is_null());
+ capturer()->Stop();
capture_timer_.reset();
network_loop_->PostTask(FROM_HERE, base::Bind(
@@ -141,6 +142,7 @@ void ScreenRecorder::DoStart() {
return;
}
+ capturer()->Start();
capture_timer_.reset(new base::OneShotTimer<ScreenRecorder>());
// Capture first frame immedately.