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 17 matching lines...) Expand all Loading... |
28 // resources in-process. For example, it is handy for building a single- | 28 // resources in-process. For example, it is handy for building a single- |
29 // process WebKit embedding (e.g., test_shell) that can use URLRequest to | 29 // process WebKit embedding (e.g., test_shell) that can use URLRequest to |
30 // perform URL loads. See renderer/resource_dispatcher.h for details on an | 30 // perform URL loads. See renderer/resource_dispatcher.h for details on an |
31 // alternate implementation that defers fetching to another process. | 31 // alternate implementation that defers fetching to another process. |
32 | 32 |
33 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" | 33 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" |
34 | 34 |
35 #include "base/message_loop.h" | 35 #include "base/message_loop.h" |
36 #include "base/ref_counted.h" | 36 #include "base/ref_counted.h" |
37 #include "base/time.h" | 37 #include "base/time.h" |
| 38 #include "base/timer.h" |
38 #include "base/thread.h" | 39 #include "base/thread.h" |
39 #include "base/waitable_event.h" | 40 #include "base/waitable_event.h" |
40 #include "net/base/cookie_monster.h" | 41 #include "net/base/cookie_monster.h" |
41 #include "net/base/io_buffer.h" | 42 #include "net/base/io_buffer.h" |
42 #include "net/base/load_flags.h" | 43 #include "net/base/load_flags.h" |
43 #include "net/base/net_errors.h" | 44 #include "net/base/net_errors.h" |
44 #include "net/base/net_util.h" | 45 #include "net/base/net_util.h" |
45 #include "net/base/upload_data.h" | 46 #include "net/base/upload_data.h" |
46 #include "net/http/http_response_headers.h" | 47 #include "net/http/http_response_headers.h" |
47 #include "net/proxy/proxy_service.h" | 48 #include "net/proxy/proxy_service.h" |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 return std::string(); | 653 return std::string(); |
653 } | 654 } |
654 | 655 |
655 scoped_refptr<CookieGetter> getter = new CookieGetter(); | 656 scoped_refptr<CookieGetter> getter = new CookieGetter(); |
656 | 657 |
657 io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( | 658 io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( |
658 getter.get(), &CookieGetter::Get, url)); | 659 getter.get(), &CookieGetter::Get, url)); |
659 | 660 |
660 return getter->GetResult(); | 661 return getter->GetResult(); |
661 } | 662 } |
OLD | NEW |