| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef REMOTING_TEST_FAKE_NETWORK_MANAGER_H_ | 5 #ifndef REMOTING_TEST_FAKE_NETWORK_MANAGER_H_ |
| 6 #define REMOTING_TEST_FAKE_NETWORK_MANAGER_H_ | 6 #define REMOTING_TEST_FAKE_NETWORK_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include <memory> |
| 9 |
| 9 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 10 #include "third_party/webrtc/base/network.h" | 11 #include "third_party/webrtc/base/network.h" |
| 11 | 12 |
| 12 namespace remoting { | 13 namespace remoting { |
| 13 | 14 |
| 14 // FakeNetworkManager always returns one interface with the IP address | 15 // FakeNetworkManager always returns one interface with the IP address |
| 15 // specified in the constructor. | 16 // specified in the constructor. |
| 16 class FakeNetworkManager : public rtc::NetworkManager { | 17 class FakeNetworkManager : public rtc::NetworkManager { |
| 17 public: | 18 public: |
| 18 explicit FakeNetworkManager(const rtc::IPAddress& address); | 19 explicit FakeNetworkManager(const rtc::IPAddress& address); |
| 19 ~FakeNetworkManager() override; | 20 ~FakeNetworkManager() override; |
| 20 | 21 |
| 21 // rtc::NetworkManager interface. | 22 // rtc::NetworkManager interface. |
| 22 void StartUpdating() override; | 23 void StartUpdating() override; |
| 23 void StopUpdating() override; | 24 void StopUpdating() override; |
| 24 void GetNetworks(NetworkList* networks) const override; | 25 void GetNetworks(NetworkList* networks) const override; |
| 25 | 26 |
| 26 protected: | 27 protected: |
| 27 void SendNetworksChangedSignal(); | 28 void SendNetworksChangedSignal(); |
| 28 | 29 |
| 29 bool started_; | 30 bool started_; |
| 30 scoped_ptr<rtc::Network> network_; | 31 std::unique_ptr<rtc::Network> network_; |
| 31 | 32 |
| 32 base::WeakPtrFactory<FakeNetworkManager> weak_factory_; | 33 base::WeakPtrFactory<FakeNetworkManager> weak_factory_; |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 } // namespace remoting | 36 } // namespace remoting |
| 36 | 37 |
| 37 #endif // REMOTING_TEST_FAKE_NETWORK_MANAGER_H_ | 38 #endif // REMOTING_TEST_FAKE_NETWORK_MANAGER_H_ |
| OLD | NEW |