mobile/android/base/sync/net/BaseResourceDelegate.java

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial