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

Unified Diff: components/component_updater/default_configurator.h

Issue 1281913002: Componentize ComponentUpdaterConfigurator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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: components/component_updater/default_configurator.h
diff --git a/components/component_updater/default_configurator.h b/components/component_updater/default_configurator.h
new file mode 100644
index 0000000000000000000000000000000000000000..e4f2820ad0d2face74faa05c89ef0e8b938b5387
--- /dev/null
+++ b/components/component_updater/default_configurator.h
@@ -0,0 +1,56 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_COMPONENT_UPDATER_DEFAULT_CONFIGURATOR_H_
+#define COMPONENTS_COMPONENT_UPDATER_DEFAULT_CONFIGURATOR_H_
+
+#include "components/update_client/configurator.h"
+#include "url/gurl.h"
+
+namespace base {
+class CommandLine;
+}
+
+namespace component_updater {
+
+// Default partial implementation of update_client::Configurator that can be
+// used both on iOS and other platforms.
+class DefaultConfigurator : public update_client::Configurator {
+ public:
+ DefaultConfigurator(const base::CommandLine* cmdline,
+ net::URLRequestContextGetter* url_request_getter);
+
+ int InitialDelay() const override;
+ int NextCheckDelay() const override;
+ int StepDelay() const override;
+ int OnDemandDelay() const override;
+ int UpdateDelay() const override;
+ std::vector<GURL> UpdateUrl() const override;
+ std::vector<GURL> PingUrl() const override;
+ base::Version GetBrowserVersion() const override;
+ std::string GetOSLongName() const override;
+ std::string ExtraRequestParams() const override;
+ net::URLRequestContextGetter* RequestContext() const override;
+ bool DeltasEnabled() const override;
+ bool UseBackgroundDownloader() const override;
+
+ protected:
+ ~DefaultConfigurator() override {}
+
+ private:
+ friend class base::RefCountedThreadSafe<DefaultConfigurator>;
+
+ net::URLRequestContextGetter* url_request_getter_;
+ std::string extra_info_;
+ GURL url_source_override_;
+ bool fast_update_;
+ bool pings_enabled_;
+ bool deltas_enabled_;
+ bool background_downloads_enabled_;
+ bool fallback_to_alt_source_url_enabled_;
+};
+
+} // namespace component_updater
+
+#endif // COMPONENTS_COMPONENT_UPDATER_DEFAULT_CONFIGURATOR_H_

Powered by Google App Engine
This is Rietveld 408576698