OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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> |
11 | 11 |
12 #include "base/task.h" | 12 #include "base/task.h" |
13 #include "remoting/client/client_config.h" | 13 #include "remoting/client/client_config.h" |
| 14 #include "remoting/client/chromoting_stats.h" |
14 #include "remoting/client/chromoting_view.h" | 15 #include "remoting/client/chromoting_view.h" |
15 #include "remoting/protocol/client_stub.h" | 16 #include "remoting/protocol/client_stub.h" |
16 #include "remoting/protocol/connection_to_host.h" | 17 #include "remoting/protocol/connection_to_host.h" |
17 #include "remoting/protocol/input_stub.h" | 18 #include "remoting/protocol/input_stub.h" |
18 #include "remoting/protocol/video_stub.h" | 19 #include "remoting/protocol/video_stub.h" |
19 #include "remoting/jingle_glue/xmpp_proxy.h" | 20 #include "remoting/jingle_glue/xmpp_proxy.h" |
20 | 21 |
21 class MessageLoop; | 22 class MessageLoop; |
22 | 23 |
23 namespace remoting { | 24 namespace remoting { |
(...skipping 22 matching lines...) Expand all Loading... |
46 CancelableTask* client_done); | 47 CancelableTask* client_done); |
47 virtual ~ChromotingClient(); | 48 virtual ~ChromotingClient(); |
48 | 49 |
49 void Start(); | 50 void Start(); |
50 void StartSandboxed(scoped_refptr<XmppProxy> xmpp_proxy, | 51 void StartSandboxed(scoped_refptr<XmppProxy> xmpp_proxy, |
51 const std::string& your_jid, | 52 const std::string& your_jid, |
52 const std::string& host_jid); | 53 const std::string& host_jid); |
53 void Stop(); | 54 void Stop(); |
54 void ClientDone(); | 55 void ClientDone(); |
55 | 56 |
| 57 // Return the stats recorded by this client. |
| 58 ChromotingStats* GetStats(); |
| 59 |
56 // Signals that the associated view may need updating. | 60 // Signals that the associated view may need updating. |
57 virtual void Repaint(); | 61 virtual void Repaint(); |
58 | 62 |
59 // Sets the viewport to do display. The viewport may be larger and/or | 63 // Sets the viewport to do display. The viewport may be larger and/or |
60 // smaller than the actual image background being displayed. | 64 // smaller than the actual image background being displayed. |
61 // | 65 // |
62 // TODO(ajwong): This doesn't make sense to have here. We're going to have | 66 // TODO(ajwong): This doesn't make sense to have here. We're going to have |
63 // threading isseus since pepper view needs to be called from the main pepper | 67 // threading isseus since pepper view needs to be called from the main pepper |
64 // thread synchronously really. | 68 // thread synchronously really. |
65 virtual void SetViewport(int x, int y, int width, int height); | 69 virtual void SetViewport(int x, int y, int width, int height); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // Contains all video packets that have been received, but have not yet been | 122 // Contains all video packets that have been received, but have not yet been |
119 // processed. | 123 // processed. |
120 // | 124 // |
121 // Used to serialize sending of messages to the client. | 125 // Used to serialize sending of messages to the client. |
122 std::list<QueuedVideoPacket> received_packets_; | 126 std::list<QueuedVideoPacket> received_packets_; |
123 | 127 |
124 // True if a message is being processed. Can be used to determine if it is | 128 // True if a message is being processed. Can be used to determine if it is |
125 // safe to dispatch another message. | 129 // safe to dispatch another message. |
126 bool packet_being_processed_; | 130 bool packet_being_processed_; |
127 | 131 |
| 132 // Record the statistics of the connection. |
| 133 ChromotingStats stats_; |
| 134 |
128 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); | 135 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); |
129 }; | 136 }; |
130 | 137 |
131 } // namespace remoting | 138 } // namespace remoting |
132 | 139 |
133 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::ChromotingClient); | 140 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::ChromotingClient); |
134 | 141 |
135 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H | 142 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
OLD | NEW |