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_dispatcher_host.h" | 5 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h" |
6 | 6 |
7 #include "content/browser/browser_main_loop.h" | 7 #include "content/browser/browser_main_loop.h" |
8 #include "content/common/media/media_stream_messages.h" | 8 #include "content/common/media/media_stream_messages.h" |
9 #include "content/common/media/media_stream_options.h" | 9 #include "content/common/media/media_stream_options.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 void MediaStreamDispatcherHost::DevicesEnumerated( | 93 void MediaStreamDispatcherHost::DevicesEnumerated( |
94 const std::string& label, | 94 const std::string& label, |
95 const StreamDeviceInfoArray& devices) { | 95 const StreamDeviceInfoArray& devices) { |
96 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 96 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
97 DVLOG(1) << "MediaStreamDispatcherHost::DevicesEnumerated(" | 97 DVLOG(1) << "MediaStreamDispatcherHost::DevicesEnumerated(" |
98 << ", {label = " << label << "})"; | 98 << ", {label = " << label << "})"; |
99 | 99 |
100 StreamMap::iterator it = streams_.find(label); | 100 StreamMap::iterator it = streams_.find(label); |
101 DCHECK(it != streams_.end()); | 101 DCHECK(it != streams_.end()); |
102 StreamRequest request = it->second; | 102 StreamRequest request = it->second; |
103 streams_.erase(it); | 103 streams_.erase(it); |
tommi (sloooow) - chröme
2012/08/01 10:21:37
was this a bug? I'm guessing the normal place whe
wjia(left Chromium)
2012/08/01 14:24:03
yes, it has been fixed in patch set 2.
| |
104 | 104 |
105 Send(new MediaStreamMsg_DevicesEnumerated( | 105 Send(new MediaStreamMsg_DevicesEnumerated( |
106 request.render_view_id, request.page_request_id, devices)); | 106 request.render_view_id, request.page_request_id, label, devices)); |
107 } | 107 } |
108 | 108 |
109 void MediaStreamDispatcherHost::DevicesEnumerationFailed( | 109 void MediaStreamDispatcherHost::DevicesEnumerationFailed( |
110 const std::string& label) { | 110 const std::string& label) { |
111 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 111 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
112 DVLOG(1) << "MediaStreamDispatcherHost::DevicesEnumerationFailed(" | 112 DVLOG(1) << "MediaStreamDispatcherHost::DevicesEnumerationFailed(" |
113 << ", {label = " << label << "})"; | 113 << ", {label = " << label << "})"; |
114 | 114 |
115 StreamMap::iterator it = streams_.find(label); | 115 StreamMap::iterator it = streams_.find(label); |
116 DCHECK(it != streams_.end()); | 116 DCHECK(it != streams_.end()); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
267 device_id, type, security_origin, &label); | 267 device_id, type, security_origin, &label); |
268 DCHECK(!label.empty()); | 268 DCHECK(!label.empty()); |
269 streams_[label] = StreamRequest(render_view_id, page_request_id); | 269 streams_[label] = StreamRequest(render_view_id, page_request_id); |
270 } | 270 } |
271 | 271 |
272 MediaStreamManager* MediaStreamDispatcherHost::GetManager() { | 272 MediaStreamManager* MediaStreamDispatcherHost::GetManager() { |
273 return BrowserMainLoop::GetMediaStreamManager(); | 273 return BrowserMainLoop::GetMediaStreamManager(); |
274 } | 274 } |
275 | 275 |
276 } // namespace media_stream | 276 } // namespace media_stream |
OLD | NEW |