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_JNI_CHROMOTING_JNI_RUNTIME_H_ | 5 #ifndef REMOTING_CLIENT_JNI_CHROMOTING_JNI_RUNTIME_H_ |
6 #define REMOTING_CLIENT_JNI_CHROMOTING_JNI_RUNTIME_H_ | 6 #define REMOTING_CLIENT_JNI_CHROMOTING_JNI_RUNTIME_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/android/scoped_java_ref.h" | |
11 #include "base/at_exit.h" | 12 #include "base/at_exit.h" |
12 #include "net/url_request/url_request_context_getter.h" | 13 #include "net/url_request/url_request_context_getter.h" |
13 #include "remoting/base/auto_thread.h" | 14 #include "remoting/base/auto_thread.h" |
14 #include "remoting/client/jni/chromoting_jni_instance.h" | 15 #include "remoting/client/jni/chromoting_jni_instance.h" |
15 #include "remoting/protocol/connection_to_host.h" | 16 #include "remoting/protocol/connection_to_host.h" |
16 | 17 |
17 template<typename T> struct DefaultSingletonTraits; | 18 template<typename T> struct DefaultSingletonTraits; |
18 | 19 |
20 namespace webrtc { | |
21 class DesktopFrame; | |
Sergey Ulanov
2013/10/08 22:15:02
Not used in this file.
Lambros
2013/10/10 01:35:58
Removed.
| |
22 } // namespace webrtc | |
23 | |
19 namespace remoting { | 24 namespace remoting { |
20 | 25 |
21 // Houses the global resources on which the Chromoting components run | 26 // Houses the global resources on which the Chromoting components run |
22 // (e.g. message loops and task runners). Proxies outgoing JNI calls from its | 27 // (e.g. message loops and task runners). Proxies outgoing JNI calls from its |
23 // ChromotingJniInstance member to Java. All its methods should be invoked | 28 // ChromotingJniInstance member to Java. All its methods should be invoked |
24 // exclusively from the UI thread unless otherwise noted. | 29 // exclusively from the UI thread unless otherwise noted. |
25 class ChromotingJniRuntime { | 30 class ChromotingJniRuntime { |
26 public: | 31 public: |
27 // This class is instantiated at process initialization and persists until | 32 // This class is instantiated at process initialization and persists until |
28 // we close. Its components are reused across |ChromotingJniInstance|s. | 33 // we close. Its components are reused across |ChromotingJniInstance|s. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 protocol::ErrorCode error); | 77 protocol::ErrorCode error); |
73 | 78 |
74 // Pops up a dialog box asking the user to enter a PIN. Call on UI thread. | 79 // Pops up a dialog box asking the user to enter a PIN. Call on UI thread. |
75 void DisplayAuthenticationPrompt(bool pairing_supported); | 80 void DisplayAuthenticationPrompt(bool pairing_supported); |
76 | 81 |
77 // Saves new pairing credentials to permanent storage. Call on UI thread. | 82 // Saves new pairing credentials to permanent storage. Call on UI thread. |
78 void CommitPairingCredentials(const std::string& host, | 83 void CommitPairingCredentials(const std::string& host, |
79 const std::string& id, | 84 const std::string& id, |
80 const std::string& secret); | 85 const std::string& secret); |
81 | 86 |
82 // Updates image dimensions and canvas memory space. Call on display thread. | 87 // Creates a new Bitmap object to store a video frame. |
83 void UpdateImageBuffer(int width, int height, jobject buffer); | 88 base::android::ScopedJavaLocalRef<jobject> NewBitmap( |
89 webrtc::DesktopSize size); | |
90 | |
91 // Updates video frame bitmap. Call on the display thread. | |
92 void UpdateFrameBitmap(jobject bitmap); | |
Sergey Ulanov
2013/10/08 22:15:02
please comment that |bitmat| must be an android.gr
Lambros
2013/10/10 01:35:58
Done.
| |
84 | 93 |
85 // Updates cursor shape. Call on display thread. | 94 // Updates cursor shape. Call on display thread. |
86 void UpdateCursorShape(const protocol::CursorShapeInfo& cursor_shape); | 95 void UpdateCursorShape(const protocol::CursorShapeInfo& cursor_shape); |
87 | 96 |
88 // Draws the latest image buffer onto the canvas. Call on the display thread. | 97 // Draws the latest image buffer onto the canvas. Call on the display thread. |
89 void RedrawCanvas(); | 98 void RedrawCanvas(); |
90 | 99 |
91 private: | 100 private: |
92 ChromotingJniRuntime(); | 101 ChromotingJniRuntime(); |
93 | 102 |
(...skipping 28 matching lines...) Expand all Loading... | |
122 scoped_refptr<ChromotingJniInstance> session_; | 131 scoped_refptr<ChromotingJniInstance> session_; |
123 | 132 |
124 friend struct DefaultSingletonTraits<ChromotingJniRuntime>; | 133 friend struct DefaultSingletonTraits<ChromotingJniRuntime>; |
125 | 134 |
126 DISALLOW_COPY_AND_ASSIGN(ChromotingJniRuntime); | 135 DISALLOW_COPY_AND_ASSIGN(ChromotingJniRuntime); |
127 }; | 136 }; |
128 | 137 |
129 } // namespace remoting | 138 } // namespace remoting |
130 | 139 |
131 #endif | 140 #endif |
OLD | NEW |