• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 The Chromium Authors
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. To obtain an instance of this
9  * class, cast a {@code BidirectionalStream} to this type. Every instance of {@code
10  * BidirectionalStream} can be cast to an instance of this class, as they are backed by the same
11  * implementation and hence perform identically. Instances of this class are not meant for general
12  * use, but instead only to access experimental features. Experimental features may be deprecated in
13  * the future. Use at your own risk.
14  *
15  * <p>{@hide for consistency with other experimental classes}
16  *
17  * @deprecated scheduled for deletion, don't use in new code.
18  */
19 @Deprecated
20 public abstract class ExperimentalBidirectionalStream extends BidirectionalStream {
21     /**
22      * {@link BidirectionalStream#Builder} that exposes experimental features. To obtain an instance
23      * of this class, cast a {@code BidirectionalStream.Builder} to this type. Every instance of
24      * {@code BidirectionalStream.Builder} can be cast to an instance of this class, as they are
25      * backed by the same implementation and hence perform identically. Instances of this class are
26      * not meant for general use, but instead only to access experimental features. Experimental
27      * features may be deprecated in the future. Use at your own risk.
28      *
29      * <p>{@hide for consistency with other experimental classes}
30      *
31      * @deprecated scheduled for deletion, don't use in new code.
32      */
33     @Deprecated
34     public abstract static class Builder extends BidirectionalStream.Builder {
35         // To support method chaining, override superclass methods to return an
36         // instance of this class instead of the parent.
37 
38         @Override
setHttpMethod(String method)39         public abstract Builder setHttpMethod(String method);
40 
41         @Override
addHeader(String header, String value)42         public abstract Builder addHeader(String header, String value);
43 
44         @Override
setPriority(int priority)45         public abstract Builder setPriority(int priority);
46 
47         @Override
delayRequestHeadersUntilFirstFlush( boolean delayRequestHeadersUntilFirstFlush)48         public abstract Builder delayRequestHeadersUntilFirstFlush(
49                 boolean delayRequestHeadersUntilFirstFlush);
50 
51         @Override
addRequestAnnotation(Object annotation)52         public Builder addRequestAnnotation(Object annotation) {
53             return this;
54         }
55 
56         @Override
setTrafficStatsTag(int tag)57         public Builder setTrafficStatsTag(int tag) {
58             return this;
59         }
60 
61         @Override
setTrafficStatsUid(int uid)62         public Builder setTrafficStatsUid(int uid) {
63             return this;
64         }
65 
66         @Override
build()67         public abstract ExperimentalBidirectionalStream build();
68     }
69 }
70