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

Side by Side Diff: remoting/host/desktop_session_agent.cc

Issue 1996753002: Fix DesktopSessioAgent crash when handling nullptr OnCaptureCompleted callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 "remoting/host/desktop_session_agent.h" 5 #include "remoting/host/desktop_session_agent.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 base::Bind(&DesktopSessionAgent::SendToNetwork, this)))); 319 base::Bind(&DesktopSessionAgent::SendToNetwork, this))));
320 mouse_cursor_monitor_ = desktop_environment_->CreateMouseCursorMonitor(); 320 mouse_cursor_monitor_ = desktop_environment_->CreateMouseCursorMonitor();
321 mouse_cursor_monitor_->Init(this, webrtc::MouseCursorMonitor::SHAPE_ONLY); 321 mouse_cursor_monitor_->Init(this, webrtc::MouseCursorMonitor::SHAPE_ONLY);
322 } 322 }
323 323
324 void DesktopSessionAgent::OnCaptureCompleted(webrtc::DesktopFrame* frame) { 324 void DesktopSessionAgent::OnCaptureCompleted(webrtc::DesktopFrame* frame) {
325 DCHECK(caller_task_runner_->BelongsToCurrentThread()); 325 DCHECK(caller_task_runner_->BelongsToCurrentThread());
326 326
327 last_frame_.reset(frame); 327 last_frame_.reset(frame);
328 328
329 if (!frame) {
Sergey Ulanov 2016/05/19 22:23:52 I don't think we can just ignore the error here. T
Hzj_jie 2016/05/20 00:11:15 Yes, I paused this review because of the screen fr
330 return;
331 }
332
329 current_size_ = frame->size(); 333 current_size_ = frame->size();
330 334
331 // Serialize webrtc::DesktopFrame. 335 // Serialize webrtc::DesktopFrame.
332 SerializedDesktopFrame serialized_frame; 336 SerializedDesktopFrame serialized_frame;
333 serialized_frame.shared_buffer_id = frame->shared_memory()->id(); 337 serialized_frame.shared_buffer_id = frame->shared_memory()->id();
334 serialized_frame.bytes_per_row = frame->stride(); 338 serialized_frame.bytes_per_row = frame->stride();
335 serialized_frame.dimensions = frame->size(); 339 serialized_frame.dimensions = frame->size();
336 serialized_frame.capture_time_ms = frame->capture_time_ms(); 340 serialized_frame.capture_time_ms = frame->capture_time_ms();
337 serialized_frame.dpi = frame->dpi(); 341 serialized_frame.dpi = frame->dpi();
338 for (webrtc::DesktopRegion::Iterator i(frame->updated_region()); 342 for (webrtc::DesktopRegion::Iterator i(frame->updated_region());
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 } 582 }
579 } 583 }
580 584
581 void DesktopSessionAgent::StopAudioCapturer() { 585 void DesktopSessionAgent::StopAudioCapturer() {
582 DCHECK(audio_capture_task_runner_->BelongsToCurrentThread()); 586 DCHECK(audio_capture_task_runner_->BelongsToCurrentThread());
583 587
584 audio_capturer_.reset(); 588 audio_capturer_.reset();
585 } 589 }
586 590
587 } // namespace remoting 591 } // namespace remoting
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