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

Side by Side Diff: android_webview/unittestjava/src/org/chromium/android_webview/unittest/InputStreamUnittest.java

Issue 11363123: [android_webview] Don't block the IO thread when reading from an InputStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix double-free Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.android_webview.unittest;
6
7 import org.chromium.base.CalledByNative;
8
9 import java.io.InputStream;
10 import java.io.IOException;
11
12 class InputStreamUnittest {
13 private InputStreamUnittest() {
14 }
15
16 @CalledByNative
17 static InputStream getEmptyStream() {
18 return new InputStream() {
19 @Override
20 public int read() {
21 return -1;
22 }
23 };
24 }
25
26 @CalledByNative
27 static InputStream getCountingStream(final int size) {
28 return new InputStream() {
29 private int count = 0;
30
31 @Override
32 public int read() {
33 if (count < size)
34 return count++ % 256;
35 else
36 return -1;
37 }
38 };
39 }
40 }
OLDNEW
« android_webview/native/input_stream_impl.cc ('K') | « android_webview/native/webview_native.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698