Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Unified Diff: remoting/client/jni/jni_frame_consumer.h

Issue 19967007: Various improvements to the Chromoting Android app (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments to clarify ChromotingJniRuntime pointer lifetimes Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/jni/chromoting_jni_runtime.cc ('k') | remoting/client/jni/jni_frame_consumer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/jni/jni_frame_consumer.h
diff --git a/remoting/client/jni/jni_frame_consumer.h b/remoting/client/jni/jni_frame_consumer.h
index b74681f66ec6b1baa240ec5e6d345e5a856327b4..38ff86c61078ae9d58e9c3a1ed59d10399c78d65 100644
--- a/remoting/client/jni/jni_frame_consumer.h
+++ b/remoting/client/jni/jni_frame_consumer.h
@@ -14,13 +14,15 @@ class DesktopFrame;
} // namespace webrtc
namespace remoting {
-class ChromotingJni;
+class ChromotingJniRuntime;
class FrameProducer;
// FrameConsumer implementation that draws onto a JNI direct byte buffer.
class JniFrameConsumer : public FrameConsumer {
public:
- JniFrameConsumer();
+ // The instance does not take ownership of |jni_runtime|.
+ explicit JniFrameConsumer(ChromotingJniRuntime* jni_runtime);
+
virtual ~JniFrameConsumer();
// This must be called once before the producer's source size is set.
@@ -38,9 +40,12 @@ class JniFrameConsumer : public FrameConsumer {
private:
// Variables are to be used from the display thread.
- // Whether to allocate/provide the producer with a buffer when able. This
- // goes to false during destruction so that we don't leak memory.
- bool provide_buffer_;
+ // Used to obtain task runner references and make calls to Java methods.
+ ChromotingJniRuntime* jni_runtime_;
+
+ // Whether we're currently in the constructor, and should deallocate the
+ // buffer instead of passing it back to the producer.
+ bool in_dtor_;
FrameProducer* frame_producer_;
SkISize view_size_;
« no previous file with comments | « remoting/client/jni/chromoting_jni_runtime.cc ('k') | remoting/client/jni/jni_frame_consumer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698