import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo

This commit is contained in:
Roy Tam 2018-01-19 03:59:58 +08:00
commit dcd9973243
150858 changed files with 23884658 additions and 0 deletions

View file

@ -0,0 +1,63 @@
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package ch.boye.httpclientandroidlib.client.params;
import ch.boye.httpclientandroidlib.auth.params.AuthPNames;
import ch.boye.httpclientandroidlib.conn.params.ConnConnectionPNames;
import ch.boye.httpclientandroidlib.conn.params.ConnManagerPNames;
import ch.boye.httpclientandroidlib.conn.params.ConnRoutePNames;
import ch.boye.httpclientandroidlib.cookie.params.CookieSpecPNames;
import ch.boye.httpclientandroidlib.params.CoreConnectionPNames;
import ch.boye.httpclientandroidlib.params.CoreProtocolPNames;
/**
* Collected parameter names for the HttpClient module.
* This interface combines the parameter definitions of the HttpClient
* module and all dependency modules or informational units.
* It does not define additional parameter names, but references
* other interfaces defining parameter names.
* <br/>
* This interface is meant as a navigation aid for developers.
* When referring to parameter names, you should use the interfaces
* in which the respective constants are actually defined.
*
* @since 4.0
*
* @deprecated (4.3) use
* {@link ch.boye.httpclientandroidlib.client.config.RequestConfig},
* {@link ch.boye.httpclientandroidlib.config.ConnectionConfig},
* {@link ch.boye.httpclientandroidlib.config.SocketConfig}
*/
@Deprecated
public interface AllClientPNames extends
CoreConnectionPNames, CoreProtocolPNames,
ClientPNames, AuthPNames, CookieSpecPNames,
ConnConnectionPNames, ConnManagerPNames, ConnRoutePNames {
// no additional definitions
}

View file

@ -0,0 +1,79 @@
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package ch.boye.httpclientandroidlib.client.params;
import ch.boye.httpclientandroidlib.annotation.Immutable;
/**
* Standard authentication schemes supported by HttpClient.
*
* @since 4.0
*
* @deprecated (4.3) use {@link ch.boye.httpclientandroidlib.client.config.AuthSchemes}.
*/
@Deprecated
@Immutable
public final class AuthPolicy {
private AuthPolicy() {
super();
}
/**
* The NTLM scheme is a proprietary Microsoft Windows Authentication
* protocol (considered to be the most secure among currently supported
* authentication schemes).
*/
public static final String NTLM = "NTLM";
/**
* Digest authentication scheme as defined in RFC2617.
*/
public static final String DIGEST = "Digest";
/**
* Basic authentication scheme as defined in RFC2617 (considered inherently
* insecure, but most widely supported)
*/
public static final String BASIC = "Basic";
/**
* SPNEGO Authentication scheme.
*
* @since 4.1
*/
public static final String SPNEGO = "negotiate";
/**
* Kerberos Authentication scheme.
*
* @since 4.2
*/
public static final String KERBEROS = "Kerberos";
}

View file

@ -0,0 +1,133 @@
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package ch.boye.httpclientandroidlib.client.params;
/**
* Parameter names for HTTP client parameters.
*
* @since 4.0
*
* @deprecated (4.3) use {@link ch.boye.httpclientandroidlib.client.config.RequestConfig}.
*/
@Deprecated
public interface ClientPNames {
public static final String CONNECTION_MANAGER_FACTORY_CLASS_NAME = "http.connection-manager.factory-class-name";
/**
* Defines whether redirects should be handled automatically
* <p>
* This parameter expects a value of type {@link Boolean}.
* </p>
*/
public static final String HANDLE_REDIRECTS = "http.protocol.handle-redirects";
/**
* Defines whether relative redirects should be rejected. HTTP specification
* requires the location value be an absolute URI.
* <p>
* This parameter expects a value of type {@link Boolean}.
* </p>
*/
public static final String REJECT_RELATIVE_REDIRECT = "http.protocol.reject-relative-redirect";
/**
* Defines the maximum number of redirects to be followed.
* The limit on number of redirects is intended to prevent infinite loops.
* <p>
* This parameter expects a value of type {@link Integer}.
* </p>
*/
public static final String MAX_REDIRECTS = "http.protocol.max-redirects";
/**
* Defines whether circular redirects (redirects to the same location) should be allowed.
* The HTTP spec is not sufficiently clear whether circular redirects are permitted,
* therefore optionally they can be enabled
* <p>
* This parameter expects a value of type {@link Boolean}.
* </p>
*/
public static final String ALLOW_CIRCULAR_REDIRECTS = "http.protocol.allow-circular-redirects";
/**
* Defines whether authentication should be handled automatically.
* <p>
* This parameter expects a value of type {@link Boolean}.
* </p>
*/
public static final String HANDLE_AUTHENTICATION = "http.protocol.handle-authentication";
/**
* Defines the name of the cookie specification to be used for HTTP state management.
* <p>
* This parameter expects a value of type {@link String}.
* </p>
*/
public static final String COOKIE_POLICY = "http.protocol.cookie-policy";
/**
* Defines the virtual host to be used in the <code>Host</code>
* request header instead of the physical host.
* <p>
* This parameter expects a value of type {@link ch.boye.httpclientandroidlib.HttpHost}.
* </p>
* If a port is not provided, it will be derived from the request URL.
*/
public static final String VIRTUAL_HOST = "http.virtual-host";
/**
* Defines the request headers to be sent per default with each request.
* <p>
* This parameter expects a value of type {@link java.util.Collection}. The
* collection is expected to contain {@link ch.boye.httpclientandroidlib.Header}s.
* </p>
*/
public static final String DEFAULT_HEADERS = "http.default-headers";
/**
* Defines the default host. The default value will be used if the target host is
* not explicitly specified in the request URI.
* <p>
* This parameter expects a value of type {@link ch.boye.httpclientandroidlib.HttpHost}.
* </p>
*/
public static final String DEFAULT_HOST = "http.default-host";
/**
* Defines the timeout in milliseconds used when retrieving an instance of
* {@link ch.boye.httpclientandroidlib.conn.ManagedClientConnection} from the
* {@link ch.boye.httpclientandroidlib.conn.ClientConnectionManager}.
* <p>
* This parameter expects a value of type {@link Long}.
* <p>
* @since 4.2
*/
public static final String CONN_MANAGER_TIMEOUT = "http.conn-manager.timeout";
}

View file

@ -0,0 +1,106 @@
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package ch.boye.httpclientandroidlib.client.params;
import java.util.Collection;
import ch.boye.httpclientandroidlib.Header;
import ch.boye.httpclientandroidlib.HttpHost;
import ch.boye.httpclientandroidlib.annotation.NotThreadSafe;
import ch.boye.httpclientandroidlib.params.HttpAbstractParamBean;
import ch.boye.httpclientandroidlib.params.HttpParams;
/**
* This is a Java Bean class that can be used to wrap an instance of
* {@link HttpParams} and manipulate HTTP client parameters using
* Java Beans conventions.
*
* @since 4.0
*
* @deprecated (4.3) use {@link ch.boye.httpclientandroidlib.client.config.RequestConfig}.
*/
@Deprecated
@NotThreadSafe
public class ClientParamBean extends HttpAbstractParamBean {
public ClientParamBean (final HttpParams params) {
super(params);
}
/**
* @deprecated (4.2) do not use.
*/
@Deprecated
public void setConnectionManagerFactoryClassName (final String factory) {
params.setParameter(ClientPNames.CONNECTION_MANAGER_FACTORY_CLASS_NAME, factory);
}
public void setHandleRedirects (final boolean handle) {
params.setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, handle);
}
public void setRejectRelativeRedirect (final boolean reject) {
params.setBooleanParameter(ClientPNames.REJECT_RELATIVE_REDIRECT, reject);
}
public void setMaxRedirects (final int maxRedirects) {
params.setIntParameter(ClientPNames.MAX_REDIRECTS, maxRedirects);
}
public void setAllowCircularRedirects (final boolean allow) {
params.setBooleanParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, allow);
}
public void setHandleAuthentication (final boolean handle) {
params.setBooleanParameter(ClientPNames.HANDLE_AUTHENTICATION, handle);
}
public void setCookiePolicy (final String policy) {
params.setParameter(ClientPNames.COOKIE_POLICY, policy);
}
public void setVirtualHost (final HttpHost host) {
params.setParameter(ClientPNames.VIRTUAL_HOST, host);
}
public void setDefaultHeaders (final Collection <Header> headers) {
params.setParameter(ClientPNames.DEFAULT_HEADERS, headers);
}
public void setDefaultHost (final HttpHost host) {
params.setParameter(ClientPNames.DEFAULT_HOST, host);
}
/**
* @since 4.2
*/
public void setConnectionManagerTimeout(final long timeout) {
params.setLongParameter(ClientPNames.CONN_MANAGER_TIMEOUT, timeout);
}
}

View file

@ -0,0 +1,80 @@
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package ch.boye.httpclientandroidlib.client.params;
import ch.boye.httpclientandroidlib.annotation.Immutable;
/**
* Standard cookie specifications supported by HttpClient.
*
* @since 4.0
*
* @deprecated (4.3) use {@link ch.boye.httpclientandroidlib.client.config.CookieSpecs}.
*/
@Deprecated
@Immutable
public final class CookiePolicy {
/**
* The policy that provides high degree of compatibilty
* with common cookie management of popular HTTP agents.
*/
public static final String BROWSER_COMPATIBILITY = "compatibility";
/**
* The Netscape cookie draft compliant policy.
*/
public static final String NETSCAPE = "netscape";
/**
* The RFC 2109 compliant policy.
*/
public static final String RFC_2109 = "rfc2109";
/**
* The RFC 2965 compliant policy.
*/
public static final String RFC_2965 = "rfc2965";
/**
* The default 'best match' policy.
*/
public static final String BEST_MATCH = "best-match";
/**
* The policy that ignores cookies.
*
* @since 4.1-beta1
*/
public static final String IGNORE_COOKIES = "ignoreCookies";
private CookiePolicy() {
super();
}
}

View file

@ -0,0 +1,88 @@
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package ch.boye.httpclientandroidlib.client.params;
import java.net.InetAddress;
import java.util.Collection;
import ch.boye.httpclientandroidlib.HttpHost;
import ch.boye.httpclientandroidlib.auth.params.AuthPNames;
import ch.boye.httpclientandroidlib.client.config.RequestConfig;
import ch.boye.httpclientandroidlib.conn.params.ConnRoutePNames;
import ch.boye.httpclientandroidlib.params.CoreConnectionPNames;
import ch.boye.httpclientandroidlib.params.CoreProtocolPNames;
import ch.boye.httpclientandroidlib.params.HttpParams;
/**
* @deprecated (4.3) provided for compatibility with {@link HttpParams}. Do not use.
*
* @since 4.3
*/
@Deprecated
public final class HttpClientParamConfig {
private HttpClientParamConfig() {
}
@SuppressWarnings("unchecked")
public static RequestConfig getRequestConfig(final HttpParams params) {
return RequestConfig.custom()
.setSocketTimeout(params.getIntParameter(
CoreConnectionPNames.SO_TIMEOUT, 0))
.setStaleConnectionCheckEnabled(params.getBooleanParameter(
CoreConnectionPNames.STALE_CONNECTION_CHECK, true))
.setConnectTimeout(params.getIntParameter(
CoreConnectionPNames.CONNECTION_TIMEOUT, 0))
.setExpectContinueEnabled(params.getBooleanParameter(
CoreProtocolPNames.USE_EXPECT_CONTINUE, false))
.setProxy((HttpHost) params.getParameter(
ConnRoutePNames.DEFAULT_PROXY))
.setLocalAddress((InetAddress) params.getParameter(
ConnRoutePNames.LOCAL_ADDRESS))
.setProxyPreferredAuthSchemes((Collection<String>) params.getParameter(
AuthPNames.PROXY_AUTH_PREF))
.setTargetPreferredAuthSchemes((Collection<String>) params.getParameter(
AuthPNames.TARGET_AUTH_PREF))
.setAuthenticationEnabled(params.getBooleanParameter(
ClientPNames.HANDLE_AUTHENTICATION, true))
.setCircularRedirectsAllowed(params.getBooleanParameter(
ClientPNames.ALLOW_CIRCULAR_REDIRECTS, false))
.setConnectionRequestTimeout((int) params.getLongParameter(
ClientPNames.CONN_MANAGER_TIMEOUT, 0))
.setCookieSpec((String) params.getParameter(
ClientPNames.COOKIE_POLICY))
.setMaxRedirects(params.getIntParameter(
ClientPNames.MAX_REDIRECTS, 50))
.setRedirectsEnabled(params.getBooleanParameter(
ClientPNames.HANDLE_REDIRECTS, true))
.setRelativeRedirectsAllowed(!params.getBooleanParameter(
ClientPNames.REJECT_RELATIVE_REDIRECT, false))
.build();
}
}

View file

@ -0,0 +1,116 @@
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package ch.boye.httpclientandroidlib.client.params;
import ch.boye.httpclientandroidlib.annotation.Immutable;
import ch.boye.httpclientandroidlib.params.HttpConnectionParams;
import ch.boye.httpclientandroidlib.params.HttpParams;
import ch.boye.httpclientandroidlib.util.Args;
/**
* An adaptor for manipulating HTTP client parameters in {@link HttpParams}.
*
* @since 4.0
*
* @deprecated (4.3) use {@link ch.boye.httpclientandroidlib.client.config.RequestConfig}
*/
@Deprecated
@Immutable
public class HttpClientParams {
private HttpClientParams() {
super();
}
public static boolean isRedirecting(final HttpParams params) {
Args.notNull(params, "HTTP parameters");
return params.getBooleanParameter
(ClientPNames.HANDLE_REDIRECTS, true);
}
public static void setRedirecting(final HttpParams params, final boolean value) {
Args.notNull(params, "HTTP parameters");
params.setBooleanParameter
(ClientPNames.HANDLE_REDIRECTS, value);
}
public static boolean isAuthenticating(final HttpParams params) {
Args.notNull(params, "HTTP parameters");
return params.getBooleanParameter
(ClientPNames.HANDLE_AUTHENTICATION, true);
}
public static void setAuthenticating(final HttpParams params, final boolean value) {
Args.notNull(params, "HTTP parameters");
params.setBooleanParameter
(ClientPNames.HANDLE_AUTHENTICATION, value);
}
public static String getCookiePolicy(final HttpParams params) {
Args.notNull(params, "HTTP parameters");
final String cookiePolicy = (String)
params.getParameter(ClientPNames.COOKIE_POLICY);
if (cookiePolicy == null) {
return CookiePolicy.BEST_MATCH;
}
return cookiePolicy;
}
public static void setCookiePolicy(final HttpParams params, final String cookiePolicy) {
Args.notNull(params, "HTTP parameters");
params.setParameter(ClientPNames.COOKIE_POLICY, cookiePolicy);
}
/**
* Set the parameter {@code ClientPNames.CONN_MANAGER_TIMEOUT}.
*
* @since 4.2
*/
public static void setConnectionManagerTimeout(final HttpParams params, final long timeout) {
Args.notNull(params, "HTTP parameters");
params.setLongParameter(ClientPNames.CONN_MANAGER_TIMEOUT, timeout);
}
/**
* Get the connectiion manager timeout value.
* This is defined by the parameter {@code ClientPNames.CONN_MANAGER_TIMEOUT}.
* Failing that it uses the parameter {@code CoreConnectionPNames.CONNECTION_TIMEOUT}
* which defaults to 0 if not defined.
*
* @since 4.2
* @return the timeout value
*/
public static long getConnectionManagerTimeout(final HttpParams params) {
Args.notNull(params, "HTTP parameters");
final Long timeout = (Long) params.getParameter(ClientPNames.CONN_MANAGER_TIMEOUT);
if (timeout != null) {
return timeout.longValue();
}
return HttpConnectionParams.getConnectionTimeout(params);
}
}

View file

@ -0,0 +1,32 @@
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
/**
* Deprecated.
* @deprecated (4.3).
*/
package ch.boye.httpclientandroidlib.client.params;