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 | |
| 5 package org.chromium.net; | |
| 6 | |
| 7 /** | |
| 8 * {@link BidirectionalStream} that exposes experimental features. | |
| 9 * Created using {@link ExperimentalBidirectionalStream.Builder}. Every instance | |
|
pauljensen
2016/10/03 15:22:36
remove "ExperimentalBidirectionalStream."?
kapishnikov
2016/10/03 23:49:27
Done.
| |
| 10 * of {@link BidirectionalStream} can be casted to an instance of this class. | |
| 11 * | |
| 12 * {@hide} as it's a 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}. | |
|
pauljensen
2016/10/03 15:22:36
add sentence describing how to create this
kapishnikov
2016/10/03 23:49:27
Done. Same for ExperimentalUrlRequest.Builder.
| |
| 18 */ | |
| 19 public abstract static class Builder extends BidirectionalStream.Builder { | |
| 20 /** | |
| 21 * Associates the annotation object with this request. May add more than one. | |
| 22 * Passed through to a {@link RequestFinishedInfo.Listener}, | |
| 23 * see {@link RequestFinishedInfo#getAnnotations}. | |
| 24 * | |
| 25 * @param annotation an object to pass on to the {@link RequestFinishedI nfo.Listener} with a | |
| 26 * {@link RequestFinishedInfo}. | |
| 27 * @return the builder to facilitate chaining. | |
| 28 */ | |
| 29 public abstract Builder addRequestAnnotation(Object annotation); | |
| 30 | |
| 31 // To support method chaining, override superclass methods to return an | |
| 32 // instance of this class instead of the parent. | |
| 33 | |
| 34 @Override | |
| 35 public abstract Builder setHttpMethod(String method); | |
| 36 | |
| 37 @Override | |
| 38 public abstract Builder addHeader(String header, String value); | |
| 39 | |
| 40 @Override | |
| 41 public abstract Builder setPriority(int priority); | |
| 42 | |
| 43 @Override | |
| 44 public abstract Builder delayRequestHeadersUntilFirstFlush( | |
| 45 boolean delayRequestHeadersUntilFirstFlush); | |
| 46 | |
| 47 @Override | |
| 48 public abstract ExperimentalBidirectionalStream build(); | |
| 49 } | |
| 50 } | |
| OLD | NEW |