| 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/media_stream_device_settings.h" | 5 #include "content/browser/renderer_host/media/media_stream_device_settings.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 MediaStreamDeviceSettingsRequest* request = request_it->second; | 143 MediaStreamDeviceSettingsRequest* request = request_it->second; |
| 144 DCHECK_EQ(request->devices_full.count(stream_type), static_cast<size_t>(0)) << | 144 DCHECK_EQ(request->devices_full.count(stream_type), static_cast<size_t>(0)) << |
| 145 "This request already has a list of devices for this stream type."; | 145 "This request already has a list of devices for this stream type."; |
| 146 request->devices_full[stream_type] = devices; | 146 request->devices_full[stream_type] = devices; |
| 147 | 147 |
| 148 // Check if we're done. | 148 // Check if we're done. |
| 149 size_t num_media_requests = 0; | 149 size_t num_media_requests = 0; |
| 150 if (request->options.audio) { | 150 if (request->options.audio) { |
| 151 num_media_requests++; | 151 num_media_requests++; |
| 152 } | 152 } |
| 153 if (request->options.video_option != StreamOptions::kNoCamera) { | 153 if (request->options.video) { |
| 154 num_media_requests++; | 154 num_media_requests++; |
| 155 } | 155 } |
| 156 | 156 |
| 157 if (request->devices_full.size() == num_media_requests) { | 157 if (request->devices_full.size() == num_media_requests) { |
| 158 // We have all answers needed. | 158 // We have all answers needed. |
| 159 if (!use_fake_ui_) { | 159 if (!use_fake_ui_) { |
| 160 // Abort if the task was already posted: wait for it to PostResponse. | 160 // Abort if the task was already posted: wait for it to PostResponse. |
| 161 if (request->posted_task) { | 161 if (request->posted_task) { |
| 162 return; | 162 return; |
| 163 } | 163 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 delete req->second; | 250 delete req->second; |
| 251 requests_.erase(req); | 251 requests_.erase(req); |
| 252 } | 252 } |
| 253 | 253 |
| 254 void MediaStreamDeviceSettings::UseFakeUI() { | 254 void MediaStreamDeviceSettings::UseFakeUI() { |
| 255 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 255 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 256 use_fake_ui_ = true; | 256 use_fake_ui_ = true; |
| 257 } | 257 } |
| 258 | 258 |
| 259 } // namespace media_stream | 259 } // namespace media_stream |
| OLD | NEW |