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

Side by Side Diff: content/browser/renderer_host/media/video_capture_host.cc

Issue 2408853002: VideoCaptureHost: Remove |controllers_| entry before calling VideoCaptureManager::StopCaptureForCli… (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer_host/media/video_capture_host.h" 5 #include "content/browser/renderer_host/media/video_capture_host.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 } 289 }
290 290
291 void VideoCaptureHost::DeleteVideoCaptureController( 291 void VideoCaptureHost::DeleteVideoCaptureController(
292 VideoCaptureControllerID controller_id, bool on_error) { 292 VideoCaptureControllerID controller_id, bool on_error) {
293 DCHECK_CURRENTLY_ON(BrowserThread::IO); 293 DCHECK_CURRENTLY_ON(BrowserThread::IO);
294 294
295 auto it = controllers_.find(controller_id); 295 auto it = controllers_.find(controller_id);
296 if (it == controllers_.end()) 296 if (it == controllers_.end())
297 return; 297 return;
298 298
299 if (it->second) { 299 const base::WeakPtr<VideoCaptureController> controller = it->second;
300 media_stream_manager_->video_capture_manager()->StopCaptureForClient(
301 it->second.get(), controller_id, this, on_error);
302 }
303 controllers_.erase(it); 300 controllers_.erase(it);
301 if (!controller)
302 return;
303
304 media_stream_manager_->video_capture_manager()->StopCaptureForClient(
305 controller.get(), controller_id, this, on_error);
304 } 306 }
305 307
306 } // namespace content 308 } // namespace content
OLDNEW
« 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