OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/gcd_state_updater.h" | 5 #include "remoting/host/gcd_state_updater.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 DCHECK(signal_strategy_); | 37 DCHECK(signal_strategy_); |
38 DCHECK(thread_checker_.CalledOnValidThread()); | 38 DCHECK(thread_checker_.CalledOnValidThread()); |
39 | 39 |
40 signal_strategy_->AddListener(this); | 40 signal_strategy_->AddListener(this); |
41 | 41 |
42 // Update state if the |signal_strategy_| is already connected. | 42 // Update state if the |signal_strategy_| is already connected. |
43 OnSignalStrategyStateChange(signal_strategy_->GetState()); | 43 OnSignalStrategyStateChange(signal_strategy_->GetState()); |
44 } | 44 } |
45 | 45 |
46 GcdStateUpdater::~GcdStateUpdater() { | 46 GcdStateUpdater::~GcdStateUpdater() { |
| 47 DCHECK(thread_checker_.CalledOnValidThread()); |
47 signal_strategy_->RemoveListener(this); | 48 signal_strategy_->RemoveListener(this); |
48 } | 49 } |
49 | 50 |
50 void GcdStateUpdater::SetHostOfflineReason( | 51 void GcdStateUpdater::SetHostOfflineReason( |
51 const std::string& host_offline_reason, | 52 const std::string& host_offline_reason, |
52 const base::TimeDelta& timeout, | 53 const base::TimeDelta& timeout, |
53 const base::Callback<void(bool success)>& ack_callback) { | 54 const base::Callback<void(bool success)>& ack_callback) { |
54 // TODO(jrw): Implement this. Refer to | 55 // TODO(jrw): Implement this. Refer to |
55 // HeartbeatSender::SetHostOfflineReason. | 56 // HeartbeatSender::SetHostOfflineReason. |
56 NOTIMPLEMENTED(); | 57 NOTIMPLEMENTED(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 base_state->SetString("_hostVersion", STRINGIZE(VERSION)); | 122 base_state->SetString("_hostVersion", STRINGIZE(VERSION)); |
122 patch->Set("base", std::move(base_state)); | 123 patch->Set("base", std::move(base_state)); |
123 | 124 |
124 // Send the update to GCD. | 125 // Send the update to GCD. |
125 gcd_rest_client_->PatchState( | 126 gcd_rest_client_->PatchState( |
126 std::move(patch), | 127 std::move(patch), |
127 base::Bind(&GcdStateUpdater::OnPatchStateResult, base::Unretained(this))); | 128 base::Bind(&GcdStateUpdater::OnPatchStateResult, base::Unretained(this))); |
128 } | 129 } |
129 | 130 |
130 } // namespace remoting | 131 } // namespace remoting |
OLD | NEW |