Home | History | Annotate | Download | only in url_request
      1 // Copyright (c) 2006-2008 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 #ifndef NET_URL_REQUEST_URL_REQUEST_REDIRECT_JOB_H_
      6 #define NET_URL_REQUEST_URL_REQUEST_REDIRECT_JOB_H_
      7 
      8 #include "net/url_request/url_request_job.h"
      9 
     10 class GURL;
     11 
     12 // A URLRequestJob that will redirect the request to the specified
     13 // URL.  This is useful to restart a request at a different URL based
     14 // on the result of another job.
     15 class URLRequestRedirectJob : public URLRequestJob {
     16  public:
     17   // Constructs a job that redirects to the specified URL.
     18   URLRequestRedirectJob(URLRequest* request, GURL redirect_destination);
     19 
     20   virtual void Start();
     21   bool IsRedirectResponse(GURL* location, int* http_status_code);
     22 
     23  private:
     24   ~URLRequestRedirectJob() {}
     25 
     26   void StartAsync();
     27 
     28   GURL redirect_destination_;
     29 };
     30 
     31 #endif  // NET_URL_REQUEST_URL_REQUEST_REDIRECT_JOB_H_
     32 
     33