| 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> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 const int kReporterFailureExitCode = INT_MAX; | 38 const int kReporterFailureExitCode = INT_MAX; |
| 39 | 39 |
| 40 // The number of days to wait before triggering another reporter run. | 40 // The number of days to wait before triggering another reporter run. |
| 41 const int kDaysBetweenSuccessfulSwReporterRuns = 7; | 41 const int kDaysBetweenSuccessfulSwReporterRuns = 7; |
| 42 const int kDaysBetweenSwReporterRunsForPendingPrompt = 1; | 42 const int kDaysBetweenSwReporterRunsForPendingPrompt = 1; |
| 43 | 43 |
| 44 // Parameters used to invoke the sw_reporter component. | 44 // Parameters used to invoke the sw_reporter component. |
| 45 struct SwReporterInvocation { | 45 struct SwReporterInvocation { |
| 46 base::CommandLine command_line; | 46 base::CommandLine command_line; |
| 47 | 47 |
| 48 // Experimental versions of the reporter will write metrics to registry keys |
| 49 // ending in |suffix|. Those metrics should be copied to UMA histograms also |
| 50 // ending in |suffix|. For the canonical version, |suffix| will be empty. |
| 51 std::string suffix; |
| 52 |
| 53 // The experimental sw_reporter never triggers the prompt, just reports |
| 54 // results through UMA. |
| 55 bool is_experimental = false; |
| 56 |
| 48 SwReporterInvocation(); | 57 SwReporterInvocation(); |
| 49 | 58 |
| 50 static SwReporterInvocation FromFilePath(const base::FilePath& exe_path); | 59 static SwReporterInvocation FromFilePath(const base::FilePath& exe_path); |
| 51 static SwReporterInvocation FromCommandLine( | 60 static SwReporterInvocation FromCommandLine( |
| 52 const base::CommandLine& command_line); | 61 const base::CommandLine& command_line); |
| 53 | 62 |
| 54 bool operator==(const SwReporterInvocation& other) const; | 63 bool operator==(const SwReporterInvocation& other) const; |
| 55 }; | 64 }; |
| 56 | 65 |
| 57 // Tries to run the sw_reporter component, and then schedule the next try. If | 66 // Tries to run the sw_reporter component, and then schedule the next try. If |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 108 |
| 100 // Set a delegate for testing. The implementation will not take ownership of | 109 // Set a delegate for testing. The implementation will not take ownership of |
| 101 // |delegate| - it must remain valid until this function is called again to | 110 // |delegate| - it must remain valid until this function is called again to |
| 102 // reset the delegate. If |delegate| is nullptr, any previous delegate is | 111 // reset the delegate. If |delegate| is nullptr, any previous delegate is |
| 103 // cleared. | 112 // cleared. |
| 104 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate); | 113 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate); |
| 105 | 114 |
| 106 } // namespace safe_browsing | 115 } // namespace safe_browsing |
| 107 | 116 |
| 108 #endif // CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ | 117 #endif // CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ |
| OLD | NEW |