summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-23 06:39:42 +0000
committerukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-23 06:39:42 +0000
commitca6c2a9a99b8a2d560aa830766d64fbe7789bfe1 (patch)
tree5ee1360418aad04bb8fdbaef4f0612695a9a69b5 /chrome/common
parentd7bd81219f1840ea22882644c98e4a73abba1ed8 (diff)
downloadchromium_src-ca6c2a9a99b8a2d560aa830766d64fbe7789bfe1.zip
chromium_src-ca6c2a9a99b8a2d560aa830766d64fbe7789bfe1.tar.gz
chromium_src-ca6c2a9a99b8a2d560aa830766d64fbe7789bfe1.tar.bz2
Use ChromeThread::IO instead of virtual set_request_context
ChromeThread::IO will be used to cancel URLFetcher request and clean up URLRequestContextGetter. BUG=52562,52826 TEST=valgrind passes Review URL: http://codereview.chromium.org/3176028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57032 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/net/test_url_fetcher_factory.h9
-rw-r--r--chrome/common/net/url_fetcher.h2
2 files changed, 3 insertions, 8 deletions
diff --git a/chrome/common/net/test_url_fetcher_factory.h b/chrome/common/net/test_url_fetcher_factory.h
index 676cfe0..b34c0a1 100644
--- a/chrome/common/net/test_url_fetcher_factory.h
+++ b/chrome/common/net/test_url_fetcher_factory.h
@@ -21,6 +21,8 @@
// Typical usage:
// // TestURLFetcher requires a MessageLoop:
// MessageLoopForUI message_loop;
+// // And io_thread to release URLRequestContextGetter in URLFetcher::Core.
+// ChromeThread io_thread(ChromeThread::IO, &message_loop);
// // Create and register factory.
// TestURLFetcherFactory factory;
// URLFetcher::set_factory(&factory);
@@ -53,13 +55,6 @@ class TestURLFetcher : public URLFetcher {
// Returns the data uploaded on this URLFetcher.
const std::string& upload_data() const { return URLFetcher::upload_data(); }
- // Overriden to do nothing. URLFetcher implementation add reference
- // to request_context_getter in core_, but it might not be released
- // because we wouldn't call Core::CancelURLRequest.
- // Without this, we'll see leaks of URLRequestContext in test.
- virtual void set_request_context(
- URLRequestContextGetter* request_context_getter) {}
-
private:
const GURL original_url_;
diff --git a/chrome/common/net/url_fetcher.h b/chrome/common/net/url_fetcher.h
index 1a96f91..9294db3 100644
--- a/chrome/common/net/url_fetcher.h
+++ b/chrome/common/net/url_fetcher.h
@@ -140,7 +140,7 @@ class URLFetcher {
// Set the URLRequestContext on the request. Must be called before the
// request is started.
- virtual void set_request_context(
+ void set_request_context(
URLRequestContextGetter* request_context_getter);
// If |retry| is false, 5xx responses will be propagated to the observer,