summaryrefslogtreecommitdiffstats
path: root/android_webview/native/input_stream_impl.cc
diff options
context:
space:
mode:
authorbenm@chromium.org <benm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-03 16:26:39 +0000
committerbenm@chromium.org <benm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-03 16:26:39 +0000
commit0a6d8e214dd722a1982b55617bcc12df44712eb5 (patch)
tree367fa913e2cf339aa3a95c22a9234aa557daf534 /android_webview/native/input_stream_impl.cc
parentba47a183328a3ea283702004cf40310452b4a731 (diff)
downloadchromium_src-0a6d8e214dd722a1982b55617bcc12df44712eb5.zip
chromium_src-0a6d8e214dd722a1982b55617bcc12df44712eb5.tar.gz
chromium_src-0a6d8e214dd722a1982b55617bcc12df44712eb5.tar.bz2
[Android WebView] Close InputStreams when we're done with them.
When the native side of a Java Input Stream is destroyed, invoke the Java side close() method. Android only, android bots green NOTRY=true Review URL: https://chromiumcodereview.appspot.com/11748015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174967 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/native/input_stream_impl.cc')
-rw-r--r--android_webview/native/input_stream_impl.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/android_webview/native/input_stream_impl.cc b/android_webview/native/input_stream_impl.cc
index 5838650..5272ee54 100644
--- a/android_webview/native/input_stream_impl.cc
+++ b/android_webview/native/input_stream_impl.cc
@@ -18,6 +18,7 @@ using base::android::AttachCurrentThread;
using base::android::ClearException;
using base::android::JavaRef;
using JNI_InputStream::Java_InputStream_available;
+using JNI_InputStream::Java_InputStream_close;
using JNI_InputStream::Java_InputStream_skip;
using JNI_InputStream::Java_InputStream_readI_AB_I_I;
@@ -45,6 +46,9 @@ InputStreamImpl::InputStreamImpl(const JavaRef<jobject>& stream)
}
InputStreamImpl::~InputStreamImpl() {
+ JNIEnv* env = AttachCurrentThread();
+ Java_InputStream_close(env, jobject_.obj());
+ DCHECK(!ClearException(env));
}
bool InputStreamImpl::BytesAvailable(int* bytes_available) const {