OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This file contains an implementation of the ResourceLoaderBridge class. | 5 // This file contains an implementation of the ResourceLoaderBridge class. |
6 // The class is implemented using URLRequest, meaning it is a "simple" version | 6 // The class is implemented using URLRequest, meaning it is a "simple" version |
7 // that directly issues requests. The more complicated one used in the | 7 // that directly issues requests. The more complicated one used in the |
8 // browser uses IPC. | 8 // browser uses IPC. |
9 // | 9 // |
10 // Because URLRequest only provides an asynchronous resource loading API, this | 10 // Because URLRequest only provides an asynchronous resource loading API, this |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 virtual void OnCompletedRequest(const URLRequestStatus& status, | 273 virtual void OnCompletedRequest(const URLRequestStatus& status, |
274 const std::string& security_info) { | 274 const std::string& security_info) { |
275 owner_loop_->PostTask(FROM_HERE, NewRunnableMethod( | 275 owner_loop_->PostTask(FROM_HERE, NewRunnableMethod( |
276 this, &RequestProxy::NotifyCompletedRequest, status, security_info)); | 276 this, &RequestProxy::NotifyCompletedRequest, status, security_info)); |
277 } | 277 } |
278 | 278 |
279 // -------------------------------------------------------------------------- | 279 // -------------------------------------------------------------------------- |
280 // URLRequest::Delegate implementation: | 280 // URLRequest::Delegate implementation: |
281 | 281 |
282 virtual void OnReceivedRedirect(URLRequest* request, | 282 virtual void OnReceivedRedirect(URLRequest* request, |
283 const GURL& new_url) { | 283 const GURL& new_url, |
| 284 bool* defer_redirect) { |
284 DCHECK(request->status().is_success()); | 285 DCHECK(request->status().is_success()); |
285 OnReceivedRedirect(new_url); | 286 OnReceivedRedirect(new_url); |
286 } | 287 } |
287 | 288 |
288 virtual void OnResponseStarted(URLRequest* request) { | 289 virtual void OnResponseStarted(URLRequest* request) { |
289 if (request->status().is_success()) { | 290 if (request->status().is_success()) { |
290 ResourceLoaderBridge::ResponseInfo info; | 291 ResourceLoaderBridge::ResponseInfo info; |
291 info.request_time = request->request_time(); | 292 info.request_time = request->request_time(); |
292 info.response_time = request->response_time(); | 293 info.response_time = request->response_time(); |
293 info.headers = request->response_headers(); | 294 info.headers = request->response_headers(); |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 return std::string(); | 654 return std::string(); |
654 } | 655 } |
655 | 656 |
656 scoped_refptr<CookieGetter> getter = new CookieGetter(); | 657 scoped_refptr<CookieGetter> getter = new CookieGetter(); |
657 | 658 |
658 io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( | 659 io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( |
659 getter.get(), &CookieGetter::Get, url)); | 660 getter.get(), &CookieGetter::Get, url)); |
660 | 661 |
661 return getter->GetResult(); | 662 return getter->GetResult(); |
662 } | 663 } |
OLD | NEW |