OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/memory/weak_ptr.h" |
13 #include "base/time.h" | 14 #include "base/time.h" |
14 #include "remoting/base/scoped_thread_proxy.h" | |
15 #include "remoting/client/client_config.h" | 15 #include "remoting/client/client_config.h" |
16 #include "remoting/client/chromoting_stats.h" | 16 #include "remoting/client/chromoting_stats.h" |
17 #include "remoting/client/chromoting_view.h" | 17 #include "remoting/client/chromoting_view.h" |
18 #include "remoting/protocol/client_stub.h" | 18 #include "remoting/protocol/client_stub.h" |
19 #include "remoting/protocol/clipboard_stub.h" | 19 #include "remoting/protocol/clipboard_stub.h" |
20 #include "remoting/protocol/connection_to_host.h" | 20 #include "remoting/protocol/connection_to_host.h" |
21 #include "remoting/protocol/input_stub.h" | 21 #include "remoting/protocol/input_stub.h" |
22 #include "remoting/protocol/video_stub.h" | 22 #include "remoting/protocol/video_stub.h" |
23 #include "remoting/jingle_glue/xmpp_proxy.h" | 23 #include "remoting/jingle_glue/xmpp_proxy.h" |
24 | 24 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // True if a message is being processed. Can be used to determine if it is | 117 // True if a message is being processed. Can be used to determine if it is |
118 // safe to dispatch another message. | 118 // safe to dispatch another message. |
119 bool packet_being_processed_; | 119 bool packet_being_processed_; |
120 | 120 |
121 // Record the statistics of the connection. | 121 // Record the statistics of the connection. |
122 ChromotingStats stats_; | 122 ChromotingStats stats_; |
123 | 123 |
124 // Keep track of the last sequence number bounced back from the host. | 124 // Keep track of the last sequence number bounced back from the host. |
125 int64 last_sequence_number_; | 125 int64 last_sequence_number_; |
126 | 126 |
127 ScopedThreadProxy thread_proxy_; | 127 // WeakPtr used to avoid tasks accessing the client after it is deleted. |
| 128 base::WeakPtrFactory<ChromotingClient> weak_factory_; |
| 129 base::WeakPtr<ChromotingClient> weak_ptr_; |
128 | 130 |
129 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); | 131 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); |
130 }; | 132 }; |
131 | 133 |
132 } // namespace remoting | 134 } // namespace remoting |
133 | 135 |
134 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 136 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
OLD | NEW |