| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |