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_manager.h" | 5 #include "content/browser/renderer_host/media/media_stream_manager.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 539 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
540 | 540 |
541 // Only cache device list when there is EnumerateDevices request, since | 541 // Only cache device list when there is EnumerateDevices request, since |
542 // other requests don't turn on device monitoring. | 542 // other requests don't turn on device monitoring. |
543 bool need_update_clients = false; | 543 bool need_update_clients = false; |
544 EnumerationCache* cache = | 544 EnumerationCache* cache = |
545 (stream_type == content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE ? | 545 (stream_type == content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE ? |
546 &audio_enumeration_cache_ : &video_enumeration_cache_); | 546 &audio_enumeration_cache_ : &video_enumeration_cache_); |
547 if (HasEnumerationRequest(stream_type) && | 547 if (HasEnumerationRequest(stream_type) && |
548 (!cache->valid || | 548 (!cache->valid || |
| 549 devices.size() != cache->devices.size() || |
549 !std::equal(devices.begin(), devices.end(), cache->devices.begin(), | 550 !std::equal(devices.begin(), devices.end(), cache->devices.begin(), |
550 media_stream::StreamDeviceInfo::IsEqual))) { | 551 media_stream::StreamDeviceInfo::IsEqual))) { |
551 cache->valid = true; | 552 cache->valid = true; |
552 cache->devices = devices; | 553 cache->devices = devices; |
553 need_update_clients = true; | 554 need_update_clients = true; |
554 } | 555 } |
555 | 556 |
556 // Publish the result for all requests waiting for device list(s). | 557 // Publish the result for all requests waiting for device list(s). |
557 // Find the requests waiting for this device list, store their labels and | 558 // Find the requests waiting for this device list, store their labels and |
558 // release the iterator before calling device settings. We might get a call | 559 // release the iterator before calling device settings. We might get a call |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 it != requests_.end(); ++it) { | 873 it != requests_.end(); ++it) { |
873 if (it->second.type == DeviceRequest::ENUMERATE_DEVICES && | 874 if (it->second.type == DeviceRequest::ENUMERATE_DEVICES && |
874 Requested(it->second.options, stream_type)) { | 875 Requested(it->second.options, stream_type)) { |
875 return true; | 876 return true; |
876 } | 877 } |
877 } | 878 } |
878 return false; | 879 return false; |
879 } | 880 } |
880 | 881 |
881 } // namespace media_stream | 882 } // namespace media_stream |
OLD | NEW |