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

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

Issue 2020373002: [Cronet] Call System.loadLibrary() from impl not API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@implpack
Patch Set: Created 4 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 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.content.Context; 7 import android.content.Context;
8 import android.net.http.HttpResponseCache; 8 import android.net.http.HttpResponseCache;
9 import android.support.annotation.IntDef; 9 import android.support.annotation.IntDef;
10 import android.support.annotation.Nullable; 10 import android.support.annotation.Nullable;
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 * @param libName the name of the native library backing Cronet. 233 * @param libName the name of the native library backing Cronet.
234 * @return the builder to facilitate chaining. 234 * @return the builder to facilitate chaining.
235 * @hide only used by internal implementation. 235 * @hide only used by internal implementation.
236 */ 236 */
237 public Builder setLibraryName(String libName) { 237 public Builder setLibraryName(String libName) {
238 mLibraryName = libName; 238 mLibraryName = libName;
239 return this; 239 return this;
240 } 240 }
241 241
242 /** 242 /**
243 * @hide only used by internal implementation.
244 */
245 public String libraryName() {
246 return mLibraryName;
247 }
248
249 /**
243 * Sets a {@link LibraryLoader} to be used to load the native library. 250 * Sets a {@link LibraryLoader} to be used to load the native library.
244 * If not set, the library will be loaded using {@link System#loadLibrar y}. 251 * If not set, the library will be loaded using {@link System#loadLibrar y}.
245 * @param loader {@code LibraryLoader} to be used to load the native lib rary. 252 * @param loader {@code LibraryLoader} to be used to load the native lib rary.
246 * @return the builder to facilitate chaining. 253 * @return the builder to facilitate chaining.
247 */ 254 */
248 public Builder setLibraryLoader(LibraryLoader loader) { 255 public Builder setLibraryLoader(LibraryLoader loader) {
249 mLibraryLoader = loader; 256 mLibraryLoader = loader;
250 return this; 257 return this;
251 } 258 }
252 259
253 /** 260 /**
254 * @hide only used by internal implementation. 261 * @hide only used by internal implementation.
255 */ 262 */
256 public void loadLibrary() { 263 public LibraryLoader libraryLoader() {
257 if (mLibraryLoader == null) { 264 return mLibraryLoader;
258 System.loadLibrary(mLibraryName);
259 } else {
260 mLibraryLoader.loadLibrary(mLibraryName);
261 }
262 } 265 }
263 266
264 /** 267 /**
265 * Sets whether <a href="https://www.chromium.org/quic">QUIC</a> protoco l 268 * Sets whether <a href="https://www.chromium.org/quic">QUIC</a> protoco l
266 * is enabled. Defaults to disabled. If QUIC is enabled, then QUIC User Agent Id 269 * is enabled. Defaults to disabled. If QUIC is enabled, then QUIC User Agent Id
267 * containing application name and Cronet version is sent to the server. 270 * containing application name and Cronet version is sent to the server.
268 * @param value {@code true} to enable QUIC, {@code false} to disable. 271 * @param value {@code true} to enable QUIC, {@code false} to disable.
269 * @return the builder to facilitate chaining. 272 * @return the builder to facilitate chaining.
270 */ 273 */
271 public Builder enableQUIC(boolean value) { 274 public Builder enableQUIC(boolean value) {
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 * @hide as it's a prototype. 1173 * @hide as it's a prototype.
1171 */ 1174 */
1172 public interface RequestFinishedListener { // TODO(klm): Add a convenience a bstract class. 1175 public interface RequestFinishedListener { // TODO(klm): Add a convenience a bstract class.
1173 /** 1176 /**
1174 * Invoked with request info. 1177 * Invoked with request info.
1175 * @param requestInfo {@link UrlRequestInfo} for finished request. 1178 * @param requestInfo {@link UrlRequestInfo} for finished request.
1176 */ 1179 */
1177 void onRequestFinished(UrlRequestInfo requestInfo); 1180 void onRequestFinished(UrlRequestInfo requestInfo);
1178 } 1181 }
1179 } 1182 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698