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

Unified Diff: content/public/common/url_fetcher.h

Issue 9585009: Add URLFetcher::SaveResponseToFileAtPath (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits Created 8 years, 9 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 | « content/common/net/url_fetcher_impl_unittest.cc ('k') | content/test/test_url_fetcher_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/url_fetcher.h
diff --git a/content/public/common/url_fetcher.h b/content/public/common/url_fetcher.h
index 571a34bc85624b09e67fca77634229174a9a999f..e2b800b064b67d5a396e701ac90615f3ce7e0ae7 100644
--- a/content/public/common/url_fetcher.h
+++ b/content/public/common/url_fetcher.h
@@ -169,8 +169,20 @@ class CONTENT_EXPORT URLFetcher {
virtual base::TimeDelta GetBackoffDelay() const = 0;
// By default, the response is saved in a string. Call this method to save the
+ // response to a file instead. Must be called before Start().
+ // |file_message_loop_proxy| will be used for all file operations.
+ // To save to a temporary file, use SaveResponseToTemporaryFile().
+ // The created file is removed when the URLFetcher is deleted unless you
+ // take ownership by calling GetResponseAsFilePath().
+ virtual void SaveResponseToFileAtPath(
+ const FilePath& file_path,
+ scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy) = 0;
+
+ // By default, the response is saved in a string. Call this method to save the
// response to a temporary file instead. Must be called before Start().
// |file_message_loop_proxy| will be used for all file operations.
+ // The created file is removed when the URLFetcher is deleted unless you
+ // take ownership by calling GetResponseAsFilePath().
virtual void SaveResponseToTemporaryFile(
scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy) = 0;
@@ -227,7 +239,7 @@ class CONTENT_EXPORT URLFetcher {
// Get the path to the file containing the response body. Returns false
// if the response body was not saved to a file. If take_ownership is
- // true, caller takes responsibility for the temp file, and it will not
+ // true, caller takes responsibility for the file, and it will not
// be removed once the URLFetcher is destroyed. User should not take
// ownership more than once, or call this method after taking ownership.
virtual bool GetResponseAsFilePath(bool take_ownership,
« no previous file with comments | « content/common/net/url_fetcher_impl_unittest.cc ('k') | content/test/test_url_fetcher_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698