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

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

Issue 566833003: Rename Cronet AsyncUrlRequestXYZ interfaces into UrlRequestXYZ. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. Created 6 years, 3 months 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
« no previous file with comments | « no previous file | components/cronet/android/java/src/org/chromium/net/AsyncUrlRequestException.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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 * HTTP request (GET, PUT or POST).
9 * Note: All methods must be called on the Executor passed in during creation.
10 */
11 public abstract interface AsyncUrlRequest {
12 /**
13 * More setters go here. They may only be called before start (Maybe
14 * also allow during redirects). Could optionally instead use arguments
15 * to URLRequestFactory when creating the request.
16 */
17
18 /**
19 * Sets the HTTP method verb to use for this request.
20 *
21 * <p>The default when this method is not called is "GET" if the request has
22 * no body or "POST" if it does.
23 *
24 * @param method Either "POST" or "PUT".
25 */
26 public void setHttpMethod(String method);
27
28 /**
29 * Adds a request header. Must be done before request has started.
30 *
31 * @param header Header name
32 * @param value Header value
33 */
34 public void addHeader(String header, String value);
35
36 /**
37 * Starts the request, all callbacks go to listener.
38 * @param listener
39 */
40 public void start(AsyncUrlRequestListener listener);
41
42 /**
43 * Can be called at any time.
44 */
45 public void cancel();
46
47 /**
48 *
49 * @return True if the request has been cancelled by the embedder.
50 * TBD(mmenke): False in all other cases (Including errors).
51 */
52 public boolean isCanceled();
53
54 /**
55 * Can be called at any time, but the request may continue behind the
56 * scenes, depending on when it's called. None of the listener's methods
57 * will be called while paused, until and unless the request is resumed.
58 * (Note: This allows us to have more than one ByteBuffer in flight,
59 * if we want, as well as allow pausing at any point).
60 *
61 * TBD: May need different pause behavior.
62 */
63 public void pause();
64
65 /**
66 * Returns True if paused. False if not paused or is cancelled.
67 * @return
68 */
69 public boolean isPaused();
70
71 /**
72 * When resuming, any pending callback to the listener will be called
73 * asynchronously.
74 */
75 public void resume();
76
77 /**
78 * Note: There are deliberately no accessors for the results of the request
79 * here. Having none removes any ambiguity over when they are populated,
80 * particularly in the redirect case.
81 */
82 }
83
OLDNEW
« no previous file with comments | « no previous file | components/cronet/android/java/src/org/chromium/net/AsyncUrlRequestException.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698