| Index: components/cronet/android/api/src/org/chromium/net/CronetEngine.java
|
| diff --git a/components/cronet/android/api/src/org/chromium/net/CronetEngine.java b/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
|
| index b92afc308b3324320f0d747cd1216360dc670bcf..b3614d9e4e72b0c9f79a0e21d51957d2161472cf 100644
|
| --- a/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
|
| +++ b/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
|
| @@ -5,6 +5,7 @@
|
| package org.chromium.net;
|
|
|
| import android.content.Context;
|
| +import android.net.http.HttpResponseCache;
|
| import android.support.annotation.IntDef;
|
| import android.support.annotation.Nullable;
|
| import android.util.Log;
|
| @@ -30,6 +31,8 @@ import java.util.Set;
|
| import java.util.concurrent.Executor;
|
| import java.util.regex.Pattern;
|
|
|
| +import javax.net.ssl.HttpsURLConnection;
|
| +
|
| /**
|
| * An engine to process {@link UrlRequest}s, which uses the best HTTP stack
|
| * available on the current platform.
|
| @@ -198,6 +201,7 @@ public abstract class CronetEngine {
|
| * {@link java.net.HttpURLConnection} implementation.
|
| * @return the builder to facilitate chaining.
|
| * @deprecated Not supported by the new API.
|
| + * @hide
|
| */
|
| @Deprecated
|
| public Builder enableLegacyMode(boolean value) {
|
| @@ -325,11 +329,8 @@ public abstract class CronetEngine {
|
| * @param secureProxyCheckUrl a URL to fetch to determine if using a secure
|
| * proxy is allowed.
|
| * @return the builder to facilitate chaining.
|
| - * @deprecated Marked as deprecated because @hide doesn't properly hide but
|
| - * javadocs are built with nodeprecated="yes".
|
| + * @hide as it's a prototype.
|
| */
|
| - @Deprecated
|
| - @SuppressWarnings("DepAnn")
|
| public Builder setDataReductionProxyOptions(
|
| String primaryProxy, String fallbackProxy, String secureProxyCheckUrl) {
|
| if (primaryProxy.isEmpty() || fallbackProxy.isEmpty()
|
| @@ -355,12 +356,11 @@ public abstract class CronetEngine {
|
| return mDataReductionProxySecureProxyCheckUrl;
|
| }
|
|
|
| - /** @deprecated not really deprecated but hidden. */
|
| + /** @hide */
|
| @IntDef({
|
| HTTP_CACHE_DISABLED, HTTP_CACHE_IN_MEMORY, HTTP_CACHE_DISK_NO_HTTP, HTTP_CACHE_DISK,
|
| })
|
| @Retention(RetentionPolicy.SOURCE)
|
| - @SuppressWarnings("DepAnn")
|
| public @interface HttpCacheSetting {}
|
|
|
| /**
|
| @@ -639,6 +639,7 @@ public abstract class CronetEngine {
|
| * @param executor {@link Executor} on which all callbacks will be invoked.
|
| * @return new request.
|
| * @deprecated Use {@link UrlRequest.Builder#build}.
|
| + * @hide
|
| */
|
| @Deprecated
|
| public final UrlRequest createRequest(
|
| @@ -660,6 +661,7 @@ public abstract class CronetEngine {
|
| * values.
|
| * @return new request.
|
| * @deprecated Use {@link UrlRequest.Builder#build}.
|
| + * @hide
|
| */
|
| @Deprecated
|
| public final UrlRequest createRequest(String url, UrlRequest.Callback callback,
|
| @@ -681,7 +683,10 @@ public abstract class CronetEngine {
|
| * values.
|
| * @param requestAnnotations Objects to pass on to {@link CronetEngine.RequestFinishedListener}.
|
| * @return new request.
|
| + * @deprecated Use {@link UrlRequest.Builder#build}.
|
| + * @hide as it references hidden CronetEngine.RequestFinishedListener
|
| */
|
| + @Deprecated
|
| protected abstract UrlRequest createRequest(String url, UrlRequest.Callback callback,
|
| Executor executor, int priority, Collection<Object> requestAnnotations);
|
|
|
| @@ -781,9 +786,9 @@ public abstract class CronetEngine {
|
| * only when enabled.
|
| * @param executor an executor that will be used to notified all
|
| * added RTT and throughput listeners.
|
| - * @deprecated not really deprecated but hidden for now as it's a prototype.
|
| + * @hide as it's a prototype.
|
| */
|
| - @Deprecated public abstract void enableNetworkQualityEstimator(Executor executor);
|
| + public abstract void enableNetworkQualityEstimator(Executor executor);
|
|
|
| /**
|
| * Enables the network quality estimator for testing. This must be called
|
| @@ -793,9 +798,8 @@ public abstract class CronetEngine {
|
| * @param useSmallerResponses include small responses in throughput estimates.
|
| * @param executor an {@link java.util.concurrent.Executor} on which all
|
| * listeners will be called.
|
| - * @deprecated not really deprecated but hidden for now as it's a prototype.
|
| + * @hide as it's a prototype.
|
| */
|
| - @Deprecated
|
| abstract void enableNetworkQualityEstimatorForTesting(
|
| boolean useLocalHostRequests, boolean useSmallerResponses, Executor executor);
|
|
|
| @@ -808,9 +812,9 @@ public abstract class CronetEngine {
|
| * The listener is called on the {@link java.util.concurrent.Executor} that
|
| * is passed to {@link #enableNetworkQualityEstimator}.
|
| * @param listener the listener of round trip times.
|
| - * @deprecated not really deprecated but hidden for now as it's a prototype.
|
| + * @hide as it's a prototype.
|
| */
|
| - @Deprecated public abstract void addRttListener(NetworkQualityRttListener listener);
|
| + public abstract void addRttListener(NetworkQualityRttListener listener);
|
|
|
| /**
|
| * Removes a listener of round trip times if previously registered with
|
| @@ -818,9 +822,9 @@ public abstract class CronetEngine {
|
| * {@link NetworkQualityRttListener} is added in order to stop receiving
|
| * observations.
|
| * @param listener the listener of round trip times.
|
| - * @deprecated not really deprecated but hidden for now as it's a prototype.
|
| + * @hide as it's a prototype.
|
| */
|
| - @Deprecated public abstract void removeRttListener(NetworkQualityRttListener listener);
|
| + public abstract void removeRttListener(NetworkQualityRttListener listener);
|
|
|
| /**
|
| * Registers a listener that gets called whenever the network quality
|
| @@ -831,9 +835,8 @@ public abstract class CronetEngine {
|
| * is called on the {@link java.util.concurrent.Executor} that is passed to
|
| * {@link #enableNetworkQualityEstimator}.
|
| * @param listener the listener of throughput.
|
| - * @deprecated not really deprecated but hidden for now as it's a prototype.
|
| + * @hide as it's a prototype.
|
| */
|
| - @Deprecated
|
| public abstract void addThroughputListener(NetworkQualityThroughputListener listener);
|
|
|
| /**
|
| @@ -841,9 +844,8 @@ public abstract class CronetEngine {
|
| * {@link NetworkQualityThroughputListener} is added with
|
| * {@link #addThroughputListener} in order to stop receiving observations.
|
| * @param listener the listener of throughput.
|
| - * @deprecated not really deprecated but hidden for now as it's a prototype.
|
| + * @hide as it's a prototype.
|
| */
|
| - @Deprecated
|
| public abstract void removeThroughputListener(NetworkQualityThroughputListener listener);
|
|
|
| /**
|
| @@ -869,12 +871,8 @@ public abstract class CronetEngine {
|
| * @param proxy proxy to use when establishing connection.
|
| * @return an {@link java.net.HttpURLConnection} instance implemented by this CronetEngine.
|
| * @throws IOException if an error occurs while opening the connection.
|
| - * @deprecated Marked as deprecated because @hide doesn't properly hide but
|
| - * javadocs are built with nodeprecated="yes".
|
| - * TODO(pauljensen): Expose once implemented, http://crbug.com/418111
|
| + * @hide TODO(pauljensen): Expose once implemented, http://crbug.com/418111
|
| */
|
| - @Deprecated
|
| - @SuppressWarnings("DepAnn")
|
| public abstract URLConnection openConnection(URL url, Proxy proxy) throws IOException;
|
|
|
| /**
|
| @@ -886,8 +884,7 @@ public abstract class CronetEngine {
|
| * Cronet does not use certain HTTP features provided via the system:
|
| * <ul>
|
| * <li>the HTTP cache installed via
|
| - * {@link android.net.http.HttpResponseCache#install(java.io.File, long)
|
| - * HttpResponseCache.install()}</li>
|
| + * {@link HttpResponseCache#install(java.io.File, long) HttpResponseCache.install()}</li>
|
| * <li>the HTTP authentication method installed via
|
| * {@link java.net.Authenticator#setDefault}</li>
|
| * <li>the HTTP cookie storage installed via {@link java.net.CookieHandler#setDefault}</li>
|
| @@ -895,14 +892,14 @@ public abstract class CronetEngine {
|
| * <p>
|
| * While Cronet supports and encourages requests using the HTTPS protocol,
|
| * Cronet does not provide support for the
|
| - * {@link javax.net.ssl.HttpsURLConnection} API. This lack of support also
|
| + * {@link HttpsURLConnection} API. This lack of support also
|
| * includes not using certain HTTPS features provided via the system:
|
| * <ul>
|
| * <li>the HTTPS hostname verifier installed via {@link
|
| - * javax.net.ssl.HttpsURLConnection#setDefaultHostnameVerifier(javax.net.ssl.HostnameVerifier)
|
| + * HttpsURLConnection#setDefaultHostnameVerifier(javax.net.ssl.HostnameVerifier)
|
| * HttpsURLConnection.setDefaultHostnameVerifier()}</li>
|
| * <li>the HTTPS socket factory installed via {@link
|
| - * javax.net.ssl.HttpsURLConnection#setDefaultSSLSocketFactory(javax.net.ssl.SSLSocketFactory)
|
| + * HttpsURLConnection#setDefaultSSLSocketFactory(javax.net.ssl.SSLSocketFactory)
|
| * HttpsURLConnection.setDefaultSSLSocketFactory()}</li>
|
| * </ul>
|
| *
|
| @@ -917,6 +914,7 @@ public abstract class CronetEngine {
|
| * @param builder builder to used for creating the CronetEngine instance.
|
| * @return the created CronetEngine instance.
|
| * @deprecated Use {@link CronetEngine.Builder}.
|
| + * @hide
|
| */
|
| @Deprecated
|
| public static CronetEngine createContext(Builder builder) {
|
| @@ -966,26 +964,24 @@ public abstract class CronetEngine {
|
| *
|
| * @param listener the listener for finished requests.
|
| *
|
| - * @deprecated not really deprecated but hidden for now as it's a prototype.
|
| + * @hide as it's a prototype.
|
| */
|
| - @Deprecated public abstract void addRequestFinishedListener(RequestFinishedListener listener);
|
| + public abstract void addRequestFinishedListener(RequestFinishedListener listener);
|
|
|
| /**
|
| * Removes a finished request listener.
|
| *
|
| * @param listener the listener to remove.
|
| *
|
| - * @deprecated not really deprecated but hidden for now as it's a prototype.
|
| + * @hide it's a prototype.
|
| */
|
| - @Deprecated
|
| public abstract void removeRequestFinishedListener(RequestFinishedListener listener);
|
|
|
| /**
|
| * Information about a finished request. Passed to {@link RequestFinishedListener}.
|
| *
|
| - * @deprecated not really deprecated but hidden for now as it's a prototype.
|
| + * @hide as it's a prototype.
|
| */
|
| - @Deprecated
|
| public static final class UrlRequestInfo {
|
| private final String mUrl;
|
| private final Collection<Object> mAnnotations;
|
| @@ -1043,9 +1039,8 @@ public abstract class CronetEngine {
|
| *
|
| * <p>Must call {@link #enableNetworkQualityEstimator} to enable request metrics collection.
|
| *
|
| - * @deprecated not really deprecated but hidden for now as it's a prototype.
|
| + * @hide as it's a prototype.
|
| */
|
| - @Deprecated
|
| public static final class UrlRequestMetrics {
|
| @Nullable private final Long mTtfbMs;
|
| @Nullable private final Long mTotalTimeMs;
|
| @@ -1098,9 +1093,8 @@ public abstract class CronetEngine {
|
| /**
|
| * Interface to listen for finished requests that were created via this CronetEngine instance.
|
| *
|
| - * @deprecated not really deprecated but hidden for now as it's a prototype.
|
| + * @hide as it's a prototype.
|
| */
|
| - @Deprecated
|
| public interface RequestFinishedListener { // TODO(klm): Add a convenience abstract class.
|
| /**
|
| * Invoked with request info.
|
|
|