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