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..e8e40c82b54ba0c914a5c8232928592562d3e605 100644 |
--- a/remoting/client/jni/jni_frame_consumer.h |
+++ b/remoting/client/jni/jni_frame_consumer.h |
@@ -14,13 +14,13 @@ 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(); |
+ JniFrameConsumer(ChromotingJniRuntime* jni_environment); |
virtual ~JniFrameConsumer(); |
// This must be called once before the producer's source size is set. |
@@ -38,13 +38,14 @@ 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_; |
+ // 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_; |
SkIRect clip_area_; |
+ ChromotingJniRuntime* jni_runtime_; |
// If |provide_buffer_|, allocates a new buffer of |view_size_|, informs |
// Java about it, and tells the producer to draw onto it. Otherwise, no-op. |