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

Side by Side Diff: content/browser/renderer_host/media/video_capture_manager.cc

Issue 2419613003: VideoCaptureManager: handle case when GetDeviceEntryBySessionId is null (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser/renderer_host/media/video_capture_manager.h" 5 #include "content/browser/renderer_host/media/video_capture_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 543
544 if (entry->stream_type == MEDIA_DESKTOP_VIDEO_CAPTURE) { 544 if (entry->stream_type == MEDIA_DESKTOP_VIDEO_CAPTURE) {
545 const media::VideoCaptureSessionId session_id = 545 const media::VideoCaptureSessionId session_id =
546 device_start_queue_.front().session_id(); 546 device_start_queue_.front().session_id();
547 DCHECK(session_id != kFakeSessionId); 547 DCHECK(session_id != kFakeSessionId);
548 MaybePostDesktopCaptureWindowId(session_id); 548 MaybePostDesktopCaptureWindowId(session_id);
549 } 549 }
550 550
551 auto request = photo_request_queue_.begin(); 551 auto request = photo_request_queue_.begin();
552 while(request != photo_request_queue_.end()) { 552 while(request != photo_request_queue_.end()) {
553 if (GetDeviceEntryBySessionId(request->first)->video_capture_device()) { 553 DeviceEntry* maybe_entry = GetDeviceEntryBySessionId(request->first);
554 request->second.Run(entry->video_capture_device()); 554 if (maybe_entry && maybe_entry->video_capture_device()) {
555 request->second.Run(maybe_entry->video_capture_device());
555 photo_request_queue_.erase(request); 556 photo_request_queue_.erase(request);
556 } 557 }
557 ++request; 558 ++request;
558 } 559 }
559 } 560 }
560 561
561 device_start_queue_.pop_front(); 562 device_start_queue_.pop_front();
562 HandleQueuedStartRequest(); 563 HandleQueuedStartRequest();
563 } 564 }
564 565
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
1282 if (!device_in_queue) { 1283 if (!device_in_queue) {
1283 // Session ID is only valid for Screen capture. So we can fake it to 1284 // Session ID is only valid for Screen capture. So we can fake it to
1284 // resume video capture devices here. 1285 // resume video capture devices here.
1285 QueueStartDevice(kFakeSessionId, entry.get(), entry->parameters); 1286 QueueStartDevice(kFakeSessionId, entry.get(), entry->parameters);
1286 } 1287 }
1287 } 1288 }
1288 } 1289 }
1289 #endif // defined(OS_ANDROID) 1290 #endif // defined(OS_ANDROID)
1290 1291
1291 } // namespace content 1292 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698