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

Side by Side Diff: components/cronet/android/java/src/org/chromium/net/impl/InputStreamChannel.java

Issue 2339223002: Cronet API Refactoring (Closed)
Patch Set: Rebased onto Charles change + Paul's Comments Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 package org.chromium.net; 5 package org.chromium.net.impl;
6 6
7 import java.io.FileInputStream; 7 import java.io.FileInputStream;
8 import java.io.IOException; 8 import java.io.IOException;
9 import java.io.InputStream; 9 import java.io.InputStream;
10 import java.nio.ByteBuffer; 10 import java.nio.ByteBuffer;
11 import java.nio.channels.ReadableByteChannel; 11 import java.nio.channels.ReadableByteChannel;
12 import java.util.concurrent.atomic.AtomicBoolean; 12 import java.util.concurrent.atomic.AtomicBoolean;
13 13
14 /** 14 /**
15 * Adapts an {@link InputStream} into a {@link ReadableByteChannel}, exactly lik e 15 * Adapts an {@link InputStream} into a {@link ReadableByteChannel}, exactly lik e
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 return mIsOpen.get(); 66 return mIsOpen.get();
67 } 67 }
68 68
69 @Override 69 @Override
70 public void close() throws IOException { 70 public void close() throws IOException {
71 if (mIsOpen.compareAndSet(true, false)) { 71 if (mIsOpen.compareAndSet(true, false)) {
72 mInputStream.close(); 72 mInputStream.close();
73 } 73 }
74 } 74 }
75 } 75 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698