| 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 virtual void OnCompletedRequest(const URLRequestStatus& status, | 269 virtual void OnCompletedRequest(const URLRequestStatus& status, |
| 270 const std::string& security_info) { | 270 const std::string& security_info) { |
| 271 owner_loop_->PostTask(FROM_HERE, NewRunnableMethod( | 271 owner_loop_->PostTask(FROM_HERE, NewRunnableMethod( |
| 272 this, &RequestProxy::NotifyCompletedRequest, status, security_info)); | 272 this, &RequestProxy::NotifyCompletedRequest, status, security_info)); |
| 273 } | 273 } |
| 274 | 274 |
| 275 // -------------------------------------------------------------------------- | 275 // -------------------------------------------------------------------------- |
| 276 // URLRequest::Delegate implementation: | 276 // URLRequest::Delegate implementation: |
| 277 | 277 |
| 278 virtual void OnReceivedRedirect(URLRequest* request, | 278 virtual void OnReceivedRedirect(URLRequest* request, |
| 279 const GURL& new_url) { | 279 const GURL& new_url, |
| 280 bool* defer_redirect) { |
| 280 DCHECK(request->status().is_success()); | 281 DCHECK(request->status().is_success()); |
| 281 OnReceivedRedirect(new_url); | 282 OnReceivedRedirect(new_url); |
| 282 } | 283 } |
| 283 | 284 |
| 284 virtual void OnResponseStarted(URLRequest* request) { | 285 virtual void OnResponseStarted(URLRequest* request) { |
| 285 if (request->status().is_success()) { | 286 if (request->status().is_success()) { |
| 286 ResourceLoaderBridge::ResponseInfo info; | 287 ResourceLoaderBridge::ResponseInfo info; |
| 287 info.request_time = request->request_time(); | 288 info.request_time = request->request_time(); |
| 288 info.response_time = request->response_time(); | 289 info.response_time = request->response_time(); |
| 289 info.headers = request->response_headers(); | 290 info.headers = request->response_headers(); |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 return std::string(); | 645 return std::string(); |
| 645 } | 646 } |
| 646 | 647 |
| 647 scoped_refptr<CookieGetter> getter = new CookieGetter(); | 648 scoped_refptr<CookieGetter> getter = new CookieGetter(); |
| 648 | 649 |
| 649 io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( | 650 io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( |
| 650 getter.get(), &CookieGetter::Get, url)); | 651 getter.get(), &CookieGetter::Get, url)); |
| 651 | 652 |
| 652 return getter->GetResult(); | 653 return getter->GetResult(); |
| 653 } | 654 } |
| OLD | NEW |