Commit e5ae223b authored by michaeln@chromium.org's avatar michaeln@chromium.org

Add SimpleResourceLoaderBridge::GetIoThread(), so it's possible to run tasks...

Add SimpleResourceLoaderBridge::GetIoThread(), so it's possible to run tasks in the IO thread when using SimpleResourceLoaderBridge.

This is a clone of http://codereview.chromium.org/3007015/show
Contributed by: bmcquade@google.com

BUG=none
TEST=none
TBR=rvargas


Review URL: http://codereview.chromium.org/2806084

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54077 0039d316-1c4b-4281-b951-d872f2087c98
parent d34f220f
......@@ -33,6 +33,7 @@
#include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
#include "base/file_path.h"
#include "base/logging.h"
#include "base/message_loop.h"
#if defined(OS_MACOSX) || defined(OS_WIN)
#include "base/nss_util.h"
......@@ -825,3 +826,13 @@ scoped_refptr<base::MessageLoopProxy>
SimpleResourceLoaderBridge::GetCacheThread() {
return g_cache_thread->message_loop_proxy();
}
// static
scoped_refptr<base::MessageLoopProxy>
SimpleResourceLoaderBridge::GetIoThread() {
if (!EnsureIOThread()) {
LOG(DFATAL) << "Failed to create IO thread.";
return NULL;
}
return g_io_thread->message_loop_proxy();
}
......@@ -37,8 +37,11 @@ class SimpleResourceLoaderBridge {
static bool EnsureIOThread();
static void SetAcceptAllCookies(bool accept_all_cookies);
// This method should only be called after Init(), and before Shutdown().
// These methods should only be called after Init(), and before
// Shutdown(). The MessageLoops get replaced upon each call to
// Init(), and destroyed upon a call to ShutDown().
static scoped_refptr<base::MessageLoopProxy> GetCacheThread();
static scoped_refptr<base::MessageLoopProxy> GetIoThread();
};
#endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_RESOURCE_LOADER_BRIDGE_H__
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment