| 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 #ifndef REMOTING_PROTOCOL_FAKE_CONNECTION_TO_CLIENT_H_ | 5 #ifndef REMOTING_PROTOCOL_FAKE_CONNECTION_TO_CLIENT_H_ |
| 6 #define REMOTING_PROTOCOL_FAKE_CONNECTION_TO_CLIENT_H_ | 6 #define REMOTING_PROTOCOL_FAKE_CONNECTION_TO_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 private: | 35 private: |
| 36 SizeCallback size_callback_; | 36 SizeCallback size_callback_; |
| 37 | 37 |
| 38 base::WeakPtrFactory<FakeVideoStream> weak_factory_; | 38 base::WeakPtrFactory<FakeVideoStream> weak_factory_; |
| 39 | 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(FakeVideoStream); | 40 DISALLOW_COPY_AND_ASSIGN(FakeVideoStream); |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 class FakeConnectionToClient : public ConnectionToClient { | 43 class FakeConnectionToClient : public ConnectionToClient { |
| 44 public: | 44 public: |
| 45 FakeConnectionToClient(scoped_ptr<Session> session); | 45 FakeConnectionToClient(std::unique_ptr<Session> session); |
| 46 ~FakeConnectionToClient() override; | 46 ~FakeConnectionToClient() override; |
| 47 | 47 |
| 48 void SetEventHandler(EventHandler* event_handler) override; | 48 void SetEventHandler(EventHandler* event_handler) override; |
| 49 | 49 |
| 50 scoped_ptr<VideoStream> StartVideoStream( | 50 std::unique_ptr<VideoStream> StartVideoStream( |
| 51 scoped_ptr<webrtc::DesktopCapturer> desktop_capturer) override; | 51 std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer) override; |
| 52 | 52 |
| 53 AudioStub* audio_stub() override; | 53 AudioStub* audio_stub() override; |
| 54 ClientStub* client_stub() override; | 54 ClientStub* client_stub() override; |
| 55 void Disconnect(ErrorCode disconnect_error) override; | 55 void Disconnect(ErrorCode disconnect_error) override; |
| 56 | 56 |
| 57 Session* session() override; | 57 Session* session() override; |
| 58 void OnInputEventReceived(int64_t timestamp) override; | 58 void OnInputEventReceived(int64_t timestamp) override; |
| 59 | 59 |
| 60 void set_clipboard_stub(ClipboardStub* clipboard_stub) override; | 60 void set_clipboard_stub(ClipboardStub* clipboard_stub) override; |
| 61 void set_host_stub(HostStub* host_stub) override; | 61 void set_host_stub(HostStub* host_stub) override; |
| 62 void set_input_stub(InputStub* input_stub) override; | 62 void set_input_stub(InputStub* input_stub) override; |
| 63 | 63 |
| 64 base::WeakPtr<FakeVideoStream> last_video_stream() { | 64 base::WeakPtr<FakeVideoStream> last_video_stream() { |
| 65 return last_video_stream_; | 65 return last_video_stream_; |
| 66 } | 66 } |
| 67 | 67 |
| 68 void set_audio_stub(AudioStub* audio_stub) { audio_stub_ = audio_stub; } | 68 void set_audio_stub(AudioStub* audio_stub) { audio_stub_ = audio_stub; } |
| 69 void set_client_stub(ClientStub* client_stub) { client_stub_ = client_stub; } | 69 void set_client_stub(ClientStub* client_stub) { client_stub_ = client_stub; } |
| 70 | 70 |
| 71 EventHandler* event_handler() { return event_handler_; } | 71 EventHandler* event_handler() { return event_handler_; } |
| 72 ClipboardStub* clipboard_stub() { return clipboard_stub_; } | 72 ClipboardStub* clipboard_stub() { return clipboard_stub_; } |
| 73 HostStub* host_stub() { return host_stub_; } | 73 HostStub* host_stub() { return host_stub_; } |
| 74 InputStub* input_stub() { return input_stub_; } | 74 InputStub* input_stub() { return input_stub_; } |
| 75 | 75 |
| 76 bool is_connected() { return is_connected_; } | 76 bool is_connected() { return is_connected_; } |
| 77 ErrorCode disconnect_error() { return disconnect_error_; } | 77 ErrorCode disconnect_error() { return disconnect_error_; } |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 scoped_ptr<Session> session_; | 80 std::unique_ptr<Session> session_; |
| 81 EventHandler* event_handler_ = nullptr; | 81 EventHandler* event_handler_ = nullptr; |
| 82 | 82 |
| 83 base::WeakPtr<FakeVideoStream> last_video_stream_; | 83 base::WeakPtr<FakeVideoStream> last_video_stream_; |
| 84 | 84 |
| 85 AudioStub* audio_stub_ = nullptr; | 85 AudioStub* audio_stub_ = nullptr; |
| 86 ClientStub* client_stub_ = nullptr; | 86 ClientStub* client_stub_ = nullptr; |
| 87 | 87 |
| 88 ClipboardStub* clipboard_stub_ = nullptr; | 88 ClipboardStub* clipboard_stub_ = nullptr; |
| 89 HostStub* host_stub_ = nullptr; | 89 HostStub* host_stub_ = nullptr; |
| 90 InputStub* input_stub_ = nullptr; | 90 InputStub* input_stub_ = nullptr; |
| 91 | 91 |
| 92 bool is_connected_ = true; | 92 bool is_connected_ = true; |
| 93 ErrorCode disconnect_error_ = OK; | 93 ErrorCode disconnect_error_ = OK; |
| 94 | 94 |
| 95 DISALLOW_COPY_AND_ASSIGN(FakeConnectionToClient); | 95 DISALLOW_COPY_AND_ASSIGN(FakeConnectionToClient); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespace protocol | 98 } // namespace protocol |
| 99 } // namespace remoting | 99 } // namespace remoting |
| 100 | 100 |
| 101 #endif // REMOTING_PROTOCOL_FAKE_CONNECTION_TO_CLIENT_H_ | 101 #endif // REMOTING_PROTOCOL_FAKE_CONNECTION_TO_CLIENT_H_ |
| OLD | NEW |