| 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_PORT_ALLOCATOR_H_ | 5 #ifndef REMOTING_TEST_FAKE_PORT_ALLOCATOR_H_ |
| 6 #define REMOTING_TEST_FAKE_PORT_ALLOCATOR_H_ | 6 #define REMOTING_TEST_FAKE_PORT_ALLOCATOR_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <set> | 9 #include <set> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "remoting/protocol/port_allocator_factory.h" | 13 #include "remoting/protocol/port_allocator_factory.h" |
| 14 #include "third_party/webrtc/p2p/client/basicportallocator.h" | 14 #include "third_party/webrtc/p2p/client/basicportallocator.h" |
| 15 | 15 |
| 16 namespace remoting { | 16 namespace remoting { |
| 17 | 17 |
| 18 class FakeNetworkDispatcher; | 18 class FakeNetworkDispatcher; |
| 19 class FakePacketSocketFactory; | 19 class FakePacketSocketFactory; |
| 20 | 20 |
| 21 class FakePortAllocator : public cricket::BasicPortAllocator { | 21 class FakePortAllocator : public cricket::BasicPortAllocator { |
| 22 public: | 22 public: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 class FakePortAllocatorFactory : public protocol::PortAllocatorFactory { | 42 class FakePortAllocatorFactory : public protocol::PortAllocatorFactory { |
| 43 public: | 43 public: |
| 44 FakePortAllocatorFactory( | 44 FakePortAllocatorFactory( |
| 45 scoped_refptr<FakeNetworkDispatcher> fake_network_dispatcher); | 45 scoped_refptr<FakeNetworkDispatcher> fake_network_dispatcher); |
| 46 ~FakePortAllocatorFactory() override; | 46 ~FakePortAllocatorFactory() override; |
| 47 | 47 |
| 48 FakePacketSocketFactory* socket_factory() { return socket_factory_.get(); } | 48 FakePacketSocketFactory* socket_factory() { return socket_factory_.get(); } |
| 49 | 49 |
| 50 // PortAllocatorFactory interface. | 50 // PortAllocatorFactory interface. |
| 51 scoped_ptr<cricket::PortAllocator> CreatePortAllocator( | 51 std::unique_ptr<cricket::PortAllocator> CreatePortAllocator( |
| 52 scoped_refptr<protocol::TransportContext> transport_context) override; | 52 scoped_refptr<protocol::TransportContext> transport_context) override; |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 scoped_ptr<rtc::NetworkManager> network_manager_; | 55 std::unique_ptr<rtc::NetworkManager> network_manager_; |
| 56 scoped_ptr<FakePacketSocketFactory> socket_factory_; | 56 std::unique_ptr<FakePacketSocketFactory> socket_factory_; |
| 57 | 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(FakePortAllocatorFactory); | 58 DISALLOW_COPY_AND_ASSIGN(FakePortAllocatorFactory); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace remoting | 61 } // namespace remoting |
| 62 | 62 |
| 63 #endif // REMOTING_TEST_FAKE_PORT_ALLOCATOR_H_ | 63 #endif // REMOTING_TEST_FAKE_PORT_ALLOCATOR_H_ |
| OLD | NEW |