Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 package org.chromium.net; | |
| 5 | |
| 6 import java.util.concurrent.Executor; | |
| 7 | |
| 8 /** | |
| 9 * {@link UrlRequest} that exposes experimental features. Created using | |
| 10 * {@link ExperimentalUrlRequest.Builder}. Every instance of {@link UrlRequest} can | |
| 11 * be casted to an instance of this class. | |
| 12 * | |
| 13 * {@hide} since this class exposes experimental features that should be hidden. | |
| 14 */ | |
| 15 public abstract class ExperimentalUrlRequest extends UrlRequest { | |
| 16 /** | |
| 17 * Builder for building {@link UrlRequest}. | |
|
pauljensen
2016/10/03 15:22:37
add comment about how one creates an instance of t
kapishnikov
2016/10/03 23:49:27
Done.
| |
| 18 */ | |
| 19 public abstract static class Builder extends UrlRequest.Builder { | |
| 20 /** | |
| 21 * Disables connection migration for the request if enabled for | |
| 22 * the session. | |
| 23 * @return the builder to facilitate chaining. | |
| 24 */ | |
| 25 public abstract Builder disableConnectionMigration(); | |
| 26 | |
| 27 /** | |
| 28 * Associates the annotation object with this request. May add more than one. | |
| 29 * Passed through to a {@link RequestFinishedInfo.Listener}, | |
| 30 * see {@link RequestFinishedInfo#getAnnotations}. | |
| 31 * | |
| 32 * @param annotation an object to pass on to the {@link RequestFinishedI nfo.Listener} with a | |
| 33 * {@link RequestFinishedInfo}. | |
| 34 * @return the builder to facilitate chaining. | |
| 35 */ | |
| 36 public abstract Builder addRequestAnnotation(Object annotation); | |
| 37 | |
| 38 // To support method chaining, override superclass methods to return an | |
| 39 // instance of this class instead of the parent. | |
| 40 | |
| 41 @Override | |
| 42 public abstract Builder setHttpMethod(String method); | |
| 43 | |
| 44 @Override | |
| 45 public abstract Builder addHeader(String header, String value); | |
| 46 | |
| 47 @Override | |
| 48 public abstract Builder disableCache(); | |
| 49 | |
| 50 @Override | |
| 51 public abstract Builder setPriority(int priority); | |
| 52 | |
| 53 @Override | |
| 54 public abstract Builder setUploadDataProvider( | |
| 55 UploadDataProvider uploadDataProvider, Executor executor); | |
| 56 | |
| 57 @Override | |
| 58 public abstract Builder allowDirectExecutor(); | |
| 59 | |
| 60 @Override | |
| 61 public abstract ExperimentalUrlRequest build(); | |
| 62 } | |
| 63 } | |
| OLD | NEW |