| 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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 // Event hooks that run on the IO thread: | 422 // Event hooks that run on the IO thread: |
| 423 | 423 |
| 424 virtual void OnReceivedRedirect( | 424 virtual void OnReceivedRedirect( |
| 425 const GURL& new_url, | 425 const GURL& new_url, |
| 426 const ResourceLoaderBridge::ResponseInfo& info, | 426 const ResourceLoaderBridge::ResponseInfo& info, |
| 427 bool* defer_redirect) { | 427 bool* defer_redirect) { |
| 428 // TODO(darin): It would be much better if this could live in WebCore, but | 428 // TODO(darin): It would be much better if this could live in WebCore, but |
| 429 // doing so requires API changes at all levels. Similar code exists in | 429 // doing so requires API changes at all levels. Similar code exists in |
| 430 // WebCore/platform/network/cf/ResourceHandleCFNet.cpp :-( | 430 // WebCore/platform/network/cf/ResourceHandleCFNet.cpp :-( |
| 431 if (new_url.GetOrigin() != result_->url.GetOrigin()) { | 431 if (new_url.GetOrigin() != result_->url.GetOrigin()) { |
| 432 LOG(ERROR) << "Cross origin redirect denied"; | 432 DLOG(WARNING) << "Cross origin redirect denied"; |
| 433 Cancel(); | 433 Cancel(); |
| 434 return; | 434 return; |
| 435 } | 435 } |
| 436 result_->url = new_url; | 436 result_->url = new_url; |
| 437 } | 437 } |
| 438 | 438 |
| 439 virtual void OnReceivedResponse( | 439 virtual void OnReceivedResponse( |
| 440 const ResourceLoaderBridge::ResponseInfo& info, | 440 const ResourceLoaderBridge::ResponseInfo& info, |
| 441 bool content_filtered) { | 441 bool content_filtered) { |
| 442 *static_cast<ResourceLoaderBridge::ResponseInfo*>(result_) = info; | 442 *static_cast<ResourceLoaderBridge::ResponseInfo*>(result_) = info; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 return std::string(); | 688 return std::string(); |
| 689 } | 689 } |
| 690 | 690 |
| 691 scoped_refptr<CookieGetter> getter = new CookieGetter(); | 691 scoped_refptr<CookieGetter> getter = new CookieGetter(); |
| 692 | 692 |
| 693 io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( | 693 io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( |
| 694 getter.get(), &CookieGetter::Get, url)); | 694 getter.get(), &CookieGetter::Get, url)); |
| 695 | 695 |
| 696 return getter->GetResult(); | 696 return getter->GetResult(); |
| 697 } | 697 } |
| OLD | NEW |