Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: content/renderer/media/media_stream_dispatcher.cc

Issue 180633008: Add different error codes for getUserMedia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comments Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/renderer/media/media_stream_dispatcher.h" 5 #include "content/renderer/media/media_stream_dispatcher.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "content/common/media/media_stream_messages.h" 9 #include "content/common/media/media_stream_messages.h"
10 #include "content/renderer/media/media_stream_dispatcher_eventhandler.h" 10 #include "content/renderer/media/media_stream_dispatcher_eventhandler.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 request.request_id, label, audio_array, video_array); 257 request.request_id, label, audio_array, video_array);
258 DVLOG(1) << "MediaStreamDispatcher::OnStreamGenerated(" 258 DVLOG(1) << "MediaStreamDispatcher::OnStreamGenerated("
259 << request.request_id << ", " << label << ")"; 259 << request.request_id << ", " << label << ")";
260 } 260 }
261 requests_.erase(it); 261 requests_.erase(it);
262 break; 262 break;
263 } 263 }
264 } 264 }
265 } 265 }
266 266
267 void MediaStreamDispatcher::OnStreamGenerationFailed(int request_id) { 267 void MediaStreamDispatcher::OnStreamGenerationFailed(
268 int request_id,
269 content::MediaStreamRequestResult result) {
268 DCHECK(main_loop_->BelongsToCurrentThread()); 270 DCHECK(main_loop_->BelongsToCurrentThread());
269 for (RequestList::iterator it = requests_.begin(); 271 for (RequestList::iterator it = requests_.begin();
270 it != requests_.end(); ++it) { 272 it != requests_.end(); ++it) {
271 Request& request = *it; 273 Request& request = *it;
272 if (request.ipc_request == request_id) { 274 if (request.ipc_request == request_id) {
273 if (request.handler.get()) { 275 if (request.handler.get()) {
274 request.handler->OnStreamGenerationFailed(request.request_id); 276 request.handler->OnStreamGenerationFailed(request.request_id, result);
275 DVLOG(1) << "MediaStreamDispatcher::OnStreamGenerationFailed(" 277 DVLOG(1) << "MediaStreamDispatcher::OnStreamGenerationFailed("
276 << request.request_id << ")\n"; 278 << request.request_id << ")\n";
277 } 279 }
278 requests_.erase(it); 280 requests_.erase(it);
279 break; 281 break;
280 } 282 }
281 } 283 }
282 } 284 }
283 285
284 void MediaStreamDispatcher::OnDeviceStopped( 286 void MediaStreamDispatcher::OnDeviceStopped(
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 int index) { 390 int index) {
389 LabelStreamMap::iterator it = label_stream_map_.find(label); 391 LabelStreamMap::iterator it = label_stream_map_.find(label);
390 if (it == label_stream_map_.end() || 392 if (it == label_stream_map_.end() ||
391 it->second.video_array.size() <= static_cast<size_t>(index)) { 393 it->second.video_array.size() <= static_cast<size_t>(index)) {
392 return StreamDeviceInfo::kNoId; 394 return StreamDeviceInfo::kNoId;
393 } 395 }
394 return it->second.video_array[index].session_id; 396 return it->second.video_array[index].session_id;
395 } 397 }
396 398
397 } // namespace content 399 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_dispatcher.h ('k') | content/renderer/media/media_stream_dispatcher_eventhandler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698