Chromium Code Reviews| Index: components/cronet/android/api/src/org/chromium/net/ExperimentalUrlRequest.java |
| diff --git a/components/cronet/android/api/src/org/chromium/net/ExperimentalUrlRequest.java b/components/cronet/android/api/src/org/chromium/net/ExperimentalUrlRequest.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2a321e340c21291f221a3711f1eb5bc420128b28 |
| --- /dev/null |
| +++ b/components/cronet/android/api/src/org/chromium/net/ExperimentalUrlRequest.java |
| @@ -0,0 +1,63 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| +package org.chromium.net; |
| + |
| +import java.util.concurrent.Executor; |
| + |
| +/** |
| + * {@link UrlRequest} that exposes experimental features. Created using |
| + * {@link ExperimentalUrlRequest.Builder}. Every instance of {@link UrlRequest} can |
| + * be casted to an instance of this class. |
| + * |
| + * {@hide} since this class exposes experimental features that should be hidden. |
| + */ |
| +public abstract class ExperimentalUrlRequest extends UrlRequest { |
| + /** |
| + * 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.
|
| + */ |
| + public abstract static class Builder extends UrlRequest.Builder { |
| + /** |
| + * Disables connection migration for the request if enabled for |
| + * the session. |
| + * @return the builder to facilitate chaining. |
| + */ |
| + public abstract Builder disableConnectionMigration(); |
| + |
| + /** |
| + * Associates the annotation object with this request. May add more than one. |
| + * Passed through to a {@link RequestFinishedInfo.Listener}, |
| + * see {@link RequestFinishedInfo#getAnnotations}. |
| + * |
| + * @param annotation an object to pass on to the {@link RequestFinishedInfo.Listener} with a |
| + * {@link RequestFinishedInfo}. |
| + * @return the builder to facilitate chaining. |
| + */ |
| + public abstract Builder addRequestAnnotation(Object annotation); |
| + |
| + // To support method chaining, override superclass methods to return an |
| + // instance of this class instead of the parent. |
| + |
| + @Override |
| + public abstract Builder setHttpMethod(String method); |
| + |
| + @Override |
| + public abstract Builder addHeader(String header, String value); |
| + |
| + @Override |
| + public abstract Builder disableCache(); |
| + |
| + @Override |
| + public abstract Builder setPriority(int priority); |
| + |
| + @Override |
| + public abstract Builder setUploadDataProvider( |
| + UploadDataProvider uploadDataProvider, Executor executor); |
| + |
| + @Override |
| + public abstract Builder allowDirectExecutor(); |
| + |
| + @Override |
| + public abstract ExperimentalUrlRequest build(); |
| + } |
| +} |