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 #include "net/url_request/url_request_redirect_job.h" 6 7 #include "base/message_loop.h" 8 9 URLRequestRedirectJob::URLRequestRedirectJob(URLRequest* request, 10 GURL redirect_destination) 11 : URLRequestJob(request), redirect_destination_(redirect_destination) { 12 } 13 14 void URLRequestRedirectJob::Start() { 15 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( 16 this, &URLRequestRedirectJob::StartAsync)); 17 } 18 19 void URLRequestRedirectJob::StartAsync() { 20 NotifyHeadersComplete(); 21 } 22 23 bool URLRequestRedirectJob::IsRedirectResponse(GURL* location, 24 int* http_status_code) { 25 *location = redirect_destination_; 26 *http_status_code = 302; 27 return true; 28 } 29 30