OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CLIENT_CHROMOTING_JNI_INSTANCE_H_ | 5 #ifndef REMOTING_CLIENT_CHROMOTING_JNI_INSTANCE_H_ |
6 #define REMOTING_CLIENT_CHROMOTING_JNI_INSTANCE_H_ | 6 #define REMOTING_CLIENT_CHROMOTING_JNI_INSTANCE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "remoting/protocol/connection_to_host.h" | 22 #include "remoting/protocol/connection_to_host.h" |
23 #include "remoting/protocol/cursor_shape_stub.h" | 23 #include "remoting/protocol/cursor_shape_stub.h" |
24 | 24 |
25 namespace remoting { | 25 namespace remoting { |
26 | 26 |
27 namespace protocol { | 27 namespace protocol { |
28 class ClipboardEvent; | 28 class ClipboardEvent; |
29 class CursorShapeInfo; | 29 class CursorShapeInfo; |
30 } // namespace protocol | 30 } // namespace protocol |
31 | 31 |
| 32 class VideoRenderer; |
| 33 |
32 // ClientUserInterface that indirectly makes and receives JNI calls. | 34 // ClientUserInterface that indirectly makes and receives JNI calls. |
33 class ChromotingJniInstance | 35 class ChromotingJniInstance |
34 : public ClientUserInterface, | 36 : public ClientUserInterface, |
35 public protocol::ClipboardStub, | 37 public protocol::ClipboardStub, |
36 public protocol::CursorShapeStub, | 38 public protocol::CursorShapeStub, |
37 public base::RefCountedThreadSafe<ChromotingJniInstance> { | 39 public base::RefCountedThreadSafe<ChromotingJniInstance> { |
38 public: | 40 public: |
39 // Initiates a connection with the specified host. Call from the UI thread. | 41 // Initiates a connection with the specified host. Call from the UI thread. |
40 // The instance does not take ownership of |jni_runtime|. To connect with an | 42 // The instance does not take ownership of |jni_runtime|. To connect with an |
41 // unpaired host, pass in |pairing_id| and |pairing_secret| as empty strings. | 43 // unpaired host, pass in |pairing_id| and |pairing_secret| as empty strings. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 std::string host_id_; | 131 std::string host_id_; |
130 | 132 |
131 // This group of variables is to be used on the display thread. | 133 // This group of variables is to be used on the display thread. |
132 scoped_refptr<FrameConsumerProxy> frame_consumer_; | 134 scoped_refptr<FrameConsumerProxy> frame_consumer_; |
133 scoped_ptr<JniFrameConsumer> view_; | 135 scoped_ptr<JniFrameConsumer> view_; |
134 scoped_ptr<base::WeakPtrFactory<JniFrameConsumer> > view_weak_factory_; | 136 scoped_ptr<base::WeakPtrFactory<JniFrameConsumer> > view_weak_factory_; |
135 | 137 |
136 // This group of variables is to be used on the network thread. | 138 // This group of variables is to be used on the network thread. |
137 ClientConfig client_config_; | 139 ClientConfig client_config_; |
138 scoped_ptr<ClientContext> client_context_; | 140 scoped_ptr<ClientContext> client_context_; |
| 141 scoped_ptr<VideoRenderer> video_renderer_; |
139 scoped_ptr<protocol::ConnectionToHost> connection_; | 142 scoped_ptr<protocol::ConnectionToHost> connection_; |
140 scoped_ptr<ChromotingClient> client_; | 143 scoped_ptr<ChromotingClient> client_; |
141 XmppSignalStrategy::XmppServerConfig xmpp_config_; | 144 XmppSignalStrategy::XmppServerConfig xmpp_config_; |
142 scoped_ptr<XmppSignalStrategy> signaling_; // Must outlive client_ | 145 scoped_ptr<XmppSignalStrategy> signaling_; // Must outlive client_ |
143 | 146 |
144 // Pass this the user's PIN once we have it. To be assigned and accessed on | 147 // Pass this the user's PIN once we have it. To be assigned and accessed on |
145 // the UI thread, but must be posted to the network thread to call it. | 148 // the UI thread, but must be posted to the network thread to call it. |
146 protocol::SecretFetchedCallback pin_callback_; | 149 protocol::SecretFetchedCallback pin_callback_; |
147 | 150 |
148 // Indicates whether to establish a new pairing with this host. This is | 151 // Indicates whether to establish a new pairing with this host. This is |
149 // modified in ProvideSecret(), but thereafter to be used only from the | 152 // modified in ProvideSecret(), but thereafter to be used only from the |
150 // network thread. (This is safe because ProvideSecret() is invoked at most | 153 // network thread. (This is safe because ProvideSecret() is invoked at most |
151 // once per run, and always before any reference to this flag.) | 154 // once per run, and always before any reference to this flag.) |
152 bool create_pairing_; | 155 bool create_pairing_; |
153 | 156 |
154 // If this is true, performance statistics will be periodically written to | 157 // If this is true, performance statistics will be periodically written to |
155 // the Android log. Used on the network thread. | 158 // the Android log. Used on the network thread. |
156 bool stats_logging_enabled_; | 159 bool stats_logging_enabled_; |
157 | 160 |
158 friend class base::RefCountedThreadSafe<ChromotingJniInstance>; | 161 friend class base::RefCountedThreadSafe<ChromotingJniInstance>; |
159 | 162 |
160 DISALLOW_COPY_AND_ASSIGN(ChromotingJniInstance); | 163 DISALLOW_COPY_AND_ASSIGN(ChromotingJniInstance); |
161 }; | 164 }; |
162 | 165 |
163 } // namespace remoting | 166 } // namespace remoting |
164 | 167 |
165 #endif | 168 #endif |
OLD | NEW |