Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: components/cronet/android/api/src/org/chromium/net/ExperimentalUrlRequest.java

Issue 2339223002: Cronet API Refactoring (Closed)
Patch Set: Rebase & Conflict Resolution Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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}. Created by
18 * {@link ExperimentalCronetEngine#newUrlRequestBuilder}. A reference to thi s class
19 * can also be obtained through downcasting of {@link UrlRequest.Builder}.
20 */
21 public abstract static class Builder extends UrlRequest.Builder {
22 /**
23 * Disables connection migration for the request if enabled for
24 * the session.
25 * @return the builder to facilitate chaining.
26 */
27 public abstract Builder disableConnectionMigration();
28
29 /**
30 * Associates the annotation object with this request. May add more than one.
31 * Passed through to a {@link RequestFinishedInfo.Listener},
32 * see {@link RequestFinishedInfo#getAnnotations}.
33 *
34 * @param annotation an object to pass on to the {@link RequestFinishedI nfo.Listener} with a
35 * {@link RequestFinishedInfo}.
36 * @return the builder to facilitate chaining.
37 */
38 public abstract Builder addRequestAnnotation(Object annotation);
39
40 // To support method chaining, override superclass methods to return an
41 // instance of this class instead of the parent.
42
43 @Override
44 public abstract Builder setHttpMethod(String method);
45
46 @Override
47 public abstract Builder addHeader(String header, String value);
48
49 @Override
50 public abstract Builder disableCache();
51
52 @Override
53 public abstract Builder setPriority(int priority);
54
55 @Override
56 public abstract Builder setUploadDataProvider(
57 UploadDataProvider uploadDataProvider, Executor executor);
58
59 @Override
60 public abstract Builder allowDirectExecutor();
61
62 @Override
63 public abstract ExperimentalUrlRequest build();
64 }
65 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698