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

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

Issue 2476983002: Fix null annotations, and move checks into RequestFinishedInfo (Closed)
Patch Set: Created 4 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
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.impl; 5 package org.chromium.net.impl;
6 6
7 import org.chromium.base.Log; 7 import org.chromium.base.Log;
8 import org.chromium.base.VisibleForTesting; 8 import org.chromium.base.VisibleForTesting;
9 import org.chromium.base.annotations.CalledByNative; 9 import org.chromium.base.annotations.CalledByNative;
10 import org.chromium.base.annotations.JNIAdditionalImport; 10 import org.chromium.base.annotations.JNIAdditionalImport;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 boolean disableCache, boolean disableConnectionMigration, boolean al lowDirectExecutor) { 131 boolean disableCache, boolean disableConnectionMigration, boolean al lowDirectExecutor) {
132 if (url == null) { 132 if (url == null) {
133 throw new NullPointerException("URL is required"); 133 throw new NullPointerException("URL is required");
134 } 134 }
135 if (callback == null) { 135 if (callback == null) {
136 throw new NullPointerException("Listener is required"); 136 throw new NullPointerException("Listener is required");
137 } 137 }
138 if (executor == null) { 138 if (executor == null) {
139 throw new NullPointerException("Executor is required"); 139 throw new NullPointerException("Executor is required");
140 } 140 }
141 if (requestAnnotations == null) {
142 throw new NullPointerException("requestAnnotations is required");
143 }
144 141
145 mAllowDirectExecutor = allowDirectExecutor; 142 mAllowDirectExecutor = allowDirectExecutor;
146 mRequestContext = requestContext; 143 mRequestContext = requestContext;
147 mInitialUrl = url; 144 mInitialUrl = url;
148 mUrlChain.add(url); 145 mUrlChain.add(url);
149 mPriority = convertRequestPriority(priority); 146 mPriority = convertRequestPriority(priority);
150 mCallback = callback; 147 mCallback = callback;
151 mExecutor = executor; 148 mExecutor = executor;
152 mRequestAnnotations = requestAnnotations; 149 mRequestAnnotations = requestAnnotations;
153 mDisableCache = disableCache; 150 mDisableCache = disableCache;
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 @NativeClassQualifiedName("CronetURLRequestAdapter") 773 @NativeClassQualifiedName("CronetURLRequestAdapter")
777 private native boolean nativeReadData( 774 private native boolean nativeReadData(
778 long nativePtr, ByteBuffer byteBuffer, int position, int capacity); 775 long nativePtr, ByteBuffer byteBuffer, int position, int capacity);
779 776
780 @NativeClassQualifiedName("CronetURLRequestAdapter") 777 @NativeClassQualifiedName("CronetURLRequestAdapter")
781 private native void nativeDestroy(long nativePtr, boolean sendOnCanceled); 778 private native void nativeDestroy(long nativePtr, boolean sendOnCanceled);
782 779
783 @NativeClassQualifiedName("CronetURLRequestAdapter") 780 @NativeClassQualifiedName("CronetURLRequestAdapter")
784 private native void nativeGetStatus(long nativePtr, UrlRequest.StatusListene r listener); 781 private native void nativeGetStatus(long nativePtr, UrlRequest.StatusListene r listener);
785 } 782 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698