OLD | NEW |
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 input_task_runner_(input_task_runner), | 71 input_task_runner_(input_task_runner), |
72 video_capture_task_runner_(video_capture_task_runner), | 72 video_capture_task_runner_(video_capture_task_runner), |
73 video_encode_task_runner_(video_encode_task_runner), | 73 video_encode_task_runner_(video_encode_task_runner), |
74 network_task_runner_(network_task_runner), | 74 network_task_runner_(network_task_runner), |
75 ui_task_runner_(ui_task_runner), | 75 ui_task_runner_(ui_task_runner), |
76 signal_strategy_(signal_strategy), | 76 signal_strategy_(signal_strategy), |
77 state_(kInitial), | 77 state_(kInitial), |
78 protocol_config_(protocol::CandidateSessionConfig::CreateDefault()), | 78 protocol_config_(protocol::CandidateSessionConfig::CreateDefault()), |
79 login_backoff_(&kDefaultBackoffPolicy), | 79 login_backoff_(&kDefaultBackoffPolicy), |
80 authenticating_client_(false), | 80 authenticating_client_(false), |
81 reject_authenticating_client_(false) { | 81 reject_authenticating_client_(false), |
| 82 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
82 DCHECK(signal_strategy); | 83 DCHECK(signal_strategy); |
83 DCHECK(network_task_runner_->BelongsToCurrentThread()); | 84 DCHECK(network_task_runner_->BelongsToCurrentThread()); |
84 | 85 |
85 if (!desktop_environment_factory_->SupportsAudioCapture()) { | 86 if (!desktop_environment_factory_->SupportsAudioCapture()) { |
86 protocol::CandidateSessionConfig::DisableAudioChannel( | 87 protocol::CandidateSessionConfig::DisableAudioChannel( |
87 protocol_config_.get()); | 88 protocol_config_.get()); |
88 } | 89 } |
89 } | 90 } |
90 | 91 |
91 ChromotingHost::~ChromotingHost() { | 92 ChromotingHost::~ChromotingHost() { |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 | 403 |
403 // Notify observers. | 404 // Notify observers. |
404 FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, | 405 FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, |
405 OnShutdown()); | 406 OnShutdown()); |
406 | 407 |
407 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin(); | 408 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin(); |
408 it != shutdown_tasks_.end(); ++it) { | 409 it != shutdown_tasks_.end(); ++it) { |
409 it->Run(); | 410 it->Run(); |
410 } | 411 } |
411 shutdown_tasks_.clear(); | 412 shutdown_tasks_.clear(); |
| 413 |
| 414 weak_factory_.InvalidateWeakPtrs(); |
412 } | 415 } |
413 | 416 |
414 } // namespace remoting | 417 } // namespace remoting |
OLD | NEW |