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

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

Issue 1002883002: Fix up if statement curly braces issues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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;
6 6
7 import android.util.Log; 7 import android.util.Log;
8 8
9 import org.apache.http.conn.ConnectTimeoutException; 9 import org.apache.http.conn.ConnectTimeoutException;
10 import org.chromium.base.CalledByNative; 10 import org.chromium.base.CalledByNative;
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 /** 679 /**
680 * Reads a sequence of bytes from upload channel into the given buffer. 680 * Reads a sequence of bytes from upload channel into the given buffer.
681 * @param dest The buffer into which bytes are to be transferred. 681 * @param dest The buffer into which bytes are to be transferred.
682 * @return Returns number of bytes read (could be 0) or -1 and closes 682 * @return Returns number of bytes read (could be 0) or -1 and closes
683 * the channel if error occured. 683 * the channel if error occured.
684 */ 684 */
685 @SuppressWarnings("unused") 685 @SuppressWarnings("unused")
686 @CalledByNative 686 @CalledByNative
687 private int readFromUploadChannel(ByteBuffer dest) { 687 private int readFromUploadChannel(ByteBuffer dest) {
688 try { 688 try {
689 if (mUploadChannel == null || !mUploadChannel.isOpen()) 689 if (mUploadChannel == null || !mUploadChannel.isOpen()) return -1;
690 return -1;
mef 2015/03/13 14:39:12 Just to make sure I understand it correctly: - Is
Ted C 2015/03/13 16:33:20 Up to the coder and based on readability. But if
691 int result = mUploadChannel.read(dest); 690 int result = mUploadChannel.read(dest);
692 if (result < 0) { 691 if (result < 0) {
693 mUploadChannel.close(); 692 mUploadChannel.close();
694 return 0; 693 return 0;
695 } 694 }
696 return result; 695 return result;
697 } catch (Exception e) { 696 } catch (Exception e) {
698 onCalledByNativeException(e); 697 onCalledByNativeException(e);
699 } 698 }
700 return -1; 699 return -1;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 private native void nativeGetAllHeaders(long urlRequestAdapter, 746 private native void nativeGetAllHeaders(long urlRequestAdapter,
748 ResponseHeadersMap headers); 747 ResponseHeadersMap headers);
749 748
750 private native String nativeGetNegotiatedProtocol(long urlRequestAdapter); 749 private native String nativeGetNegotiatedProtocol(long urlRequestAdapter);
751 750
752 // Explicit class to work around JNI-generator generics confusion. 751 // Explicit class to work around JNI-generator generics confusion.
753 private static class ResponseHeadersMap extends 752 private static class ResponseHeadersMap extends
754 HashMap<String, List<String>> { 753 HashMap<String, List<String>> {
755 } 754 }
756 } 755 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698