| 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/aura_window_capture_machine.h" | 5 #include "content/browser/media/capture/aura_window_capture_machine.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 void AuraWindowCaptureMachine::Resume() { | 110 void AuraWindowCaptureMachine::Resume() { |
| 111 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 111 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 112 base::Bind(&AuraWindowCaptureMachine::InternalResume, | 112 base::Bind(&AuraWindowCaptureMachine::InternalResume, |
| 113 base::Unretained(this))); | 113 base::Unretained(this))); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void AuraWindowCaptureMachine::InternalResume() { | 116 void AuraWindowCaptureMachine::InternalResume() { |
| 117 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 117 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 118 DVLOG(1) << "Resuming frame capture and delivery."; | 118 DVLOG(1) << "Resuming frame capture and delivery."; |
| 119 frame_capture_active_ = true; | 119 frame_capture_active_ = true; |
| 120 // Whenever capture resumes, capture a refresh frame immediately to make sure |
| 121 // no content updates are missing from the video stream. |
| 122 MaybeCaptureForRefresh(); |
| 120 } | 123 } |
| 121 | 124 |
| 122 void AuraWindowCaptureMachine::Stop(const base::Closure& callback) { | 125 void AuraWindowCaptureMachine::Stop(const base::Closure& callback) { |
| 123 // Stops the capture machine asynchronously. | 126 // Stops the capture machine asynchronously. |
| 124 BrowserThread::PostTask( | 127 BrowserThread::PostTask( |
| 125 BrowserThread::UI, FROM_HERE, base::Bind( | 128 BrowserThread::UI, FROM_HERE, base::Bind( |
| 126 &AuraWindowCaptureMachine::InternalStop, | 129 &AuraWindowCaptureMachine::InternalStop, |
| 127 base::Unretained(this), | 130 base::Unretained(this), |
| 128 callback)); | 131 callback)); |
| 129 } | 132 } |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 Capture(timestamp); | 440 Capture(timestamp); |
| 438 } | 441 } |
| 439 | 442 |
| 440 void AuraWindowCaptureMachine::OnCompositingShuttingDown( | 443 void AuraWindowCaptureMachine::OnCompositingShuttingDown( |
| 441 ui::Compositor* compositor) { | 444 ui::Compositor* compositor) { |
| 442 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 445 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 443 compositor->RemoveAnimationObserver(this); | 446 compositor->RemoveAnimationObserver(this); |
| 444 } | 447 } |
| 445 | 448 |
| 446 } // namespace content | 449 } // namespace content |
| OLD | NEW |