OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/media/capture/desktop_capture_device_aura.h" | 5 #include "content/browser/media/capture/desktop_capture_device_aura.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 | 228 |
229 return true; | 229 return true; |
230 } | 230 } |
231 | 231 |
232 void DesktopVideoCaptureMachine::Stop(const base::Closure& callback) { | 232 void DesktopVideoCaptureMachine::Stop(const base::Closure& callback) { |
233 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 233 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
234 power_save_blocker_.reset(); | 234 power_save_blocker_.reset(); |
235 | 235 |
236 // Stop observing compositor and window events. | 236 // Stop observing compositor and window events. |
237 if (desktop_window_) { | 237 if (desktop_window_) { |
238 if (desktop_window_->GetHost()) | 238 // In the host destructor the compositor is destroyed before the window |
Sergey Ulanov
2014/12/12 17:42:34
nit: add . at the end of the comment
| |
239 if (desktop_window_->GetHost() && desktop_window_->GetHost()->compositor()) | |
Sergey Ulanov
2014/12/12 17:42:34
Store GetHost() result so it doesn't have to be ca
| |
239 desktop_window_->GetHost()->compositor()->RemoveObserver(this); | 240 desktop_window_->GetHost()->compositor()->RemoveObserver(this); |
240 desktop_window_->RemoveObserver(this); | 241 desktop_window_->RemoveObserver(this); |
241 desktop_window_ = NULL; | 242 desktop_window_ = NULL; |
242 } | 243 } |
243 | 244 |
244 // Stop timer. | 245 // Stop timer. |
245 timer_.Stop(); | 246 timer_.Stop(); |
246 | 247 |
247 callback.Run(); | 248 callback.Run(); |
248 } | 249 } |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
532 scoped_ptr<Client> client) { | 533 scoped_ptr<Client> client) { |
533 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); | 534 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); |
534 core_->AllocateAndStart(params, client.Pass()); | 535 core_->AllocateAndStart(params, client.Pass()); |
535 } | 536 } |
536 | 537 |
537 void DesktopCaptureDeviceAura::StopAndDeAllocate() { | 538 void DesktopCaptureDeviceAura::StopAndDeAllocate() { |
538 core_->StopAndDeAllocate(); | 539 core_->StopAndDeAllocate(); |
539 } | 540 } |
540 | 541 |
541 } // namespace content | 542 } // namespace content |
OLD | NEW |