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

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

Issue 2178053002: Change RequestFinishedListener to provide executor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: formatting Created 4 years, 4 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.support.annotation.IntDef; 7 import android.support.annotation.IntDef;
8 import android.util.Log; 8 import android.util.Log;
9 import android.util.Pair; 9 import android.util.Pair;
10 10
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 if (mMethod == null) { 221 if (mMethod == null) {
222 mMethod = "POST"; 222 mMethod = "POST";
223 } 223 }
224 mUploadDataProvider = uploadDataProvider; 224 mUploadDataProvider = uploadDataProvider;
225 mUploadDataProviderExecutor = executor; 225 mUploadDataProviderExecutor = executor;
226 return this; 226 return this;
227 } 227 }
228 228
229 /** 229 /**
230 * Associates the annotation object with this request. May add more than one. 230 * Associates the annotation object with this request. May add more than one.
231 * Passed through to a {@link CronetEngine.RequestFinishedListener}, 231 * Passed through to a {@link RequestFinishedListener},
232 * see {@link CronetEngine.UrlRequestInfo#getAnnotations}. 232 * see {@link CronetEngine.UrlRequestInfo#getAnnotations}.
233 * 233 *
234 * @param annotation an object to pass on to the 234 * @param annotation an object to pass on to the {@link RequestFinishedL istener} with a
235 * {@link CronetEngine.RequestFinishedListener} with a {@link CronetEngi ne.UrlRequestInfo}. 235 * {@link CronetEngine.UrlRequestInfo}.
236 * @return the builder to facilitate chaining. 236 * @return the builder to facilitate chaining.
237 * 237 *
238 * @hide as it's a prototype. 238 * @hide as it's a prototype.
239 */ 239 */
240 public Builder addRequestAnnotation(Object annotation) { 240 public Builder addRequestAnnotation(Object annotation) {
241 if (annotation == null) { 241 if (annotation == null) {
242 throw new NullPointerException("Invalid metrics annotation."); 242 throw new NullPointerException("Invalid metrics annotation.");
243 } 243 }
244 if (mRequestAnnotations.isEmpty()) { 244 if (mRequestAnnotations.isEmpty()) {
245 mRequestAnnotations = new ArrayList<Object>(); 245 mRequestAnnotations = new ArrayList<Object>();
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 * the request's current status. {@code listener} will be invoked 678 * the request's current status. {@code listener} will be invoked
679 * back on the {@link Executor} passed in when the request was 679 * back on the {@link Executor} passed in when the request was
680 * created. 680 * created.
681 */ 681 */
682 public void getStatus(final StatusListener listener); 682 public void getStatus(final StatusListener listener);
683 683
684 // Note: There are deliberately no accessors for the results of the request 684 // Note: There are deliberately no accessors for the results of the request
685 // here. Having none removes any ambiguity over when they are populated, 685 // here. Having none removes any ambiguity over when they are populated,
686 // particularly in the redirect case. 686 // particularly in the redirect case.
687 } 687 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698