OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |