| 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" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/single_thread_task_runner.h" |
| 13 #include "remoting/protocol/connection_to_client.h" | 15 #include "remoting/protocol/connection_to_client.h" |
| 16 #include "remoting/protocol/video_feedback_stub.h" |
| 14 #include "remoting/protocol/video_stream.h" | 17 #include "remoting/protocol/video_stream.h" |
| 18 #include "remoting/protocol/video_stub.h" |
| 15 | 19 |
| 16 namespace remoting { | 20 namespace remoting { |
| 17 namespace protocol { | 21 namespace protocol { |
| 18 | 22 |
| 19 class FakeVideoStream : public protocol::VideoStream { | 23 class FakeVideoStream : public protocol::VideoStream { |
| 20 public: | 24 public: |
| 21 FakeVideoStream(); | 25 FakeVideoStream(); |
| 22 ~FakeVideoStream() override; | 26 ~FakeVideoStream() override; |
| 23 | 27 |
| 24 // protocol::VideoStream interface. | 28 // protocol::VideoStream interface. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 void set_clipboard_stub(ClipboardStub* clipboard_stub) override; | 64 void set_clipboard_stub(ClipboardStub* clipboard_stub) override; |
| 61 void set_host_stub(HostStub* host_stub) override; | 65 void set_host_stub(HostStub* host_stub) override; |
| 62 void set_input_stub(InputStub* input_stub) override; | 66 void set_input_stub(InputStub* input_stub) override; |
| 63 | 67 |
| 64 base::WeakPtr<FakeVideoStream> last_video_stream() { | 68 base::WeakPtr<FakeVideoStream> last_video_stream() { |
| 65 return last_video_stream_; | 69 return last_video_stream_; |
| 66 } | 70 } |
| 67 | 71 |
| 68 void set_audio_stub(AudioStub* audio_stub) { audio_stub_ = audio_stub; } | 72 void set_audio_stub(AudioStub* audio_stub) { audio_stub_ = audio_stub; } |
| 69 void set_client_stub(ClientStub* client_stub) { client_stub_ = client_stub; } | 73 void set_client_stub(ClientStub* client_stub) { client_stub_ = client_stub; } |
| 74 void set_video_stub(VideoStub* video_stub) { video_stub_ = video_stub; } |
| 75 void set_video_encode_task_runner( |
| 76 scoped_refptr<base::SingleThreadTaskRunner> runner) { |
| 77 video_encode_task_runner_ = runner; |
| 78 } |
| 70 | 79 |
| 71 EventHandler* event_handler() { return event_handler_; } | 80 EventHandler* event_handler() { return event_handler_; } |
| 72 ClipboardStub* clipboard_stub() { return clipboard_stub_; } | 81 ClipboardStub* clipboard_stub() { return clipboard_stub_; } |
| 73 HostStub* host_stub() { return host_stub_; } | 82 HostStub* host_stub() { return host_stub_; } |
| 74 InputStub* input_stub() { return input_stub_; } | 83 InputStub* input_stub() { return input_stub_; } |
| 84 VideoStub* video_stub() { return video_stub_; } |
| 85 VideoFeedbackStub* video_feedback_stub() { return video_feedback_stub_; } |
| 75 | 86 |
| 76 bool is_connected() { return is_connected_; } | 87 bool is_connected() { return is_connected_; } |
| 77 ErrorCode disconnect_error() { return disconnect_error_; } | 88 ErrorCode disconnect_error() { return disconnect_error_; } |
| 78 | 89 |
| 79 private: | 90 private: |
| 80 std::unique_ptr<Session> session_; | 91 std::unique_ptr<Session> session_; |
| 81 EventHandler* event_handler_ = nullptr; | 92 EventHandler* event_handler_ = nullptr; |
| 82 | 93 |
| 83 base::WeakPtr<FakeVideoStream> last_video_stream_; | 94 base::WeakPtr<FakeVideoStream> last_video_stream_; |
| 84 | 95 |
| 85 AudioStub* audio_stub_ = nullptr; | 96 AudioStub* audio_stub_ = nullptr; |
| 86 ClientStub* client_stub_ = nullptr; | 97 ClientStub* client_stub_ = nullptr; |
| 87 | 98 |
| 88 ClipboardStub* clipboard_stub_ = nullptr; | 99 ClipboardStub* clipboard_stub_ = nullptr; |
| 89 HostStub* host_stub_ = nullptr; | 100 HostStub* host_stub_ = nullptr; |
| 90 InputStub* input_stub_ = nullptr; | 101 InputStub* input_stub_ = nullptr; |
| 102 VideoStub* video_stub_ = nullptr; |
| 103 VideoFeedbackStub* video_feedback_stub_ = nullptr; |
| 104 |
| 105 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_; |
| 91 | 106 |
| 92 bool is_connected_ = true; | 107 bool is_connected_ = true; |
| 93 ErrorCode disconnect_error_ = OK; | 108 ErrorCode disconnect_error_ = OK; |
| 94 | 109 |
| 95 DISALLOW_COPY_AND_ASSIGN(FakeConnectionToClient); | 110 DISALLOW_COPY_AND_ASSIGN(FakeConnectionToClient); |
| 96 }; | 111 }; |
| 97 | 112 |
| 98 } // namespace protocol | 113 } // namespace protocol |
| 99 } // namespace remoting | 114 } // namespace remoting |
| 100 | 115 |
| 101 #endif // REMOTING_PROTOCOL_FAKE_CONNECTION_TO_CLIENT_H_ | 116 #endif // REMOTING_PROTOCOL_FAKE_CONNECTION_TO_CLIENT_H_ |
| OLD | NEW |