diff options
author | sanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-03 21:46:19 +0000 |
---|---|---|
committer | sanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-03 21:46:19 +0000 |
commit | 83a7d2eb244232d057b245e43ae867ad27493bd1 (patch) | |
tree | 2b04a04f09228cb741c24f3e3463f4061779113e /chrome/test/testing_profile.cc | |
parent | 4766b28875c45e5eca6ff16272f85c691e9a181a (diff) | |
download | chromium_src-83a7d2eb244232d057b245e43ae867ad27493bd1.zip chromium_src-83a7d2eb244232d057b245e43ae867ad27493bd1.tar.gz chromium_src-83a7d2eb244232d057b245e43ae867ad27493bd1.tar.bz2 |
Changed UrlFetcher to use a MessageLoopProxy instead of directly relying on ChromeThread. This will allow us to make UrlFetcher independent of ChromeThread and we can then move it to chrome/common.
BUG=None
TEST=UrlFetcher unit-tests
Review URL: http://codereview.chromium.org/1702016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46282 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/testing_profile.cc')
-rw-r--r-- | chrome/test/testing_profile.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc index c6f2a87..25207e9 100644 --- a/chrome/test/testing_profile.cc +++ b/chrome/test/testing_profile.cc @@ -6,6 +6,7 @@ #include "build/build_config.h" #include "base/command_line.h" +#include "base/message_loop_proxy.h" #include "base/string_util.h" #include "chrome/common/url_constants.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -99,7 +100,7 @@ class TestURLRequestContext : public URLRequestContext { // The one here can be run on the main test thread. Note that this can lead to // a leak if your test does not have a ChromeThread::IO in it because // URLRequestContextGetter is defined as a ReferenceCounted object with a -// DeleteOnIOThread trait. +// special trait that deletes it on the IO thread. class TestURLRequestContextGetter : public URLRequestContextGetter { public: virtual URLRequestContext* GetURLRequestContext() { @@ -107,6 +108,9 @@ class TestURLRequestContextGetter : public URLRequestContextGetter { context_ = new TestURLRequestContext(); return context_.get(); } + virtual scoped_refptr<MessageLoopProxy> GetIOMessageLoopProxy() { + return ChromeThread::GetMessageLoopProxyForThread(ChromeThread::IO); + } private: scoped_refptr<URLRequestContext> context_; @@ -129,6 +133,9 @@ class TestExtensionURLRequestContextGetter : public URLRequestContextGetter { context_ = new TestExtensionURLRequestContext(); return context_.get(); } + virtual scoped_refptr<MessageLoopProxy> GetIOMessageLoopProxy() { + return ChromeThread::GetMessageLoopProxyForThread(ChromeThread::IO); + } private: scoped_refptr<URLRequestContext> context_; |