Chromium Code Reviews| 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; |