Chromium Code Reviews| 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 17 matching lines...) Expand all Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |