| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chromeos/components/tether/fake_tether_host_fetcher.h" | 5 #include "chromeos/components/tether/fake_tether_host_fetcher.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 | 8 |
| 9 namespace chromeos { | 9 namespace chromeos { |
| 10 | 10 |
| 11 namespace tether { | 11 namespace tether { |
| 12 | 12 |
| 13 FakeTetherHostFetcher::FakeTetherHostFetcher( | 13 FakeTetherHostFetcher::FakeTetherHostFetcher( |
| 14 std::vector<cryptauth::RemoteDevice> tether_hosts, | 14 std::vector<cryptauth::RemoteDevice> tether_hosts, |
| 15 bool synchronously_reply_with_results) | 15 bool synchronously_reply_with_results) |
| 16 : TetherHostFetcher("", "", nullptr, nullptr), | 16 : TetherHostFetcher(nullptr), |
| 17 tether_hosts_(tether_hosts), | 17 tether_hosts_(tether_hosts), |
| 18 synchronously_reply_with_results_(synchronously_reply_with_results) {} | 18 synchronously_reply_with_results_(synchronously_reply_with_results) {} |
| 19 | 19 |
| 20 FakeTetherHostFetcher::FakeTetherHostFetcher( | 20 FakeTetherHostFetcher::FakeTetherHostFetcher( |
| 21 bool synchronously_reply_with_results) | 21 bool synchronously_reply_with_results) |
| 22 : FakeTetherHostFetcher(std::vector<cryptauth::RemoteDevice>(), | 22 : FakeTetherHostFetcher(std::vector<cryptauth::RemoteDevice>(), |
| 23 synchronously_reply_with_results) {} | 23 synchronously_reply_with_results) {} |
| 24 | 24 |
| 25 FakeTetherHostFetcher::~FakeTetherHostFetcher() {} | 25 FakeTetherHostFetcher::~FakeTetherHostFetcher() {} |
| 26 | 26 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 46 const TetherHostFetcher::TetherHostCallback& callback) { | 46 const TetherHostFetcher::TetherHostCallback& callback) { |
| 47 requests_.push_back(TetherHostFetchRequest(device_id, callback)); | 47 requests_.push_back(TetherHostFetchRequest(device_id, callback)); |
| 48 if (synchronously_reply_with_results_) { | 48 if (synchronously_reply_with_results_) { |
| 49 InvokePendingCallbacks(); | 49 InvokePendingCallbacks(); |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 | 52 |
| 53 } // namespace tether | 53 } // namespace tether |
| 54 | 54 |
| 55 } // namespace chromeos | 55 } // namespace chromeos |
| OLD | NEW |