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

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

Issue 569593002: Maintaining the proper order of initialization WeakPtrFactory in "src/remoting" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
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 "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "ipc/ipc_channel_proxy.h" 10 #include "ipc/ipc_channel_proxy.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 scoped_refptr<AutoThreadTaskRunner> audio_capture_task_runner, 113 scoped_refptr<AutoThreadTaskRunner> audio_capture_task_runner,
114 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, 114 scoped_refptr<AutoThreadTaskRunner> caller_task_runner,
115 scoped_refptr<AutoThreadTaskRunner> input_task_runner, 115 scoped_refptr<AutoThreadTaskRunner> input_task_runner,
116 scoped_refptr<AutoThreadTaskRunner> io_task_runner, 116 scoped_refptr<AutoThreadTaskRunner> io_task_runner,
117 scoped_refptr<AutoThreadTaskRunner> video_capture_task_runner) 117 scoped_refptr<AutoThreadTaskRunner> video_capture_task_runner)
118 : audio_capture_task_runner_(audio_capture_task_runner), 118 : audio_capture_task_runner_(audio_capture_task_runner),
119 caller_task_runner_(caller_task_runner), 119 caller_task_runner_(caller_task_runner),
120 input_task_runner_(input_task_runner), 120 input_task_runner_(input_task_runner),
121 io_task_runner_(io_task_runner), 121 io_task_runner_(io_task_runner),
122 video_capture_task_runner_(video_capture_task_runner), 122 video_capture_task_runner_(video_capture_task_runner),
123 control_factory_(this),
124 next_shared_buffer_id_(1), 123 next_shared_buffer_id_(1),
125 shared_buffers_(0), 124 shared_buffers_(0),
126 started_(false) { 125 started_(false),
126 control_factory_(this) {
127 DCHECK(caller_task_runner_->BelongsToCurrentThread()); 127 DCHECK(caller_task_runner_->BelongsToCurrentThread());
128 } 128 }
129 129
130 bool DesktopSessionAgent::OnMessageReceived(const IPC::Message& message) { 130 bool DesktopSessionAgent::OnMessageReceived(const IPC::Message& message) {
131 DCHECK(caller_task_runner_->BelongsToCurrentThread()); 131 DCHECK(caller_task_runner_->BelongsToCurrentThread());
132 132
133 bool handled = true; 133 bool handled = true;
134 if (started_) { 134 if (started_) {
135 IPC_BEGIN_MESSAGE_MAP(DesktopSessionAgent, message) 135 IPC_BEGIN_MESSAGE_MAP(DesktopSessionAgent, message)
136 IPC_MESSAGE_HANDLER(ChromotingNetworkDesktopMsg_CaptureFrame, 136 IPC_MESSAGE_HANDLER(ChromotingNetworkDesktopMsg_CaptureFrame,
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 void DesktopSessionAgent::OnSharedBufferDeleted(int id) { 583 void DesktopSessionAgent::OnSharedBufferDeleted(int id) {
584 DCHECK(video_capture_task_runner_->BelongsToCurrentThread()); 584 DCHECK(video_capture_task_runner_->BelongsToCurrentThread());
585 DCHECK(id != 0); 585 DCHECK(id != 0);
586 586
587 shared_buffers_--; 587 shared_buffers_--;
588 DCHECK_GE(shared_buffers_, 0); 588 DCHECK_GE(shared_buffers_, 0);
589 SendToNetwork(new ChromotingDesktopNetworkMsg_ReleaseSharedBuffer(id)); 589 SendToNetwork(new ChromotingDesktopNetworkMsg_ReleaseSharedBuffer(id));
590 } 590 }
591 591
592 } // namespace remoting 592 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698