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

Side by Side Diff: chrome/browser/safe_browsing/srt_fetcher_win.h

Issue 2347753002: Adds histograms for tracking Software Reporter logs uploads in SRT Fetcher. (Closed)
Patch Set: Registry error histogram and more comments Created 4 years, 3 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 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 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 // Parameters used to invoke the sw_reporter component. 53 // Parameters used to invoke the sw_reporter component.
54 struct SwReporterInvocation { 54 struct SwReporterInvocation {
55 base::CommandLine command_line; 55 base::CommandLine command_line;
56 56
57 // Experimental versions of the reporter will write metrics to registry keys 57 // Experimental versions of the reporter will write metrics to registry keys
58 // ending in |suffix|. Those metrics should be copied to UMA histograms also 58 // ending in |suffix|. Those metrics should be copied to UMA histograms also
59 // ending in |suffix|. For the canonical version, |suffix| will be empty. 59 // ending in |suffix|. For the canonical version, |suffix| will be empty.
60 std::string suffix; 60 std::string suffix;
61 61
62 // Flags to control optional behaviours. By default all are enabled; 62 // Flags to control behaviours the Software Reporter should support by
63 // experimental versions of the reporter will turn off the behaviours that 63 // default. These flags are set in the Reporter installer, and experimental
64 // are not yet supported. 64 // versions of the reporter will turn on the behaviours that are not yet
65 using Flags = uint32_t; 65 // supported.
66 enum : Flags { 66 using Behaviours = uint32_t;
67 FLAG_LOG_TO_RAPPOR = 0x1, 67 enum : Behaviours {
68 FLAG_LOG_EXIT_CODE_TO_PREFS = 0x2, 68 BEHAVIOUR_LOG_TO_RAPPOR = 0x1,
69 FLAG_TRIGGER_PROMPT = 0x4, 69 BEHAVIOUR_LOG_EXIT_CODE_TO_PREFS = 0x2,
70 FLAG_SEND_REPORTER_LOGS = 0x8, 70 BEHAVIOUR_TRIGGER_PROMPT = 0x4,
71 BEHAVIOUR_ALLOW_SEND_REPORTER_LOGS = 0x8,
71 }; 72 };
72 Flags flags = 0; 73 Behaviours supported_behaviours = 0;
74
75 // Whether logs upload was enabled in this invocation.
76 bool logs_upload_enabled = false;
73 77
74 SwReporterInvocation(); 78 SwReporterInvocation();
75 79
76 static SwReporterInvocation FromFilePath(const base::FilePath& exe_path); 80 static SwReporterInvocation FromFilePath(const base::FilePath& exe_path);
77 static SwReporterInvocation FromCommandLine( 81 static SwReporterInvocation FromCommandLine(
78 const base::CommandLine& command_line); 82 const base::CommandLine& command_line);
79 83
80 bool operator==(const SwReporterInvocation& other) const; 84 bool operator==(const SwReporterInvocation& other) const;
85
86 bool BehaviourIsSupported(Behaviours intended_behaviour) const;
81 }; 87 };
82 88
83 using SwReporterQueue = std::queue<SwReporterInvocation>; 89 using SwReporterQueue = std::queue<SwReporterInvocation>;
84 90
85 // Tries to run the sw_reporter component, and then schedule the next try. If 91 // Tries to run the sw_reporter component, and then schedule the next try. If
86 // called multiple times, then multiple sequences of trying to run will happen, 92 // called multiple times, then multiple sequences of trying to run will happen,
87 // yet only one SwReporterQueue will actually run per specified period (either 93 // yet only one SwReporterQueue will actually run per specified period (either
88 // |kDaysBetweenSuccessfulSwReporterRuns| or 94 // |kDaysBetweenSuccessfulSwReporterRuns| or
89 // |kDaysBetweenSwReporterRunsForPendingPrompt|). 95 // |kDaysBetweenSwReporterRunsForPendingPrompt|).
90 // 96 //
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 138
133 // Set a delegate for testing. The implementation will not take ownership of 139 // Set a delegate for testing. The implementation will not take ownership of
134 // |delegate| - it must remain valid until this function is called again to 140 // |delegate| - it must remain valid until this function is called again to
135 // reset the delegate. If |delegate| is nullptr, any previous delegate is 141 // reset the delegate. If |delegate| is nullptr, any previous delegate is
136 // cleared. 142 // cleared.
137 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate); 143 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate);
138 144
139 } // namespace safe_browsing 145 } // namespace safe_browsing
140 146
141 #endif // CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ 147 #endif // CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698