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

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

Issue 2805743003: Allow posting the CronetEngine UI Thread initialization on a custom Ui executor instead of the defa… (Closed)
Patch Set: Created 3 years, 8 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.VisibleForTesting; 9 import android.support.annotation.VisibleForTesting;
10 10
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 * If not set, the library will be loaded using {@link System#loadLibrar y}. 129 * If not set, the library will be loaded using {@link System#loadLibrar y}.
130 * @param loader {@code LibraryLoader} to be used to load the native lib rary. 130 * @param loader {@code LibraryLoader} to be used to load the native lib rary.
131 * @return the builder to facilitate chaining. 131 * @return the builder to facilitate chaining.
132 */ 132 */
133 public Builder setLibraryLoader(LibraryLoader loader) { 133 public Builder setLibraryLoader(LibraryLoader loader) {
134 mBuilderDelegate.setLibraryLoader(loader); 134 mBuilderDelegate.setLibraryLoader(loader);
135 return this; 135 return this;
136 } 136 }
137 137
138 /** 138 /**
139 * Sets an {@link Executor} to be used for initialization code that need s to run
140 * on the Ui Thread.
141 * If not set, the library will be use the {@link android.os.Looper#getM ainLooper()}.
142 * @param uiExecutor {@code Executor} to be used for the initialization.
143 * @return the builder to facilitate chaining.
144 */
145 public Builder setUiThreadExecutor(Executor uiExecutor) {
146 mBuilderDelegate.setUiThreadExecutor(uiExecutor);
147 return this;
148 }
149
150 /**
139 * Sets whether <a href="https://www.chromium.org/quic">QUIC</a> protoco l 151 * Sets whether <a href="https://www.chromium.org/quic">QUIC</a> protoco l
140 * is enabled. Defaults to disabled. If QUIC is enabled, then QUIC User Agent Id 152 * is enabled. Defaults to disabled. If QUIC is enabled, then QUIC User Agent Id
141 * containing application name and Cronet version is sent to the server. 153 * containing application name and Cronet version is sent to the server.
142 * @param value {@code true} to enable QUIC, {@code false} to disable. 154 * @param value {@code true} to enable QUIC, {@code false} to disable.
143 * @return the builder to facilitate chaining. 155 * @return the builder to facilitate chaining.
144 */ 156 */
145 public Builder enableQuic(boolean value) { 157 public Builder enableQuic(boolean value) {
146 mBuilderDelegate.enableQuic(value); 158 mBuilderDelegate.enableQuic(value);
147 return this; 159 return this;
148 } 160 }
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 * thread calling {@link Executor#execute} to prevent blocking networking 528 * thread calling {@link Executor#execute} to prevent blocking networking
517 * operations and causing exceptions during shutdown. 529 * operations and causing exceptions during shutdown.
518 * 530 *
519 * @param url URL for the generated requests. 531 * @param url URL for the generated requests.
520 * @param callback callback object that gets invoked on different events. 532 * @param callback callback object that gets invoked on different events.
521 * @param executor {@link Executor} on which all callbacks will be invoked. 533 * @param executor {@link Executor} on which all callbacks will be invoked.
522 */ 534 */
523 public abstract UrlRequest.Builder newUrlRequestBuilder( 535 public abstract UrlRequest.Builder newUrlRequestBuilder(
524 String url, UrlRequest.Callback callback, Executor executor); 536 String url, UrlRequest.Callback callback, Executor executor);
525 } 537 }
OLDNEW
« no previous file with comments | « components/cronet/android/api.txt ('k') | components/cronet/android/api/src/org/chromium/net/ExperimentalCronetEngine.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698