OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SRT_FETCHER_WIN_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ |
7 | 7 |
8 #include <limits.h> | 8 #include <limits.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/feature_list.h" | |
14 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
15 #include "base/version.h" | 16 #include "base/version.h" |
16 | 17 |
17 namespace base { | 18 namespace base { |
18 class FilePath; | 19 class FilePath; |
19 class TaskRunner; | 20 class TaskRunner; |
20 } | 21 } |
21 | 22 |
22 class Browser; | 23 class Browser; |
23 | 24 |
24 namespace safe_browsing { | 25 namespace safe_browsing { |
25 | 26 |
26 // SRT registry keys and value names. | 27 // SRT registry keys and value names. |
27 extern const wchar_t kSoftwareRemovalToolRegistryKey[]; | 28 extern const wchar_t kSoftwareRemovalToolRegistryKey[]; |
28 extern const wchar_t kEndTimeValueName[]; | 29 extern const wchar_t kEndTimeValueName[]; |
29 extern const wchar_t kStartTimeValueName[]; | 30 extern const wchar_t kStartTimeValueName[]; |
30 | 31 |
31 // Reporter exit codes. | 32 // Reporter exit codes. |
32 const int kSwReporterCleanupNeeded = 0; | 33 const int kSwReporterCleanupNeeded = 0; |
33 const int kSwReporterNothingFound = 2; | 34 const int kSwReporterNothingFound = 2; |
34 const int kSwReporterPostRebootCleanupNeeded = 4; | 35 const int kSwReporterPostRebootCleanupNeeded = 4; |
35 const int kSwReporterDelayedPostRebootCleanupNeeded = 15; | 36 const int kSwReporterDelayedPostRebootCleanupNeeded = 15; |
36 | 37 |
37 // A special exit code identifying a failure to run the reporter. | 38 // A special exit code identifying a failure to run the reporter. |
38 const int kReporterFailureExitCode = INT_MAX; | 39 const int kReporterFailureExitCode = INT_MAX; |
39 | 40 |
40 // The number of days to wait before triggering another reporter run. | 41 // The number of days to wait before triggering another reporter run. |
41 const int kDaysBetweenSuccessfulSwReporterRuns = 7; | 42 const int kDaysBetweenSuccessfulSwReporterRuns = 7; |
42 const int kDaysBetweenSwReporterRunsForPendingPrompt = 1; | 43 const int kDaysBetweenSwReporterRunsForPendingPrompt = 1; |
44 // The number of days to wait before sending out reporter logs. | |
45 const int kDaysBetweenReporterLogsSent = 7; | |
46 | |
47 extern const char kExtendedSafeBrowsingEnabledSwitch[]; | |
48 | |
49 const base::Feature kSwReporterExtendedSafeBrowsingFeature{ | |
csharp
2016/09/02 21:16:25
I think you want this to be extern too
ftirelo
2016/09/06 16:37:43
Done.
| |
50 "SwReporterExtendedSafeBrowsingFeature", base::FEATURE_DISABLED_BY_DEFAULT}; | |
43 | 51 |
44 // Parameters used to invoke the sw_reporter component. | 52 // Parameters used to invoke the sw_reporter component. |
45 struct SwReporterInvocation { | 53 struct SwReporterInvocation { |
46 base::CommandLine command_line; | 54 base::CommandLine command_line; |
47 | 55 |
48 // Experimental versions of the reporter will write metrics to registry keys | 56 // Experimental versions of the reporter will write metrics to registry keys |
49 // ending in |suffix|. Those metrics should be copied to UMA histograms also | 57 // ending in |suffix|. Those metrics should be copied to UMA histograms also |
50 // ending in |suffix|. For the canonical version, |suffix| will be empty. | 58 // ending in |suffix|. For the canonical version, |suffix| will be empty. |
51 std::string suffix; | 59 std::string suffix; |
52 | 60 |
53 // The experimental sw_reporter never triggers the prompt, just reports | 61 // The experimental sw_reporter never triggers the prompt, just reports |
54 // results through UMA. | 62 // results through UMA. |
55 bool is_experimental = false; | 63 bool is_experimental = false; |
56 | 64 |
57 SwReporterInvocation(); | 65 SwReporterInvocation(); |
66 SwReporterInvocation(const SwReporterInvocation& other); | |
58 | 67 |
59 static SwReporterInvocation FromFilePath(const base::FilePath& exe_path); | 68 static SwReporterInvocation FromFilePath(const base::FilePath& exe_path); |
60 static SwReporterInvocation FromCommandLine( | 69 static SwReporterInvocation FromCommandLine( |
61 const base::CommandLine& command_line); | 70 const base::CommandLine& command_line); |
62 | 71 |
63 bool operator==(const SwReporterInvocation& other) const; | 72 bool operator==(const SwReporterInvocation& other) const; |
64 }; | 73 }; |
65 | 74 |
66 // Tries to run the sw_reporter component, and then schedule the next try. If | 75 // Tries to run the sw_reporter component, and then schedule the next try. If |
67 // called multiple times, then multiple sequences of trying to run will happen, | 76 // called multiple times, then multiple sequences of trying to run will happen, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 | 117 |
109 // Set a delegate for testing. The implementation will not take ownership of | 118 // Set a delegate for testing. The implementation will not take ownership of |
110 // |delegate| - it must remain valid until this function is called again to | 119 // |delegate| - it must remain valid until this function is called again to |
111 // reset the delegate. If |delegate| is nullptr, any previous delegate is | 120 // reset the delegate. If |delegate| is nullptr, any previous delegate is |
112 // cleared. | 121 // cleared. |
113 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate); | 122 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate); |
114 | 123 |
115 } // namespace safe_browsing | 124 } // namespace safe_browsing |
116 | 125 |
117 #endif // CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ | 126 #endif // CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ |
OLD | NEW |