OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // ChromotingClient is the controller for the Client implementation. | 5 // ChromotingClient is the controller for the Client implementation. |
6 | 6 |
7 #ifndef REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 7 #ifndef REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
8 #define REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 8 #define REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // Signals that the associated view may need updating. | 59 // Signals that the associated view may need updating. |
60 virtual void Repaint(); | 60 virtual void Repaint(); |
61 | 61 |
62 // ConnectionToHost::HostEventCallback implementation. | 62 // ConnectionToHost::HostEventCallback implementation. |
63 virtual void OnConnectionState( | 63 virtual void OnConnectionState( |
64 protocol::ConnectionToHost::State state, | 64 protocol::ConnectionToHost::State state, |
65 protocol::ConnectionToHost::Error error) OVERRIDE; | 65 protocol::ConnectionToHost::Error error) OVERRIDE; |
66 | 66 |
67 // ClientStub implementation. | 67 // ClientStub implementation. |
68 virtual void BeginSessionResponse(const protocol::LocalLoginStatus* msg, | 68 virtual void BeginSessionResponse(const protocol::LocalLoginStatus* msg, |
69 Task* done) OVERRIDE; | 69 const base::Closure& done) OVERRIDE; |
70 | 70 |
71 // VideoStub implementation. | 71 // VideoStub implementation. |
72 virtual void ProcessVideoPacket(const VideoPacket* packet, | 72 virtual void ProcessVideoPacket(const VideoPacket* packet, |
73 Task* done) OVERRIDE; | 73 const base::Closure& done) OVERRIDE; |
74 virtual int GetPendingPackets() OVERRIDE; | 74 virtual int GetPendingPackets() OVERRIDE; |
75 | 75 |
76 private: | 76 private: |
77 struct QueuedVideoPacket { | 77 struct QueuedVideoPacket { |
78 QueuedVideoPacket(const VideoPacket* packet, Task* done) | 78 QueuedVideoPacket(const VideoPacket* packet, const base::Closure& done); |
79 : packet(packet), done(done) { | 79 ~QueuedVideoPacket(); |
80 } | |
81 const VideoPacket* packet; | 80 const VideoPacket* packet; |
82 Task* done; | 81 base::Closure done; |
83 }; | 82 }; |
84 | 83 |
85 base::MessageLoopProxy* message_loop(); | 84 base::MessageLoopProxy* message_loop(); |
86 | 85 |
87 // Initializes connection. | 86 // Initializes connection. |
88 void Initialize(); | 87 void Initialize(); |
89 | 88 |
90 // If a packet is not being processed, dispatches a single message from the | 89 // If a packet is not being processed, dispatches a single message from the |
91 // |received_packets_| queue. | 90 // |received_packets_| queue. |
92 void DispatchPacket(); | 91 void DispatchPacket(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 ScopedThreadProxy thread_proxy_; | 127 ScopedThreadProxy thread_proxy_; |
129 | 128 |
130 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); | 129 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); |
131 }; | 130 }; |
132 | 131 |
133 } // namespace remoting | 132 } // namespace remoting |
134 | 133 |
135 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::ChromotingClient); | 134 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::ChromotingClient); |
136 | 135 |
137 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 136 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
OLD | NEW |