| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/media_stream_ui_proxy.h" | 5 #include "content/browser/renderer_host/media/media_stream_ui_proxy.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "content/browser/frame_host/render_frame_host_delegate.h" | 8 #include "content/browser/frame_host/render_frame_host_delegate.h" |
| 9 #include "content/browser/frame_host/render_frame_host_impl.h" | 9 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 MediaStreamUIProxy::MediaStreamUIProxy( | 122 MediaStreamUIProxy::MediaStreamUIProxy( |
| 123 RenderFrameHostDelegate* test_render_delegate) | 123 RenderFrameHostDelegate* test_render_delegate) |
| 124 : weak_factory_(this) { | 124 : weak_factory_(this) { |
| 125 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 125 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 126 core_.reset(new Core(weak_factory_.GetWeakPtr(), test_render_delegate)); | 126 core_.reset(new Core(weak_factory_.GetWeakPtr(), test_render_delegate)); |
| 127 } | 127 } |
| 128 | 128 |
| 129 MediaStreamUIProxy::~MediaStreamUIProxy() { | 129 MediaStreamUIProxy::~MediaStreamUIProxy() { |
| 130 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 130 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 131 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, core_.release()); | |
| 132 } | 131 } |
| 133 | 132 |
| 134 void MediaStreamUIProxy::RequestAccess( | 133 void MediaStreamUIProxy::RequestAccess( |
| 135 const MediaStreamRequest& request, | 134 const MediaStreamRequest& request, |
| 136 const ResponseCallback& response_callback) { | 135 const ResponseCallback& response_callback) { |
| 137 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 136 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 138 | 137 |
| 139 response_callback_ = response_callback; | 138 response_callback_ = response_callback; |
| 140 BrowserThread::PostTask( | 139 BrowserThread::PostTask( |
| 141 BrowserThread::UI, FROM_HERE, | 140 BrowserThread::UI, FROM_HERE, |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 devices_to_use.empty() ? | 256 devices_to_use.empty() ? |
| 258 MEDIA_DEVICE_NO_HARDWARE : | 257 MEDIA_DEVICE_NO_HARDWARE : |
| 259 MEDIA_DEVICE_OK)); | 258 MEDIA_DEVICE_OK)); |
| 260 } | 259 } |
| 261 | 260 |
| 262 void FakeMediaStreamUIProxy::OnStarted( | 261 void FakeMediaStreamUIProxy::OnStarted( |
| 263 const base::Closure& stop_callback, | 262 const base::Closure& stop_callback, |
| 264 const WindowIdCallback& window_id_callback) {} | 263 const WindowIdCallback& window_id_callback) {} |
| 265 | 264 |
| 266 } // namespace content | 265 } // namespace content |
| OLD | NEW |