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

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

Issue 1673723002: Use IpcVideoFrameCapturer on network thread instead of capturer thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « remoting/host/chromoting_host.h ('k') | remoting/host/chromoting_host_unittest.cc » ('j') | 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/chromoting_host.h" 5 #include "remoting/host/chromoting_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 false, 61 false,
62 }; 62 };
63 63
64 } // namespace 64 } // namespace
65 65
66 ChromotingHost::ChromotingHost( 66 ChromotingHost::ChromotingHost(
67 DesktopEnvironmentFactory* desktop_environment_factory, 67 DesktopEnvironmentFactory* desktop_environment_factory,
68 scoped_ptr<protocol::SessionManager> session_manager, 68 scoped_ptr<protocol::SessionManager> session_manager,
69 scoped_refptr<protocol::TransportContext> transport_context, 69 scoped_refptr<protocol::TransportContext> transport_context,
70 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, 70 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner,
71 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, 71 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner)
72 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner,
73 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner,
74 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
75 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
76 : desktop_environment_factory_(desktop_environment_factory), 72 : desktop_environment_factory_(desktop_environment_factory),
77 session_manager_(std::move(session_manager)), 73 session_manager_(std::move(session_manager)),
78 transport_context_(transport_context), 74 transport_context_(transport_context),
79 audio_task_runner_(audio_task_runner), 75 audio_task_runner_(audio_task_runner),
80 input_task_runner_(input_task_runner),
81 video_capture_task_runner_(video_capture_task_runner),
82 video_encode_task_runner_(video_encode_task_runner), 76 video_encode_task_runner_(video_encode_task_runner),
83 network_task_runner_(network_task_runner),
84 ui_task_runner_(ui_task_runner),
85 started_(false), 77 started_(false),
86 login_backoff_(&kDefaultBackoffPolicy), 78 login_backoff_(&kDefaultBackoffPolicy),
87 enable_curtaining_(false), 79 enable_curtaining_(false),
88 weak_factory_(this) { 80 weak_factory_(this) {
89 DCHECK(network_task_runner_->BelongsToCurrentThread());
90
91 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); 81 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
92 } 82 }
93 83
94 ChromotingHost::~ChromotingHost() { 84 ChromotingHost::~ChromotingHost() {
95 DCHECK(CalledOnValidThread()); 85 DCHECK(CalledOnValidThread());
96 86
97 // Disconnect all of the clients. 87 // Disconnect all of the clients.
98 while (!clients_.empty()) { 88 while (!clients_.empty()) {
99 clients_.front()->DisconnectSession(protocol::OK); 89 clients_.front()->DisconnectSession(protocol::OK);
100 } 90 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 extensions_.push_back(extension.release()); 125 extensions_.push_back(extension.release());
136 } 126 }
137 127
138 void ChromotingHost::SetAuthenticatorFactory( 128 void ChromotingHost::SetAuthenticatorFactory(
139 scoped_ptr<protocol::AuthenticatorFactory> authenticator_factory) { 129 scoped_ptr<protocol::AuthenticatorFactory> authenticator_factory) {
140 DCHECK(CalledOnValidThread()); 130 DCHECK(CalledOnValidThread());
141 session_manager_->set_authenticator_factory(std::move(authenticator_factory)); 131 session_manager_->set_authenticator_factory(std::move(authenticator_factory));
142 } 132 }
143 133
144 void ChromotingHost::SetEnableCurtaining(bool enable) { 134 void ChromotingHost::SetEnableCurtaining(bool enable) {
145 DCHECK(network_task_runner_->BelongsToCurrentThread()); 135 DCHECK(CalledOnValidThread());
146 136
147 if (enable_curtaining_ == enable) 137 if (enable_curtaining_ == enable)
148 return; 138 return;
149 139
150 enable_curtaining_ = enable; 140 enable_curtaining_ = enable;
151 desktop_environment_factory_->SetEnableCurtaining(enable_curtaining_); 141 desktop_environment_factory_->SetEnableCurtaining(enable_curtaining_);
152 142
153 // Disconnect all existing clients because they might be running not 143 // Disconnect all existing clients because they might be running not
154 // curtained. 144 // curtained.
155 // TODO(alexeypa): fix this such that the curtain is applied to the not 145 // TODO(alexeypa): fix this such that the curtain is applied to the not
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 protocol::SessionConfig::Protocol::WEBRTC) { 268 protocol::SessionConfig::Protocol::WEBRTC) {
279 connection.reset(new protocol::WebrtcConnectionToClient( 269 connection.reset(new protocol::WebrtcConnectionToClient(
280 make_scoped_ptr(session), transport_context_)); 270 make_scoped_ptr(session), transport_context_));
281 } else { 271 } else {
282 connection.reset(new protocol::IceConnectionToClient( 272 connection.reset(new protocol::IceConnectionToClient(
283 make_scoped_ptr(session), transport_context_, 273 make_scoped_ptr(session), transport_context_,
284 video_encode_task_runner_)); 274 video_encode_task_runner_));
285 } 275 }
286 276
287 // Create a ClientSession object. 277 // Create a ClientSession object.
288 ClientSession* client = new ClientSession( 278 ClientSession* client =
289 this, audio_task_runner_, input_task_runner_, video_capture_task_runner_, 279 new ClientSession(this, audio_task_runner_, std::move(connection),
290 video_encode_task_runner_, network_task_runner_, ui_task_runner_, 280 desktop_environment_factory_, max_session_duration_,
291 std::move(connection), desktop_environment_factory_, 281 pairing_registry_, extensions_.get());
292 max_session_duration_, pairing_registry_, extensions_.get());
293 282
294 clients_.push_back(client); 283 clients_.push_back(client);
295 } 284 }
296 285
297 void ChromotingHost::DisconnectAllClients() { 286 void ChromotingHost::DisconnectAllClients() {
298 DCHECK(CalledOnValidThread()); 287 DCHECK(CalledOnValidThread());
299 288
300 while (!clients_.empty()) { 289 while (!clients_.empty()) {
301 size_t size = clients_.size(); 290 size_t size = clients_.size();
302 clients_.front()->DisconnectSession(protocol::OK); 291 clients_.front()->DisconnectSession(protocol::OK);
303 CHECK_EQ(clients_.size(), size - 1); 292 CHECK_EQ(clients_.size(), size - 1);
304 } 293 }
305 } 294 }
306 295
307 } // namespace remoting 296 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/chromoting_host.h ('k') | remoting/host/chromoting_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698