| 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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 | 509 |
| 510 net::ProxyInfo proxy_info; | 510 net::ProxyInfo proxy_info; |
| 511 int rv = sync_proxy_service->ResolveProxy(url, &proxy_info); | 511 int rv = sync_proxy_service->ResolveProxy(url, &proxy_info); |
| 512 if (rv == net::OK) { | 512 if (rv == net::OK) { |
| 513 *proxy_list = proxy_info.ToPacString(); | 513 *proxy_list = proxy_info.ToPacString(); |
| 514 } | 514 } |
| 515 | 515 |
| 516 return rv == net::OK; | 516 return rv == net::OK; |
| 517 } | 517 } |
| 518 | 518 |
| 519 void SetCookie(const GURL& url, const GURL& policy_url, |
| 520 const std::string& cookie) { |
| 521 SimpleResourceLoaderBridge::SetCookie(url, policy_url, cookie); |
| 522 } |
| 523 |
| 524 std::string GetCookies(const GURL& url, const GURL& policy_url) { |
| 525 return SimpleResourceLoaderBridge::GetCookies(url, policy_url); |
| 526 } |
| 527 |
| 519 } // namespace webkit_glue | 528 } // namespace webkit_glue |
| 520 | 529 |
| 521 //----------------------------------------------------------------------------- | 530 //----------------------------------------------------------------------------- |
| 522 | 531 |
| 523 // static | 532 // static |
| 524 void SimpleResourceLoaderBridge::Init(URLRequestContext* context) { | 533 void SimpleResourceLoaderBridge::Init(URLRequestContext* context) { |
| 525 // Make sure to stop any existing IO thread since it may be using the | 534 // Make sure to stop any existing IO thread since it may be using the |
| 526 // current request context. | 535 // current request context. |
| 527 Shutdown(); | 536 Shutdown(); |
| 528 | 537 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 return std::string(); | 576 return std::string(); |
| 568 } | 577 } |
| 569 | 578 |
| 570 scoped_refptr<CookieGetter> getter = new CookieGetter(); | 579 scoped_refptr<CookieGetter> getter = new CookieGetter(); |
| 571 | 580 |
| 572 io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( | 581 io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( |
| 573 getter.get(), &CookieGetter::Get, url)); | 582 getter.get(), &CookieGetter::Get, url)); |
| 574 | 583 |
| 575 return getter->GetResult(); | 584 return getter->GetResult(); |
| 576 } | 585 } |
| OLD | NEW |