| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.net.http.HttpResponseCache; | 9 import android.net.http.HttpResponseCache; |
| 10 import android.support.annotation.IntDef; | 10 import android.support.annotation.IntDef; |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 * @param libName the name of the native library backing Cronet. | 240 * @param libName the name of the native library backing Cronet. |
| 241 * @return the builder to facilitate chaining. | 241 * @return the builder to facilitate chaining. |
| 242 * @hide only used by internal implementation. | 242 * @hide only used by internal implementation. |
| 243 */ | 243 */ |
| 244 public Builder setLibraryName(String libName) { | 244 public Builder setLibraryName(String libName) { |
| 245 mLibraryName = libName; | 245 mLibraryName = libName; |
| 246 return this; | 246 return this; |
| 247 } | 247 } |
| 248 | 248 |
| 249 /** | 249 /** |
| 250 * @hide only used by internal implementation. |
| 251 */ |
| 252 public String libraryName() { |
| 253 return mLibraryName; |
| 254 } |
| 255 |
| 256 /** |
| 250 * Sets a {@link LibraryLoader} to be used to load the native library. | 257 * Sets a {@link LibraryLoader} to be used to load the native library. |
| 251 * If not set, the library will be loaded using {@link System#loadLibrar
y}. | 258 * If not set, the library will be loaded using {@link System#loadLibrar
y}. |
| 252 * @param loader {@code LibraryLoader} to be used to load the native lib
rary. | 259 * @param loader {@code LibraryLoader} to be used to load the native lib
rary. |
| 253 * @return the builder to facilitate chaining. | 260 * @return the builder to facilitate chaining. |
| 254 */ | 261 */ |
| 255 public Builder setLibraryLoader(LibraryLoader loader) { | 262 public Builder setLibraryLoader(LibraryLoader loader) { |
| 256 mLibraryLoader = loader; | 263 mLibraryLoader = loader; |
| 257 return this; | 264 return this; |
| 258 } | 265 } |
| 259 | 266 |
| 260 /** | 267 /** |
| 261 * @hide only used by internal implementation. | 268 * @hide only used by internal implementation. |
| 262 */ | 269 */ |
| 263 public void loadLibrary() { | 270 public LibraryLoader libraryLoader() { |
| 264 if (mLibraryLoader == null) { | 271 return mLibraryLoader; |
| 265 System.loadLibrary(mLibraryName); | |
| 266 } else { | |
| 267 mLibraryLoader.loadLibrary(mLibraryName); | |
| 268 } | |
| 269 } | 272 } |
| 270 | 273 |
| 271 /** | 274 /** |
| 272 * Sets whether <a href="https://www.chromium.org/quic">QUIC</a> protoco
l | 275 * Sets whether <a href="https://www.chromium.org/quic">QUIC</a> protoco
l |
| 273 * is enabled. Defaults to disabled. If QUIC is enabled, then QUIC User
Agent Id | 276 * is enabled. Defaults to disabled. If QUIC is enabled, then QUIC User
Agent Id |
| 274 * containing application name and Cronet version is sent to the server. | 277 * containing application name and Cronet version is sent to the server. |
| 275 * @param value {@code true} to enable QUIC, {@code false} to disable. | 278 * @param value {@code true} to enable QUIC, {@code false} to disable. |
| 276 * @return the builder to facilitate chaining. | 279 * @return the builder to facilitate chaining. |
| 277 */ | 280 */ |
| 278 public Builder enableQUIC(boolean value) { | 281 public Builder enableQUIC(boolean value) { |
| (...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1273 * @hide as it's a prototype. | 1276 * @hide as it's a prototype. |
| 1274 */ | 1277 */ |
| 1275 public interface RequestFinishedListener { | 1278 public interface RequestFinishedListener { |
| 1276 /** | 1279 /** |
| 1277 * Invoked with request info. | 1280 * Invoked with request info. |
| 1278 * @param requestInfo {@link UrlRequestInfo} for finished request. | 1281 * @param requestInfo {@link UrlRequestInfo} for finished request. |
| 1279 */ | 1282 */ |
| 1280 void onRequestFinished(UrlRequestInfo requestInfo); | 1283 void onRequestFinished(UrlRequestInfo requestInfo); |
| 1281 } | 1284 } |
| 1282 } | 1285 } |
| OLD | NEW |