| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/image_capture_impl.h" | 5 #include "content/browser/media/capture/image_capture_impl.h" |
| 6 | 6 |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "content/browser/browser_main_loop.h" | 8 #include "content/browser/browser_main_loop.h" |
| 9 #include "content/browser/renderer_host/media/media_stream_manager.h" | 9 #include "content/browser/renderer_host/media/media_stream_manager.h" |
| 10 #include "content/browser/renderer_host/media/video_capture_manager.h" | 10 #include "content/browser/renderer_host/media/video_capture_manager.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 98 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 99 | 99 |
| 100 media::ScopedResultCallback<TakePhotoCallback> scoped_callback( | 100 media::ScopedResultCallback<TakePhotoCallback> scoped_callback( |
| 101 base::Bind(&RunTakePhotoCallbackOnUIThread, callback), | 101 base::Bind(&RunTakePhotoCallbackOnUIThread, callback), |
| 102 media::BindToCurrentLoop(base::Bind(&RunFailedTakePhotoCallback))); | 102 media::BindToCurrentLoop(base::Bind(&RunFailedTakePhotoCallback))); |
| 103 | 103 |
| 104 // media_stream_manager() can only be called on UI thread. | 104 // media_stream_manager() can only be called on UI thread. |
| 105 BrowserThread::PostTask( | 105 BrowserThread::PostTask( |
| 106 BrowserThread::IO, FROM_HERE, | 106 BrowserThread::IO, FROM_HERE, |
| 107 base::Bind(&TakePhotoOnIOThread, source_id, | 107 base::Bind(&TakePhotoOnIOThread, source_id, |
| 108 BrowserMainLoop::GetInstance()->media_stream_manager(), | 108 BrowserMainLoop::GetInstance()->GetMediaStreamManager(), |
| 109 base::Passed(&scoped_callback))); | 109 base::Passed(&scoped_callback))); |
| 110 } | 110 } |
| 111 | 111 |
| 112 ImageCaptureImpl::ImageCaptureImpl( | 112 ImageCaptureImpl::ImageCaptureImpl( |
| 113 mojo::InterfaceRequest<media::mojom::ImageCapture> request) | 113 mojo::InterfaceRequest<media::mojom::ImageCapture> request) |
| 114 : binding_(this, std::move(request)) {} | 114 : binding_(this, std::move(request)) {} |
| 115 | 115 |
| 116 } // namespace content | 116 } // namespace content |
| OLD | NEW |