Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/it2me/it2me_host.h" | 5 #include "remoting/host/it2me/it2me_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 | 95 |
| 96 void It2MeHost::Disconnect() { | 96 void It2MeHost::Disconnect() { |
| 97 DCHECK(task_runner_->BelongsToCurrentThread()); | 97 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 98 host_context_->network_task_runner()->PostTask( | 98 host_context_->network_task_runner()->PostTask( |
| 99 FROM_HERE, base::Bind(&It2MeHost::Shutdown, this)); | 99 FROM_HERE, base::Bind(&It2MeHost::Shutdown, this)); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void It2MeHost::Shutdown() { | 102 void It2MeHost::Shutdown() { |
| 103 DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); | 103 DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); |
| 104 | 104 |
| 105 // Shutdown is expected to be called twice, if OnClientDisconnected has been | |
| 106 // called. See http://crbug.com/617474 for details. | |
|
Sergey Ulanov
2016/06/08 21:54:04
The link to the bug is not useful here. I would ju
Hzj_jie
2016/06/08 23:12:20
I would prefer to keep it, since the condition of
Sergey Ulanov
2016/06/08 23:26:15
Ok, then I suggest rewording:
// Disconnect() may
| |
| 107 if (state_ == kDisconnected) { | |
| 108 return; | |
| 109 } | |
| 110 | |
| 105 confirmation_dialog_proxy_.reset(); | 111 confirmation_dialog_proxy_.reset(); |
| 106 | 112 |
| 107 host_event_logger_.reset(); | 113 host_event_logger_.reset(); |
| 108 if (host_) { | 114 if (host_) { |
| 109 host_->RemoveStatusObserver(this); | 115 host_->RemoveStatusObserver(this); |
| 110 host_.reset(); | 116 host_.reset(); |
| 111 } | 117 } |
| 112 | 118 |
| 113 register_request_.reset(); | 119 register_request_.reset(); |
| 114 host_status_logger_.reset(); | 120 host_status_logger_.reset(); |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 516 std::unique_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( | 522 std::unique_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( |
| 517 new It2MeConfirmationDialogFactory()); | 523 new It2MeConfirmationDialogFactory()); |
| 518 std::unique_ptr<PolicyWatcher> policy_watcher = | 524 std::unique_ptr<PolicyWatcher> policy_watcher = |
| 519 PolicyWatcher::Create(policy_service_, context->file_task_runner()); | 525 PolicyWatcher::Create(policy_service_, context->file_task_runner()); |
| 520 return new It2MeHost(std::move(context), std::move(policy_watcher), | 526 return new It2MeHost(std::move(context), std::move(policy_watcher), |
| 521 std::move(confirmation_dialog_factory), observer, | 527 std::move(confirmation_dialog_factory), observer, |
| 522 xmpp_server_config, directory_bot_jid); | 528 xmpp_server_config, directory_bot_jid); |
| 523 } | 529 } |
| 524 | 530 |
| 525 } // namespace remoting | 531 } // namespace remoting |
| OLD | NEW |