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

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

Issue 11260053: Use correct thread for audio capturing and encoding. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
« 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // Don't use initial delay unless the last request was an error. 52 // Don't use initial delay unless the last request was an error.
53 false, 53 false,
54 }; 54 };
55 55
56 } // namespace 56 } // namespace
57 57
58 ChromotingHost::ChromotingHost( 58 ChromotingHost::ChromotingHost(
59 SignalStrategy* signal_strategy, 59 SignalStrategy* signal_strategy,
60 DesktopEnvironmentFactory* desktop_environment_factory, 60 DesktopEnvironmentFactory* desktop_environment_factory,
61 scoped_ptr<protocol::SessionManager> session_manager, 61 scoped_ptr<protocol::SessionManager> session_manager,
62 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner,
62 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, 63 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
63 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner, 64 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner,
64 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner) 65 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner)
65 : desktop_environment_factory_(desktop_environment_factory), 66 : desktop_environment_factory_(desktop_environment_factory),
66 session_manager_(session_manager.Pass()), 67 session_manager_(session_manager.Pass()),
68 audio_task_runner_(audio_task_runner),
67 capture_task_runner_(capture_task_runner), 69 capture_task_runner_(capture_task_runner),
68 encode_task_runner_(encode_task_runner), 70 encode_task_runner_(encode_task_runner),
69 network_task_runner_(network_task_runner), 71 network_task_runner_(network_task_runner),
70 signal_strategy_(signal_strategy), 72 signal_strategy_(signal_strategy),
71 clients_count_(0), 73 clients_count_(0),
72 state_(kInitial), 74 state_(kInitial),
73 protocol_config_(protocol::CandidateSessionConfig::CreateDefault()), 75 protocol_config_(protocol::CandidateSessionConfig::CreateDefault()),
74 login_backoff_(&kDefaultBackoffPolicy), 76 login_backoff_(&kDefaultBackoffPolicy),
75 authenticating_client_(false), 77 authenticating_client_(false),
76 reject_authenticating_client_(false) { 78 reject_authenticating_client_(false) {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 306
305 *response = protocol::SessionManager::ACCEPT; 307 *response = protocol::SessionManager::ACCEPT;
306 308
307 LOG(INFO) << "Client connected: " << session->jid(); 309 LOG(INFO) << "Client connected: " << session->jid();
308 310
309 // Create a client object. 311 // Create a client object.
310 scoped_ptr<protocol::ConnectionToClient> connection( 312 scoped_ptr<protocol::ConnectionToClient> connection(
311 new protocol::ConnectionToClient(session)); 313 new protocol::ConnectionToClient(session));
312 scoped_refptr<ClientSession> client = new ClientSession( 314 scoped_refptr<ClientSession> client = new ClientSession(
313 this, 315 this,
316 audio_task_runner_,
314 capture_task_runner_, 317 capture_task_runner_,
315 encode_task_runner_, 318 encode_task_runner_,
316 network_task_runner_, 319 network_task_runner_,
317 connection.Pass(), 320 connection.Pass(),
318 desktop_environment_factory_, 321 desktop_environment_factory_,
319 max_session_duration_); 322 max_session_duration_);
320 clients_.push_back(client); 323 clients_.push_back(client);
321 clients_count_++; 324 clients_count_++;
322 } 325 }
323 326
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 OnShutdown()); 422 OnShutdown());
420 423
421 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin(); 424 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin();
422 it != shutdown_tasks_.end(); ++it) { 425 it != shutdown_tasks_.end(); ++it) {
423 it->Run(); 426 it->Run();
424 } 427 }
425 shutdown_tasks_.clear(); 428 shutdown_tasks_.clear();
426 } 429 }
427 430
428 } // namespace remoting 431 } // 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