Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Side by Side Diff: webkit/tools/test_shell/simple_resource_loader_bridge.cc

Issue 2806084: Add SimpleResourceLoaderBridge::GetIoThread(), so it's possible to run tasks ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/tools/test_shell/simple_resource_loader_bridge.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 15 matching lines...) Expand all
26 // 26 //
27 // NOTE: The implementation in this file may be used to have WebKit fetch 27 // NOTE: The implementation in this file may be used to have WebKit fetch
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/file_path.h" 35 #include "base/file_path.h"
36 #include "base/logging.h"
36 #include "base/message_loop.h" 37 #include "base/message_loop.h"
37 #if defined(OS_MACOSX) || defined(OS_WIN) 38 #if defined(OS_MACOSX) || defined(OS_WIN)
38 #include "base/nss_util.h" 39 #include "base/nss_util.h"
39 #endif 40 #endif
40 #include "base/ref_counted.h" 41 #include "base/ref_counted.h"
41 #include "base/time.h" 42 #include "base/time.h"
42 #include "base/timer.h" 43 #include "base/timer.h"
43 #include "base/thread.h" 44 #include "base/thread.h"
44 #include "base/waitable_event.h" 45 #include "base/waitable_event.h"
45 #include "net/base/io_buffer.h" 46 #include "net/base/io_buffer.h"
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 } else { 819 } else {
819 g_io_thread->SetAcceptAllCookies(accept_all_cookies); 820 g_io_thread->SetAcceptAllCookies(accept_all_cookies);
820 } 821 }
821 } 822 }
822 823
823 // static 824 // static
824 scoped_refptr<base::MessageLoopProxy> 825 scoped_refptr<base::MessageLoopProxy>
825 SimpleResourceLoaderBridge::GetCacheThread() { 826 SimpleResourceLoaderBridge::GetCacheThread() {
826 return g_cache_thread->message_loop_proxy(); 827 return g_cache_thread->message_loop_proxy();
827 } 828 }
829
830 // static
831 scoped_refptr<base::MessageLoopProxy>
832 SimpleResourceLoaderBridge::GetIoThread() {
833 if (!EnsureIOThread()) {
834 LOG(DFATAL) << "Failed to create IO thread.";
835 return NULL;
836 }
837 return g_io_thread->message_loop_proxy();
838 }
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/simple_resource_loader_bridge.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698