Home | History | Annotate | Download | only in net
      1 // Copyright 2014 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 package org.chromium.net;
      6 
      7 import java.util.concurrent.Executor;
      8 
      9 /**
     10  * A factory for {@link UrlRequest}'s, which uses the best HTTP stack
     11  * available on the current platform.
     12  */
     13 public interface UrlRequestFactory {
     14     /**
     15      * Creates an UrlRequest object. All UrlRequest functions must
     16      * be called on the Executor's thread, and all callbacks will be called
     17      * on the Executor's thread as well.
     18      * createRequest itself may be called on any thread.
     19      * @param url URL for the request.
     20      * @param listener Callback interface that gets called on different events.
     21      * @param executor Executor on which all callbacks will be called.
     22      * @return new request.
     23      */
     24     public abstract UrlRequest createRequest(String url,
     25             UrlRequestListener listener, Executor executor);
     26 }
     27