Chromium Code Reviews| Index: components/component_updater/configurator_impl.h |
| diff --git a/components/component_updater/configurator_impl.h b/components/component_updater/configurator_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b281622d53761fea13062d1fec5a0f8c8cd7edff |
| --- /dev/null |
| +++ b/components/component_updater/configurator_impl.h |
| @@ -0,0 +1,95 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
|
Sorin Jianu
2015/08/12 02:27:51
2015
droger
2015/08/12 08:43:41
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_COMPONENT_UPDATER_CONFIGURATOR_IMPL_H_ |
| +#define COMPONENTS_COMPONENT_UPDATER_CONFIGURATOR_IMPL_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/macros.h" |
| +#include "base/version.h" |
|
Sorin Jianu
2015/08/12 02:27:51
technically, a forward decl for base::Version is s
droger
2015/08/12 08:43:41
base::Version is used as a return type on line 60,
Sorin Jianu
2015/08/12 17:16:55
The idea is that types that are used for parameter
droger
2015/08/13 11:27:35
Ok, done.
|
| +#include "url/gurl.h" |
| + |
| +namespace base { |
| +class CommandLine; |
| +} |
| + |
| +namespace net { |
| +class URLRequestContextGetter; |
| +} |
| + |
| +namespace component_updater { |
| + |
| +// Helper class for the implementations of update_client::Configurator. |
| +// Can be used both on iOS and other platforms. |
| +class ConfiguratorImpl { |
| + public: |
| + ConfiguratorImpl(const base::CommandLine* cmdline, |
| + net::URLRequestContextGetter* url_request_getter); |
| + |
| + ~ConfiguratorImpl(); |
| + |
| + // Delay in seconds from calling Start() to the first update check. |
| + int InitialDelay() const; |
| + |
| + // Delay in seconds to every subsequent update check. 0 means don't check. |
| + int NextCheckDelay() const; |
| + |
| + // Delay in seconds from each task step. Used to smooth out CPU/IO usage. |
| + int StepDelay() const; |
| + |
| + // Minimum delta time in seconds before an on-demand check is allowed for the |
| + // same component. |
| + int OnDemandDelay() const; |
| + |
| + // The time delay in seconds between applying updates for different |
| + // components. |
| + int UpdateDelay() const; |
| + |
| + // The URLs for the update checks. The URLs are tried in order, the first one |
| + // that succeeds wins. |
| + std::vector<GURL> UpdateUrl() const; |
| + |
| + // The URLs for pings. Returns an empty vector if and only if pings are |
| + // disabled. Similarly, these URLs have a fall back behavior too. |
| + std::vector<GURL> PingUrl() const; |
| + |
| + // Version of the application. Used to compare the component manifests. |
| + base::Version GetBrowserVersion() const; |
| + |
| + // Returns the OS's long name like "Windows", "Mac OS X", etc. |
| + std::string GetOSLongName() const; |
| + |
| + // Parameters added to each url request. It can be empty if none are needed. |
| + // The return string must be safe for insertion as an attribute in an |
| + // XML element. |
| + std::string ExtraRequestParams() const; |
| + |
| + // The source of contexts for all the url requests. |
| + net::URLRequestContextGetter* RequestContext() const; |
| + |
| + // True means that this client can handle delta updates. |
| + bool DeltasEnabled() const; |
| + |
| + // True means that the background downloader can be used for downloading |
| + // non on-demand components. |
| + bool UseBackgroundDownloader() const; |
| + |
| + private: |
| + 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_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ConfiguratorImpl); |
| +}; |
| + |
| +} // namespace component_updater |
| + |
| +#endif // COMPONENTS_COMPONENT_UPDATER_CONFIGURATOR_IMPL_H_ |