From 83a7d2eb244232d057b245e43ae867ad27493bd1 Mon Sep 17 00:00:00 2001 From: "sanjeevr@chromium.org" Date: Mon, 3 May 2010 21:46:19 +0000 Subject: 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 --- chrome/test/testing_profile.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'chrome/test/testing_profile.cc') 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 GetIOMessageLoopProxy() { + return ChromeThread::GetMessageLoopProxyForThread(ChromeThread::IO); + } private: scoped_refptr context_; @@ -129,6 +133,9 @@ class TestExtensionURLRequestContextGetter : public URLRequestContextGetter { context_ = new TestExtensionURLRequestContext(); return context_.get(); } + virtual scoped_refptr GetIOMessageLoopProxy() { + return ChromeThread::GetMessageLoopProxyForThread(ChromeThread::IO); + } private: scoped_refptr context_; -- cgit v1.1