| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2088 return subscriber == item; | 2088 return subscriber == item; |
| 2089 }) == device_change_subscribers_.end()); | 2089 }) == device_change_subscribers_.end()); |
| 2090 device_change_subscribers_.push_back(subscriber); | 2090 device_change_subscribers_.push_back(subscriber); |
| 2091 } | 2091 } |
| 2092 | 2092 |
| 2093 void MediaStreamManager::CancelDeviceChangeNotifications( | 2093 void MediaStreamManager::CancelDeviceChangeNotifications( |
| 2094 MediaStreamRequester* subscriber) { | 2094 MediaStreamRequester* subscriber) { |
| 2095 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 2095 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 2096 auto it = std::find(device_change_subscribers_.begin(), | 2096 auto it = std::find(device_change_subscribers_.begin(), |
| 2097 device_change_subscribers_.end(), subscriber); | 2097 device_change_subscribers_.end(), subscriber); |
| 2098 CHECK(it != device_change_subscribers_.end()); | 2098 DCHECK(it != device_change_subscribers_.end()); |
| 2099 device_change_subscribers_.erase(it); | 2099 device_change_subscribers_.erase(it); |
| 2100 } | 2100 } |
| 2101 | 2101 |
| 2102 void MediaStreamManager::NotifyDeviceChangeSubscribers(MediaStreamType type) { | 2102 void MediaStreamManager::NotifyDeviceChangeSubscribers(MediaStreamType type) { |
| 2103 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 2103 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 2104 for (auto* subscriber : device_change_subscribers_) | 2104 for (auto* subscriber : device_change_subscribers_) |
| 2105 subscriber->DevicesChanged(type); | 2105 subscriber->DevicesChanged(type); |
| 2106 } | 2106 } |
| 2107 | 2107 |
| 2108 // static | 2108 // static |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2144 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanRequestURL( | 2144 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanRequestURL( |
| 2145 render_process_id, ConvertToGURL(origin))) { | 2145 render_process_id, ConvertToGURL(origin))) { |
| 2146 LOG(ERROR) << "MSM: Renderer requested a URL it's not allowed to use."; | 2146 LOG(ERROR) << "MSM: Renderer requested a URL it's not allowed to use."; |
| 2147 return false; | 2147 return false; |
| 2148 } | 2148 } |
| 2149 | 2149 |
| 2150 return true; | 2150 return true; |
| 2151 } | 2151 } |
| 2152 | 2152 |
| 2153 } // namespace content | 2153 } // namespace content |
| OLD | NEW |