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

Unified Diff: chrome/browser/component_updater/sw_reporter_installer_win.h

Issue 2278013002: Add support for the ExperimentalSwReporterEngine field trial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify comment Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/component_updater/sw_reporter_installer_win.h
diff --git a/chrome/browser/component_updater/sw_reporter_installer_win.h b/chrome/browser/component_updater/sw_reporter_installer_win.h
index 7427e5a994258c2ae34bdd31839ced2898ceac66..d5be44907f366e191f8a68c91a2233c9bb8f3e51 100644
--- a/chrome/browser/component_updater/sw_reporter_installer_win.h
+++ b/chrome/browser/component_updater/sw_reporter_installer_win.h
@@ -35,6 +35,14 @@ namespace component_updater {
class ComponentUpdateService;
+// These MUST match the values for SwReporterExperimentError in histograms.xml.
+// Exposed for testing.
+enum SwReporterExperimentError {
+ SW_REPORTER_EXPERIMENT_ERROR_BAD_TAG = 0,
+ SW_REPORTER_EXPERIMENT_ERROR_BAD_PARAMS = 1,
+ SW_REPORTER_EXPERIMENT_ERROR_MAX,
+};
+
// Callback for running the software reporter after it is downloaded.
using SwReporterRunner =
base::Callback<void(const safe_browsing::SwReporterInvocation& invocation,
@@ -42,12 +50,10 @@ using SwReporterRunner =
class SwReporterInstallerTraits : public ComponentInstallerTraits {
public:
- explicit SwReporterInstallerTraits(const SwReporterRunner& reporter_runner);
+ SwReporterInstallerTraits(const SwReporterRunner& reporter_runner,
+ bool is_experimental_engine_supported);
~SwReporterInstallerTraits() override;
- private:
- friend class SwReporterInstallerTest;
-
// ComponentInstallerTraits implementation.
bool VerifyInstallation(const base::DictionaryValue& manifest,
const base::FilePath& dir) const override;
@@ -64,7 +70,15 @@ class SwReporterInstallerTraits : public ComponentInstallerTraits {
update_client::InstallerAttributes GetInstallerAttributes() const override;
std::vector<std::string> GetMimeTypes() const override;
+ private:
+ friend class SwReporterInstallerTest;
+
+ // Returns true if the experimental engine is supported and the Feature is
+ // enabled.
+ bool IsExperimentalEngineEnabled() const;
+
SwReporterRunner reporter_runner_;
+ const bool is_experimental_engine_supported_;
DISALLOW_COPY_AND_ASSIGN(SwReporterInstallerTraits);
};

Powered by Google App Engine
This is Rietveld 408576698