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 |
| 5 package org.chromium.net; |
| 6 |
| 7 /** |
| 8 * {@link BidirectionalStream} that exposes experimental features. |
| 9 * Created using {@link Builder}. Every instance of {@link BidirectionalStream}
can be casted |
| 10 * to an instance of this class. |
| 11 * |
| 12 * {@hide prototype} |
| 13 */ |
| 14 public abstract class ExperimentalBidirectionalStream extends BidirectionalStrea
m { |
| 15 /** |
| 16 * Builder for {@link ExperimentalBidirectionalStream}s. Allows configuring
stream before |
| 17 * constructing it via {@link Builder#build}. Created by |
| 18 * {@link ExperimentalCronetEngine#newBidirectionalStreamBuilder}. A referen
ce to this class |
| 19 * can also be obtained through downcasting of {@link BidirectionalStream.Bu
ilder}. |
| 20 */ |
| 21 public abstract static class Builder extends BidirectionalStream.Builder { |
| 22 /** |
| 23 * Associates the annotation object with this request. May add more than
one. |
| 24 * Passed through to a {@link RequestFinishedInfo.Listener}, |
| 25 * see {@link RequestFinishedInfo#getAnnotations}. |
| 26 * |
| 27 * @param annotation an object to pass on to the {@link RequestFinishedI
nfo.Listener} with a |
| 28 * {@link RequestFinishedInfo}. |
| 29 * @return the builder to facilitate chaining. |
| 30 */ |
| 31 public abstract Builder addRequestAnnotation(Object annotation); |
| 32 |
| 33 // To support method chaining, override superclass methods to return an |
| 34 // instance of this class instead of the parent. |
| 35 |
| 36 @Override |
| 37 public abstract Builder setHttpMethod(String method); |
| 38 |
| 39 @Override |
| 40 public abstract Builder addHeader(String header, String value); |
| 41 |
| 42 @Override |
| 43 public abstract Builder setPriority(int priority); |
| 44 |
| 45 @Override |
| 46 public abstract Builder delayRequestHeadersUntilFirstFlush( |
| 47 boolean delayRequestHeadersUntilFirstFlush); |
| 48 |
| 49 @Override |
| 50 public abstract ExperimentalBidirectionalStream build(); |
| 51 } |
| 52 } |
OLD | NEW |