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

Side by Side Diff: chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_fetcher_win.h

Issue 2929483002: Chrome Cleaner: download the Chrome Cleaner executable in an empty directory. (Closed)
Patch Set: Nits Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_CHROME_CLEANER_FETCHER_WIN_H _ 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_CHROME_CLEANER_FETCHER_WIN_H _
6 #define CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_CHROME_CLEANER_FETCHER_WIN_H _ 6 #define CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_CHROME_CLEANER_FETCHER_WIN_H _
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file_path.h" 9
10 namespace base {
11 class FilePath;
12 }
10 13
11 namespace safe_browsing { 14 namespace safe_browsing {
12 15
16 enum class ChromeCleanerFetchStatus {
17 // Fetch succeeded with a net::HTTP_OK response code.
18 kSuccess,
19 // File system error, no fetch on the network was attempted.
20 kFailedToCreateTemporaryDirectory,
21 // We received a net::HTTP_NOT_FOUND response code.
22 kNotFoundOnServer,
23 // Fetch failed or we received an http response code other than net::HTTP_OK
24 // and net::HTTP_NOT_FOUND.
25 kOtherFailure,
26 };
27
13 // Type of callback that is called when the network request to fetch the Chrome 28 // Type of callback that is called when the network request to fetch the Chrome
14 // Cleaner binary has been completed. The callback will be passed the filepath 29 // Cleaner binary has been completed.
15 // and http response code as returned by net::URLFetcher.
16 using ChromeCleanerFetchedCallback = 30 using ChromeCleanerFetchedCallback =
17 base::OnceCallback<void(base::FilePath, int /*http response code*/)>; 31 base::OnceCallback<void(base::FilePath,
32 ChromeCleanerFetchStatus fetch_status)>;
18 33
19 // Fetches the Chrome Cleaner binary. This function can be called from any 34 // Fetches the Chrome Cleaner binary. This function can be called from any
20 // sequence and |fetched_callback| will be called back on that same sequence. 35 // sequence and |fetched_callback| will be called back on that same sequence.
21 void FetchChromeCleaner(ChromeCleanerFetchedCallback fetched_callback); 36 void FetchChromeCleaner(ChromeCleanerFetchedCallback fetched_callback);
22 37
23 } // namespace safe_browsing 38 } // namespace safe_browsing
24 39
25 #endif // CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_CHROME_CLEANER_FETCHER_WI N_H_ 40 #endif // CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_CHROME_CLEANER_FETCHER_WI N_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698