OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_ |
6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 class GURL; | 10 class GURL; |
11 | 11 |
12 namespace base { | |
13 class FilePath; | |
14 } | |
15 | |
12 namespace net { | 16 namespace net { |
13 class URLFetcher; | 17 class URLFetcher; |
14 class URLFetcherDelegate; | 18 class URLFetcherDelegate; |
15 class URLRequestContextGetter; | 19 class URLRequestContextGetter; |
16 } | 20 } |
17 | 21 |
18 namespace component_updater { | 22 namespace component_updater { |
19 | 23 |
20 // An update protocol request starts with a common preamble which includes | 24 // An update protocol request starts with a common preamble which includes |
21 // version and platform information for Chrome and the operating system, | 25 // version and platform information for Chrome and the operating system, |
(...skipping 26 matching lines...) Expand all Loading... | |
48 | 52 |
49 // Returns the error code which occured during the fetch. The function returns 0 | 53 // Returns the error code which occured during the fetch. The function returns 0 |
50 // if the fetch was successful. If errors happen, the function could return a | 54 // if the fetch was successful. If errors happen, the function could return a |
51 // network error, an http response code, or the status of the fetch, if the | 55 // network error, an http response code, or the status of the fetch, if the |
52 // fetch is pending or canceled. | 56 // fetch is pending or canceled. |
53 int GetFetchError(const net::URLFetcher& fetcher); | 57 int GetFetchError(const net::URLFetcher& fetcher); |
54 | 58 |
55 // Returns true if the |status_code| represents a server error 5xx. | 59 // Returns true if the |status_code| represents a server error 5xx. |
56 bool IsHttpServerError(int status_code); | 60 bool IsHttpServerError(int status_code); |
57 | 61 |
62 // Deletes the file and its directory, if the directory is empty. | |
waffles
2013/12/16 17:42:39
Maybe make a note about what is returned here.
Sh
Sorin Jianu
2013/12/16 18:06:17
Changed the name and made the function return true
| |
63 bool DeleteFileAndParentDirectoryIfEmpty(const base::FilePath& filepath); | |
64 | |
58 } // namespace component_updater | 65 } // namespace component_updater |
59 | 66 |
60 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_ | 67 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_ |
61 | 68 |
OLD | NEW |