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

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

Issue 1159343003: Expose Cronet Url requests with priorities. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added abstract method Created 5 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.net; 5 package org.chromium.net;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.util.Log; 8 import android.util.Log;
9 9
10 import java.lang.reflect.Constructor; 10 import java.lang.reflect.Constructor;
(...skipping 17 matching lines...) Expand all
28 * createRequest itself may be called on any thread. 28 * createRequest itself may be called on any thread.
29 * @param url URL for the request. 29 * @param url URL for the request.
30 * @param listener Callback interface that gets called on different events. 30 * @param listener Callback interface that gets called on different events.
31 * @param executor Executor on which all callbacks will be called. 31 * @param executor Executor on which all callbacks will be called.
32 * @return new request. 32 * @return new request.
33 */ 33 */
34 public abstract UrlRequest createRequest(String url, 34 public abstract UrlRequest createRequest(String url,
35 UrlRequestListener listener, Executor executor); 35 UrlRequestListener listener, Executor executor);
36 36
37 /** 37 /**
38 * Creates an UrlRequest object. All UrlRequest functions must
xunjieli 2015/06/05 15:02:51 nit: a UrlRequest. Please also surround it with {@
mkirsche 2015/06/05 15:12:21 Done.
39 * be called on the Executor's thread, and all callbacks will be called
xunjieli 2015/06/05 15:02:51 Since you are here, could you remove "All UrlReque
mkirsche 2015/06/05 15:12:21 Done.
40 * on the Executor's thread as well. Executor must not run tasks on the
41 * current thread to prevent network jank and exception during shutdown.
42 *
43 * createRequest itself may be called on any thread.
xunjieli 2015/06/05 15:02:51 Could you remove "createRequest itself may be call
mkirsche 2015/06/05 15:12:21 Done.
44 * @param url URL for the request.
45 * @param listener Callback interface that gets called on different events.
46 * @param executor Executor on which all callbacks will be called.
47 * @param priority Priority of the request - should be one of the
xunjieli 2015/06/05 15:02:51 Why is there a dash here?
mkirsche 2015/06/05 15:12:21 Done.
48 REQUEST_PRIORITY_* values in UrlRequest.java
49 * @return new request.
50 */
51 public abstract UrlRequest createRequest(String url,
52 UrlRequestListener listener, Executor executor, int priority);
53
54 /**
38 * @return true if the context is enabled. 55 * @return true if the context is enabled.
39 */ 56 */
40 public abstract boolean isEnabled(); 57 public abstract boolean isEnabled();
41 58
42 /** 59 /**
43 * @return a human-readable version string of the context. 60 * @return a human-readable version string of the context.
44 */ 61 */
45 public abstract String getVersionString(); 62 public abstract String getVersionString();
46 63
47 /** 64 /**
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } catch (ClassNotFoundException e) { 137 } catch (ClassNotFoundException e) {
121 // Leave as null. 138 // Leave as null.
122 } catch (Exception e) { 139 } catch (Exception e) {
123 throw new IllegalStateException( 140 throw new IllegalStateException(
124 "Cannot instantiate: " + CRONET_URL_REQUEST_CONTEXT, 141 "Cannot instantiate: " + CRONET_URL_REQUEST_CONTEXT,
125 e); 142 e);
126 } 143 }
127 return urlRequestContext; 144 return urlRequestContext;
128 } 145 }
129 } 146 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698