Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | package org.mozilla.gecko.sync.net; |
michael@0 | 6 | |
michael@0 | 7 | import ch.boye.httpclientandroidlib.client.methods.HttpRequestBase; |
michael@0 | 8 | import ch.boye.httpclientandroidlib.impl.client.DefaultHttpClient; |
michael@0 | 9 | |
michael@0 | 10 | /** |
michael@0 | 11 | * Shared abstract class for resource delegate that use the same timeouts |
michael@0 | 12 | * and no credentials. |
michael@0 | 13 | * |
michael@0 | 14 | * @author rnewman |
michael@0 | 15 | * |
michael@0 | 16 | */ |
michael@0 | 17 | public abstract class BaseResourceDelegate implements ResourceDelegate { |
michael@0 | 18 | public static int connectionTimeoutInMillis = 1000 * 30; // Wait 30s for a connection to open. |
michael@0 | 19 | public static int socketTimeoutInMillis = 1000 * 2 * 60; // Wait 2 minutes for data. |
michael@0 | 20 | |
michael@0 | 21 | protected Resource resource; |
michael@0 | 22 | public BaseResourceDelegate(Resource resource) { |
michael@0 | 23 | this.resource = resource; |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | @Override |
michael@0 | 27 | public int connectionTimeout() { |
michael@0 | 28 | return connectionTimeoutInMillis; |
michael@0 | 29 | } |
michael@0 | 30 | |
michael@0 | 31 | @Override |
michael@0 | 32 | public int socketTimeout() { |
michael@0 | 33 | return socketTimeoutInMillis; |
michael@0 | 34 | } |
michael@0 | 35 | |
michael@0 | 36 | @Override |
michael@0 | 37 | public AuthHeaderProvider getAuthHeaderProvider() { |
michael@0 | 38 | return null; |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | @Override |
michael@0 | 42 | public void addHeaders(HttpRequestBase request, DefaultHttpClient client) { |
michael@0 | 43 | } |
michael@0 | 44 | } |