| 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(); | |
| 123 } | 120 } |
| 124 | 121 |
| 125 void AuraWindowCaptureMachine::Stop(const base::Closure& callback) { | 122 void AuraWindowCaptureMachine::Stop(const base::Closure& callback) { |
| 126 // Stops the capture machine asynchronously. | 123 // Stops the capture machine asynchronously. |
| 127 BrowserThread::PostTask( | 124 BrowserThread::PostTask( |
| 128 BrowserThread::UI, FROM_HERE, base::Bind( | 125 BrowserThread::UI, FROM_HERE, base::Bind( |
| 129 &AuraWindowCaptureMachine::InternalStop, | 126 &AuraWindowCaptureMachine::InternalStop, |
| 130 base::Unretained(this), | 127 base::Unretained(this), |
| 131 callback)); | 128 callback)); |
| 132 } | 129 } |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 Capture(timestamp); | 437 Capture(timestamp); |
| 441 } | 438 } |
| 442 | 439 |
| 443 void AuraWindowCaptureMachine::OnCompositingShuttingDown( | 440 void AuraWindowCaptureMachine::OnCompositingShuttingDown( |
| 444 ui::Compositor* compositor) { | 441 ui::Compositor* compositor) { |
| 445 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 442 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 446 compositor->RemoveAnimationObserver(this); | 443 compositor->RemoveAnimationObserver(this); |
| 447 } | 444 } |
| 448 | 445 |
| 449 } // namespace content | 446 } // namespace content |
| OLD | NEW |