Chromium Code Reviews| 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 aura::WindowTreeHost* wth = desktop_window_->GetHost(); |
|
Sergey Ulanov
2014/12/12 18:46:53
Please use a more descriptive name.
From
http://go
| |
| 239 desktop_window_->GetHost()->compositor()->RemoveObserver(this); | 239 // In the host destructor the compositor is destroyed before the window. |
| 240 if (wth && wth->compositor()) | |
| 241 wth->compositor()->RemoveObserver(this); | |
| 240 desktop_window_->RemoveObserver(this); | 242 desktop_window_->RemoveObserver(this); |
| 241 desktop_window_ = NULL; | 243 desktop_window_ = NULL; |
| 242 } | 244 } |
| 243 | 245 |
| 244 // Stop timer. | 246 // Stop timer. |
| 245 timer_.Stop(); | 247 timer_.Stop(); |
| 246 | 248 |
| 247 callback.Run(); | 249 callback.Run(); |
| 248 } | 250 } |
| 249 | 251 |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 532 scoped_ptr<Client> client) { | 534 scoped_ptr<Client> client) { |
| 533 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); | 535 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); |
| 534 core_->AllocateAndStart(params, client.Pass()); | 536 core_->AllocateAndStart(params, client.Pass()); |
| 535 } | 537 } |
| 536 | 538 |
| 537 void DesktopCaptureDeviceAura::StopAndDeAllocate() { | 539 void DesktopCaptureDeviceAura::StopAndDeAllocate() { |
| 538 core_->StopAndDeAllocate(); | 540 core_->StopAndDeAllocate(); |
| 539 } | 541 } |
| 540 | 542 |
| 541 } // namespace content | 543 } // namespace content |
| OLD | NEW |