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

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

Issue 1630953003: Remove invalid CHECK() from DesktopSessionAgent::OnCaptureCompleted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 &DesktopSessionAgent::StartVideoCapturerAndMouseMonitor, this)); 309 &DesktopSessionAgent::StartVideoCapturerAndMouseMonitor, this));
310 } 310 }
311 311
312 void DesktopSessionAgent::OnCaptureCompleted(webrtc::DesktopFrame* frame) { 312 void DesktopSessionAgent::OnCaptureCompleted(webrtc::DesktopFrame* frame) {
313 DCHECK(video_capture_task_runner_->BelongsToCurrentThread()); 313 DCHECK(video_capture_task_runner_->BelongsToCurrentThread());
314 314
315 last_frame_.reset(frame); 315 last_frame_.reset(frame);
316 316
317 current_size_ = frame->size(); 317 current_size_ = frame->size();
318 318
319 // Verify that the captured frame was stored in the shared memory buffer.
320 CHECK(frame->data() == frame->shared_memory()->data());
321
322 // Serialize webrtc::DesktopFrame. 319 // Serialize webrtc::DesktopFrame.
323 SerializedDesktopFrame serialized_frame; 320 SerializedDesktopFrame serialized_frame;
324 serialized_frame.shared_buffer_id = frame->shared_memory()->id(); 321 serialized_frame.shared_buffer_id = frame->shared_memory()->id();
325 serialized_frame.bytes_per_row = frame->stride(); 322 serialized_frame.bytes_per_row = frame->stride();
326 serialized_frame.dimensions = frame->size(); 323 serialized_frame.dimensions = frame->size();
327 serialized_frame.capture_time_ms = frame->capture_time_ms(); 324 serialized_frame.capture_time_ms = frame->capture_time_ms();
328 serialized_frame.dpi = frame->dpi(); 325 serialized_frame.dpi = frame->dpi();
329 for (webrtc::DesktopRegion::Iterator i(frame->updated_region()); 326 for (webrtc::DesktopRegion::Iterator i(frame->updated_region());
330 !i.IsAtEnd(); i.Advance()) { 327 !i.IsAtEnd(); i.Advance()) {
331 serialized_frame.dirty_region.push_back(i.rect()); 328 serialized_frame.dirty_region.push_back(i.rect());
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 void DesktopSessionAgent::OnSharedBufferDeleted(int id) { 598 void DesktopSessionAgent::OnSharedBufferDeleted(int id) {
602 DCHECK(video_capture_task_runner_->BelongsToCurrentThread()); 599 DCHECK(video_capture_task_runner_->BelongsToCurrentThread());
603 DCHECK(id != 0); 600 DCHECK(id != 0);
604 601
605 shared_buffers_--; 602 shared_buffers_--;
606 DCHECK_GE(shared_buffers_, 0); 603 DCHECK_GE(shared_buffers_, 0);
607 SendToNetwork(new ChromotingDesktopNetworkMsg_ReleaseSharedBuffer(id)); 604 SendToNetwork(new ChromotingDesktopNetworkMsg_ReleaseSharedBuffer(id));
608 } 605 }
609 606
610 } // namespace remoting 607 } // 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