| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |