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

Unified Diff: net/url_request/url_fetcher_core.cc

Issue 26230003: net: Allow URLFetcher users to inject custom URLFetcherResponseWriter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win7_aura compile error Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/url_fetcher_core.h ('k') | net/url_request/url_fetcher_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_fetcher_core.cc
diff --git a/net/url_request/url_fetcher_core.cc b/net/url_request/url_fetcher_core.cc
index cf81f2eb7fbe2582782ba9a290b0c264c6c3c4c2..e25fc95a16bc3c8412ddfd8d141241243b5bf570 100644
--- a/net/url_request/url_fetcher_core.cc
+++ b/net/url_request/url_fetcher_core.cc
@@ -265,14 +265,21 @@ void URLFetcherCore::SaveResponseToFileAtPath(
const base::FilePath& file_path,
scoped_refptr<base::TaskRunner> file_task_runner) {
DCHECK(delegate_task_runner_->BelongsToCurrentThread());
- response_writer_.reset(new URLFetcherFileWriter(file_task_runner, file_path));
+ SaveResponseWithWriter(scoped_ptr<URLFetcherResponseWriter>(
+ new URLFetcherFileWriter(file_task_runner, file_path)));
}
void URLFetcherCore::SaveResponseToTemporaryFile(
scoped_refptr<base::TaskRunner> file_task_runner) {
DCHECK(delegate_task_runner_->BelongsToCurrentThread());
- response_writer_.reset(
- new URLFetcherFileWriter(file_task_runner, base::FilePath()));
+ SaveResponseWithWriter(scoped_ptr<URLFetcherResponseWriter>(
+ new URLFetcherFileWriter(file_task_runner, base::FilePath())));
+}
+
+void URLFetcherCore::SaveResponseWithWriter(
+ scoped_ptr<URLFetcherResponseWriter> response_writer) {
+ DCHECK(delegate_task_runner_->BelongsToCurrentThread());
+ response_writer_ = response_writer.Pass();
}
HttpResponseHeaders* URLFetcherCore::GetResponseHeaders() const {
« no previous file with comments | « net/url_request/url_fetcher_core.h ('k') | net/url_request/url_fetcher_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698