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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 }; | 537 }; |
538 | 538 |
539 } // anonymous namespace | 539 } // anonymous namespace |
540 | 540 |
541 //----------------------------------------------------------------------------- | 541 //----------------------------------------------------------------------------- |
542 | 542 |
543 namespace webkit_glue { | 543 namespace webkit_glue { |
544 | 544 |
545 // factory function | 545 // factory function |
546 ResourceLoaderBridge* ResourceLoaderBridge::Create( | 546 ResourceLoaderBridge* ResourceLoaderBridge::Create( |
547 WebFrame* webframe, | |
548 const std::string& method, | 547 const std::string& method, |
549 const GURL& url, | 548 const GURL& url, |
550 const GURL& policy_url, | 549 const GURL& policy_url, |
551 const GURL& referrer, | 550 const GURL& referrer, |
552 const std::string& headers, | 551 const std::string& headers, |
553 int load_flags, | 552 int load_flags, |
554 int origin_pid, | 553 int requestor_pid, |
555 ResourceType::Type request_type, | 554 ResourceType::Type request_type, |
556 bool mixed_contents) { | 555 bool mixed_contents, |
557 return new ResourceLoaderBridgeImpl(method, url, policy_url, referrer, | 556 int routing_id) { |
558 headers, load_flags); | 557 return new ResourceLoaderBridgeImpl(method, url, policy_url, |
| 558 referrer, headers, load_flags); |
559 } | 559 } |
560 | 560 |
561 // Issue the proxy resolve request on the io thread, and wait | 561 // Issue the proxy resolve request on the io thread, and wait |
562 // for the result. | 562 // for the result. |
563 bool FindProxyForUrl(const GURL& url, std::string* proxy_list) { | 563 bool FindProxyForUrl(const GURL& url, std::string* proxy_list) { |
564 DCHECK(request_context); | 564 DCHECK(request_context); |
565 | 565 |
566 scoped_refptr<net::SyncProxyServiceHelper> sync_proxy_service( | 566 scoped_refptr<net::SyncProxyServiceHelper> sync_proxy_service( |
567 new net::SyncProxyServiceHelper(io_thread->message_loop(), | 567 new net::SyncProxyServiceHelper(io_thread->message_loop(), |
568 request_context->proxy_service())); | 568 request_context->proxy_service())); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 return std::string(); | 627 return std::string(); |
628 } | 628 } |
629 | 629 |
630 scoped_refptr<CookieGetter> getter = new CookieGetter(); | 630 scoped_refptr<CookieGetter> getter = new CookieGetter(); |
631 | 631 |
632 io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( | 632 io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( |
633 getter.get(), &CookieGetter::Get, url)); | 633 getter.get(), &CookieGetter::Get, url)); |
634 | 634 |
635 return getter->GetResult(); | 635 return getter->GetResult(); |
636 } | 636 } |
OLD | NEW |