Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1505)

Unified Diff: content/browser/renderer_host/media/desktop_capture_device_aura.cc

Issue 100833002: Add AshDesktopMediaList and enable Desktop Capture API on Chrome OS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | ui/snapshot/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/desktop_capture_device_aura.cc
diff --git a/content/browser/renderer_host/media/desktop_capture_device_aura.cc b/content/browser/renderer_host/media/desktop_capture_device_aura.cc
index a36d26b8b5f8955646ba33964c72a9e55a133769..15e86f0323ba9008d4343158284d088d587c120e 100644
--- a/content/browser/renderer_host/media/desktop_capture_device_aura.cc
+++ b/content/browser/renderer_host/media/desktop_capture_device_aura.cc
@@ -217,14 +217,17 @@ void DesktopVideoCaptureMachine::Stop() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Stop observing window events.
- if (desktop_window_)
+ if (desktop_window_) {
desktop_window_->RemoveObserver(this);
+ desktop_window_ = NULL;
+ }
// Stop observing compositor updates.
if (desktop_layer_) {
ui::Compositor* compositor = desktop_layer_->GetCompositor();
if (compositor)
compositor->RemoveObserver(this);
+ desktop_layer_ = NULL;
}
// Stop timer.
@@ -290,7 +293,7 @@ void DesktopVideoCaptureMachine::DidCopyOutput(
base::Time start_time,
const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb,
scoped_ptr<cc::CopyOutputResult> result) {
- if (result->IsEmpty() || result->size().IsEmpty())
+ if (result->IsEmpty() || result->size().IsEmpty() || !desktop_layer_)
return;
// Compute the dest size we want after the letterboxing resize. Make the
@@ -396,13 +399,11 @@ void DesktopVideoCaptureMachine::OnWindowBoundsChanged(
}
void DesktopVideoCaptureMachine::OnWindowDestroyed(aura::Window* window) {
- DCHECK(desktop_window_ && window == desktop_window_);
- desktop_window_ = NULL;
- desktop_layer_ = NULL;
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- // Post task to stop capture on UI thread.
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
- &DesktopVideoCaptureMachine::Stop, AsWeakPtr()));
+ Stop();
+
+ oracle_proxy_->ReportError();
}
void DesktopVideoCaptureMachine::OnCompositingEnded(
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | ui/snapshot/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698