| 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 <cctype> | 10 #include <cctype> |
| (...skipping 1792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1803 base::Unretained(this), renderer_host_id, callback)); | 1803 base::Unretained(this), renderer_host_id, callback)); |
| 1804 } | 1804 } |
| 1805 | 1805 |
| 1806 void MediaStreamManager::UnregisterNativeLogCallback(int renderer_host_id) { | 1806 void MediaStreamManager::UnregisterNativeLogCallback(int renderer_host_id) { |
| 1807 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 1807 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 1808 base::Bind(&MediaStreamManager::DoNativeLogCallbackUnregistration, | 1808 base::Bind(&MediaStreamManager::DoNativeLogCallbackUnregistration, |
| 1809 base::Unretained(this), renderer_host_id)); | 1809 base::Unretained(this), renderer_host_id)); |
| 1810 } | 1810 } |
| 1811 | 1811 |
| 1812 void MediaStreamManager::AddLogMessageOnIOThread(const std::string& message) { | 1812 void MediaStreamManager::AddLogMessageOnIOThread(const std::string& message) { |
| 1813 // Get render process ids on the IO thread. | |
| 1814 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1813 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 1815 | 1814 for (const auto& callback : log_callbacks_) |
| 1816 for (const LabeledDeviceRequest& labeled_request : requests_) { | 1815 callback.second.Run(message); |
| 1817 DeviceRequest* const request = labeled_request.second; | |
| 1818 if (request->request_type == MEDIA_GENERATE_STREAM) { | |
| 1819 const auto& found = log_callbacks_.find(request->requesting_process_id); | |
| 1820 if (found != log_callbacks_.end()) | |
| 1821 found->second.Run(message); | |
| 1822 } | |
| 1823 } | |
| 1824 } | 1816 } |
| 1825 | 1817 |
| 1826 void MediaStreamManager::HandleAccessRequestResponse( | 1818 void MediaStreamManager::HandleAccessRequestResponse( |
| 1827 const std::string& label, | 1819 const std::string& label, |
| 1828 const media::AudioParameters& output_parameters, | 1820 const media::AudioParameters& output_parameters, |
| 1829 const MediaStreamDevices& devices, | 1821 const MediaStreamDevices& devices, |
| 1830 content::MediaStreamRequestResult result) { | 1822 content::MediaStreamRequestResult result) { |
| 1831 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1823 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 1832 DVLOG(1) << "HandleAccessRequestResponse(" | 1824 DVLOG(1) << "HandleAccessRequestResponse(" |
| 1833 << ", {label = " << label << "})"; | 1825 << ", {label = " << label << "})"; |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2117 const std::string& device_guid, | 2109 const std::string& device_guid, |
| 2118 const std::string& raw_unique_id) { | 2110 const std::string& raw_unique_id) { |
| 2119 DCHECK(security_origin.is_valid()); | 2111 DCHECK(security_origin.is_valid()); |
| 2120 DCHECK(!raw_unique_id.empty()); | 2112 DCHECK(!raw_unique_id.empty()); |
| 2121 std::string guid_from_raw_device_id = | 2113 std::string guid_from_raw_device_id = |
| 2122 GetHMACForMediaDeviceID(sc, security_origin, raw_unique_id); | 2114 GetHMACForMediaDeviceID(sc, security_origin, raw_unique_id); |
| 2123 return guid_from_raw_device_id == device_guid; | 2115 return guid_from_raw_device_id == device_guid; |
| 2124 } | 2116 } |
| 2125 | 2117 |
| 2126 } // namespace content | 2118 } // namespace content |
| OLD | NEW |