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

Unified Diff: content/renderer/media/media_stream_video_capturer_source.cc

Issue 2408143004: Bug fix: stop mirroring session when tab is closed. (Closed)
Patch Set: Addressed comments. Created 4 years, 2 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_video_capturer_source.cc
diff --git a/content/renderer/media/media_stream_video_capturer_source.cc b/content/renderer/media/media_stream_video_capturer_source.cc
index b04383dbee35ef5b385cf36e076df458d8832aa2..d69c6be975414aa4e3c46bf7b87808aabec972c9 100644
--- a/content/renderer/media/media_stream_video_capturer_source.cc
+++ b/content/renderer/media/media_stream_video_capturer_source.cc
@@ -233,11 +233,10 @@ class LocalVideoCapturerSource final : public media::VideoCapturerSource {
// Indicates if we are capturing generated content, e.g. Tab or Desktop.
const bool is_content_capture_;
- // This is run once to report whether the device was successfully started
- // after a call to StartCapture().
+ // These two are valid between StartCapture() and StopCapture().
+ // |running_call_back_| is run when capture is successfully started, and when
+ // it is stopped or error happens.
RunningCallback running_callback_;
-
- // This is valid between StartCapture() and StopCapture().
base::Closure stop_capture_cb_;
// Placeholder keeping the callback between asynchronous device enumeration
@@ -355,7 +354,7 @@ void LocalVideoCapturerSource::OnStateUpdate(VideoCaptureState state) {
return;
switch (state) {
case VIDEO_CAPTURE_STATE_STARTED:
- base::ResetAndReturn(&running_callback_).Run(true);
+ running_callback_.Run(true);
break;
case VIDEO_CAPTURE_STATE_STOPPING:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698