Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(975)

Side by Side Diff: remoting/protocol/webrtc_connection_to_client.h

Issue 2334293002: Two minor cleanups in remoting protocol. (Closed)
Patch Set: . Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_WEBRTC_CONNECTION_TO_CLIENT_H_ 5 #ifndef REMOTING_PROTOCOL_WEBRTC_CONNECTION_TO_CLIENT_H_
6 #define REMOTING_PROTOCOL_WEBRTC_CONNECTION_TO_CLIENT_H_ 6 #define REMOTING_PROTOCOL_WEBRTC_CONNECTION_TO_CLIENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 22 matching lines...) Expand all
33 std::unique_ptr<Session> session, 33 std::unique_ptr<Session> session,
34 scoped_refptr<protocol::TransportContext> transport_context, 34 scoped_refptr<protocol::TransportContext> transport_context,
35 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner); 35 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner);
36 ~WebrtcConnectionToClient() override; 36 ~WebrtcConnectionToClient() override;
37 37
38 // ConnectionToClient interface. 38 // ConnectionToClient interface.
39 void SetEventHandler( 39 void SetEventHandler(
40 ConnectionToClient::EventHandler* event_handler) override; 40 ConnectionToClient::EventHandler* event_handler) override;
41 Session* session() override; 41 Session* session() override;
42 void Disconnect(ErrorCode error) override; 42 void Disconnect(ErrorCode error) override;
43 void OnInputEventReceived(int64_t timestamp) override;
44 std::unique_ptr<VideoStream> StartVideoStream( 43 std::unique_ptr<VideoStream> StartVideoStream(
45 std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer) override; 44 std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer) override;
46 std::unique_ptr<AudioStream> StartAudioStream( 45 std::unique_ptr<AudioStream> StartAudioStream(
47 std::unique_ptr<AudioSource> audio_source) override; 46 std::unique_ptr<AudioSource> audio_source) override;
48 ClientStub* client_stub() override; 47 ClientStub* client_stub() override;
49 void set_clipboard_stub(ClipboardStub* clipboard_stub) override; 48 void set_clipboard_stub(ClipboardStub* clipboard_stub) override;
50 void set_host_stub(HostStub* host_stub) override; 49 void set_host_stub(HostStub* host_stub) override;
51 void set_input_stub(InputStub* input_stub) override; 50 void set_input_stub(InputStub* input_stub) override;
52 51
53 // Session::EventHandler interface. 52 // Session::EventHandler interface.
54 void OnSessionStateChange(Session::State state) override; 53 void OnSessionStateChange(Session::State state) override;
55 54
56 // WebrtcTransport::EventHandler interface 55 // WebrtcTransport::EventHandler interface
57 void OnWebrtcTransportConnecting() override; 56 void OnWebrtcTransportConnecting() override;
58 void OnWebrtcTransportConnected() override; 57 void OnWebrtcTransportConnected() override;
59 void OnWebrtcTransportError(ErrorCode error) override; 58 void OnWebrtcTransportError(ErrorCode error) override;
60 void OnWebrtcTransportIncomingDataChannel( 59 void OnWebrtcTransportIncomingDataChannel(
61 const std::string& name, 60 const std::string& name,
62 std::unique_ptr<MessagePipe> pipe) override; 61 std::unique_ptr<MessagePipe> pipe) override;
63 void OnWebrtcTransportMediaStreamAdded( 62 void OnWebrtcTransportMediaStreamAdded(
64 scoped_refptr<webrtc::MediaStreamInterface> stream) override; 63 scoped_refptr<webrtc::MediaStreamInterface> stream) override;
65 void OnWebrtcTransportMediaStreamRemoved( 64 void OnWebrtcTransportMediaStreamRemoved(
66 scoped_refptr<webrtc::MediaStreamInterface> stream) override; 65 scoped_refptr<webrtc::MediaStreamInterface> stream) override;
67 66
68 // ChannelDispatcherBase::EventHandler interface. 67 // ChannelDispatcherBase::EventHandler interface.
69 void OnChannelInitialized(ChannelDispatcherBase* channel_dispatcher) override; 68 void OnChannelInitialized(ChannelDispatcherBase* channel_dispatcher) override;
70 void OnChannelClosed(ChannelDispatcherBase* channel_dispatcher) override; 69 void OnChannelClosed(ChannelDispatcherBase* channel_dispatcher) override;
71 70
72 private: 71 private:
72 // Callback for the event dispatcher.
73 void OnInputEventReceived(int64_t timestamp);
74
73 base::ThreadChecker thread_checker_; 75 base::ThreadChecker thread_checker_;
74 76
75 // Event handler for handling events sent from this object. 77 // Event handler for handling events sent from this object.
76 ConnectionToClient::EventHandler* event_handler_ = nullptr; 78 ConnectionToClient::EventHandler* event_handler_ = nullptr;
77 79
78 std::unique_ptr<WebrtcTransport> transport_; 80 std::unique_ptr<WebrtcTransport> transport_;
79 81
80 std::unique_ptr<Session> session_; 82 std::unique_ptr<Session> session_;
81 83
82 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_; 84 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_;
83 85
84 std::unique_ptr<HostControlDispatcher> control_dispatcher_; 86 std::unique_ptr<HostControlDispatcher> control_dispatcher_;
85 std::unique_ptr<HostEventDispatcher> event_dispatcher_; 87 std::unique_ptr<HostEventDispatcher> event_dispatcher_;
86 base::WeakPtrFactory<WebrtcConnectionToClient> weak_factory_; 88 base::WeakPtrFactory<WebrtcConnectionToClient> weak_factory_;
87 89
88 DISALLOW_COPY_AND_ASSIGN(WebrtcConnectionToClient); 90 DISALLOW_COPY_AND_ASSIGN(WebrtcConnectionToClient);
89 }; 91 };
90 92
91 } // namespace protocol 93 } // namespace protocol
92 } // namespace remoting 94 } // namespace remoting
93 95
94 #endif // REMOTING_PROTOCOL_WEBRTC_CONNECTION_TO_CLIENT_H_ 96 #endif // REMOTING_PROTOCOL_WEBRTC_CONNECTION_TO_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698