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

Unified Diff: chrome/browser/net/file_downloader.h

Issue 1851803002: [NTP Popular Sites] Store country/version in prefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: chrome/browser/net/file_downloader.h
diff --git a/chrome/browser/net/file_downloader.h b/chrome/browser/net/file_downloader.h
index d6383188464f3af04f6a66d801c3785c61c02636..403a191eb06ab89b9b7970a7657ba956b5e04982 100644
--- a/chrome/browser/net/file_downloader.h
+++ b/chrome/browser/net/file_downloader.h
@@ -25,7 +25,8 @@ class GURL;
// downloading anything.
class FileDownloader : public net::URLFetcherDelegate {
public:
- typedef base::Callback<void(bool /* success */)> DownloadFinishedCallback;
+ enum Result { DOWNLOADED, EXISTS, FAILED };
Bernhard Bauer 2016/04/01 15:49:47 Add comments what these mean?
Marc Treib 2016/04/01 16:33:28 Done.
+ using DownloadFinishedCallback = base::Callback<void(Result)>;
// Directly starts the download (if necessary) and runs |callback| when done.
// If the instance is destroyed before it is finished, |callback| is not run.
@@ -36,6 +37,8 @@ class FileDownloader : public net::URLFetcherDelegate {
const DownloadFinishedCallback& callback);
~FileDownloader() override;
+ static bool IsSuccess(Result result) { return result != FAILED; }
+
private:
// net::URLFetcherDelegate implementation.
void OnURLFetchComplete(const net::URLFetcher* source) override;

Powered by Google App Engine
This is Rietveld 408576698