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

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

Issue 2283243002: Allow direct executors in cronet. (Closed)
Patch Set: Created 4 years, 3 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.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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 * {@link UrlRequest.Builder#REQUEST_PRIORITY_IDLE REQUEST_PRIORITY_ *} 820 * {@link UrlRequest.Builder#REQUEST_PRIORITY_IDLE REQUEST_PRIORITY_ *}
821 * values. 821 * values.
822 * @return new request. 822 * @return new request.
823 * @deprecated Use {@link UrlRequest.Builder#build}. 823 * @deprecated Use {@link UrlRequest.Builder#build}.
824 * @hide 824 * @hide
825 */ 825 */
826 @Deprecated 826 @Deprecated
827 public final UrlRequest createRequest(String url, UrlRequest.Callback callba ck, 827 public final UrlRequest createRequest(String url, UrlRequest.Callback callba ck,
828 Executor executor, @UrlRequest.Builder.RequestPriority int priority) { 828 Executor executor, @UrlRequest.Builder.RequestPriority int priority) {
829 return createRequest( 829 return createRequest(
830 url, callback, executor, priority, Collections.emptyList(), fals e, false); 830 url, callback, executor, priority, Collections.emptyList(), fals e, false, false);
831 } 831 }
832 832
833 /** 833 /**
834 * Creates a {@link UrlRequest} object. All callbacks will 834 * Creates a {@link UrlRequest} object. All callbacks will
835 * be called on {@code executor}'s thread. {@code executor} must not run 835 * be called on {@code executor}'s thread. {@code executor} must not run
836 * tasks on the current thread to prevent blocking networking operations 836 * tasks on the current thread to prevent blocking networking operations
837 * and causing exceptions during shutdown. 837 * and causing exceptions during shutdown.
838 * 838 *
839 * @param url {@link URL} for the request. 839 * @param url {@link URL} for the request.
840 * @param callback callback object that gets invoked on different events. 840 * @param callback callback object that gets invoked on different events.
841 * @param executor {@link Executor} on which all callbacks will be invoked. 841 * @param executor {@link Executor} on which all callbacks will be invoked.
842 * @param priority priority of the request which should be one of the 842 * @param priority priority of the request which should be one of the
843 * {@link UrlRequest.Builder#REQUEST_PRIORITY_IDLE REQUEST_PRIORITY_ *} 843 * {@link UrlRequest.Builder#REQUEST_PRIORITY_IDLE REQUEST_PRIORITY_ *}
844 * values. 844 * values.
845 * @param requestAnnotations Objects to pass on to {@link RequestFinishedInf o.Listener}. 845 * @param requestAnnotations Objects to pass on to {@link RequestFinishedInf o.Listener}.
846 * @param disableCache disables cache for the request. 846 * @param disableCache disables cache for the request.
847 * If context is not set up to use cache this param has no effect. 847 * If context is not set up to use cache this param has no effect.
848 * @param disableConnectionMigration disables connection migration for this 848 * @param disableConnectionMigration disables connection migration for this
849 * request if it is enabled for the session. 849 * request if it is enabled for the session.
850 * @param allowDirectExecutor whether executors used by this request are per mitted
851 * to execute submitted tasks inline.
850 * @return new request. 852 * @return new request.
851 * @deprecated Use {@link UrlRequest.Builder#build}. 853 * @deprecated Use {@link UrlRequest.Builder#build}.
852 * @hide as it references hidden RequestFinishedInfo.Listener 854 * @hide as it references hidden RequestFinishedInfo.Listener
853 */ 855 */
854 @Deprecated 856 @Deprecated
855 protected abstract UrlRequest createRequest(String url, UrlRequest.Callback callback, 857 protected abstract UrlRequest createRequest(String url, UrlRequest.Callback callback,
856 Executor executor, int priority, Collection<Object> requestAnnotatio ns, 858 Executor executor, int priority, Collection<Object> requestAnnotatio ns,
857 boolean disableCache, boolean disableConnectionMigration); 859 boolean disableCache, boolean disableConnectionMigration, boolean al lowDirectExecutor);
mef 2016/08/30 16:29:44 G'Ah. This will break all the HackMockCronetEngine
Charles 2016/08/30 20:11:05 Acknowledged.
858 860
859 /** 861 /**
860 * Creates a {@link BidirectionalStream} object. {@code callback} methods wi ll 862 * Creates a {@link BidirectionalStream} object. {@code callback} methods wi ll
861 * be invoked on {@code executor}. {@code executor} must not run 863 * be invoked on {@code executor}. {@code executor} must not run
862 * tasks on the current thread to prevent blocking networking operations 864 * tasks on the current thread to prevent blocking networking operations
863 * and causing exceptions during shutdown. 865 * and causing exceptions during shutdown.
864 * 866 *
865 * @param url the URL for the stream 867 * @param url the URL for the stream
866 * @param callback the object whose methods get invoked upon different event s 868 * @param callback the object whose methods get invoked upon different event s
867 * @param executor the {@link Executor} on which all callbacks will be calle d 869 * @param executor the {@link Executor} on which all callbacks will be calle d
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 1147
1146 /** 1148 /**
1147 * Removes a finished request listener. 1149 * Removes a finished request listener.
1148 * 1150 *
1149 * @param listener the listener to remove. 1151 * @param listener the listener to remove.
1150 * 1152 *
1151 * @hide it's a prototype. 1153 * @hide it's a prototype.
1152 */ 1154 */
1153 public abstract void removeRequestFinishedListener(RequestFinishedInfo.Liste ner listener); 1155 public abstract void removeRequestFinishedListener(RequestFinishedInfo.Liste ner listener);
1154 } 1156 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698