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

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

Issue 1307863006: [Cronet] Change interface APIs to abstract classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update CronetPerfTestActivity too Created 5 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
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 11 matching lines...) Expand all
22 /** 22 /**
23 * Creates a {@link UrlRequest} object. All callbacks will 23 * Creates a {@link UrlRequest} object. All callbacks will
24 * be called on {@code executor}'s thread. {@code executor} must not run 24 * be called on {@code executor}'s thread. {@code executor} must not run
25 * tasks on the current thread to prevent blocking networking operations 25 * tasks on the current thread to prevent blocking networking operations
26 * and causing exceptions during shutdown. Request is given medium priority, 26 * and causing exceptions during shutdown. Request is given medium priority,
27 * see {@link UrlRequest#REQUEST_PRIORITY_MEDIUM}. To specify other 27 * see {@link UrlRequest#REQUEST_PRIORITY_MEDIUM}. To specify other
28 * priorities see {@link #createRequest(String, UrlRequestListener, 28 * priorities see {@link #createRequest(String, UrlRequestListener,
29 * Executor, int priority)}. 29 * Executor, int priority)}.
30 * 30 *
31 * @param url {@link java.net.URL} for the request. 31 * @param url {@link java.net.URL} for the request.
32 * @param listener callback interface that gets called on different events. 32 * @param listener callback class that gets called on different events.
33 * @param executor {@link Executor} on which all callbacks will be called. 33 * @param executor {@link Executor} on which all callbacks will be called.
34 * @return new request. 34 * @return new request.
35 */ 35 */
36 public abstract UrlRequest createRequest(String url, 36 public abstract UrlRequest createRequest(String url,
37 UrlRequestListener listener, Executor executor); 37 UrlRequestListener listener, Executor executor);
38 38
39 /** 39 /**
40 * Creates a {@link UrlRequest} object. All callbacks will 40 * Creates a {@link UrlRequest} object. All callbacks will
41 * be called on {@code executor}'s thread. {@code executor} must not run 41 * be called on {@code executor}'s thread. {@code executor} must not run
42 * tasks on the current thread to prevent blocking networking operations 42 * tasks on the current thread to prevent blocking networking operations
43 * and causing exceptions during shutdown. 43 * and causing exceptions during shutdown.
44 * 44 *
45 * @param url {@link java.net.URL} for the request. 45 * @param url {@link java.net.URL} for the request.
46 * @param listener callback interface that gets called on different events. 46 * @param listener callback class that gets called on different events.
47 * @param executor {@link Executor} on which all callbacks will be called. 47 * @param executor {@link Executor} on which all callbacks will be called.
48 * @param priority priority of the request which should be one of the 48 * @param priority priority of the request which should be one of the
49 * {@link UrlRequest#REQUEST_PRIORITY_IDLE REQUEST_PRIORITY_*} 49 * {@link UrlRequest#REQUEST_PRIORITY_IDLE REQUEST_PRIORITY_*}
50 * values. 50 * values.
51 * @return new request. 51 * @return new request.
52 */ 52 */
53 public abstract UrlRequest createRequest(String url, 53 public abstract UrlRequest createRequest(String url,
54 UrlRequestListener listener, Executor executor, int priority); 54 UrlRequestListener listener, Executor executor, int priority);
55 55
56 /** 56 /**
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } catch (ClassNotFoundException e) { 137 } catch (ClassNotFoundException e) {
138 // Leave as null. 138 // Leave as null.
139 } catch (Exception e) { 139 } catch (Exception e) {
140 throw new IllegalStateException( 140 throw new IllegalStateException(
141 "Cannot instantiate: " + CRONET_URL_REQUEST_CONTEXT, 141 "Cannot instantiate: " + CRONET_URL_REQUEST_CONTEXT,
142 e); 142 e);
143 } 143 }
144 return urlRequestContext; 144 return urlRequestContext;
145 } 145 }
146 } 146 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698