OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_COMPONENT_UPDATER_COMPONENT_UPDATER_CONFIGURATOR_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_CONFIGURATOR_H_ |
6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_CONFIGURATOR_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_CONFIGURATOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 | 11 |
12 class GURL; | 12 class GURL; |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class CommandLine; | 15 class CommandLine; |
16 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
17 class SequencedTaskRunner; | 17 class SequencedTaskRunner; |
18 class Version; | 18 class Version; |
19 } | 19 } |
20 | 20 |
21 namespace net { | 21 namespace net { |
22 class URLRequestContextGetter; | 22 class URLRequestContextGetter; |
23 } | 23 } |
24 | 24 |
25 namespace component_updater { | 25 namespace component_updater { |
26 | 26 |
| 27 class DeltaUpdateOpFactory; |
| 28 |
27 // Controls the component updater behavior. | 29 // Controls the component updater behavior. |
28 class Configurator { | 30 class Configurator { |
29 public: | 31 public: |
30 virtual ~Configurator() {} | 32 virtual ~Configurator() {} |
31 | 33 |
32 // Delay in seconds from calling Start() to the first update check. | 34 // Delay in seconds from calling Start() to the first update check. |
33 virtual int InitialDelay() const = 0; | 35 virtual int InitialDelay() const = 0; |
34 | 36 |
35 // Delay in seconds to every subsequent update check. 0 means don't check. | 37 // Delay in seconds to every subsequent update check. 0 means don't check. |
36 // This function is a mutator for testing purposes. | 38 // This function is a mutator for testing purposes. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // The return string must be safe for insertion as an attribute in an | 79 // The return string must be safe for insertion as an attribute in an |
78 // XML element. | 80 // XML element. |
79 virtual std::string ExtraRequestParams() const = 0; | 81 virtual std::string ExtraRequestParams() const = 0; |
80 | 82 |
81 // How big each update request can be. Don't go above 2000. | 83 // How big each update request can be. Don't go above 2000. |
82 virtual size_t UrlSizeLimit() const = 0; | 84 virtual size_t UrlSizeLimit() const = 0; |
83 | 85 |
84 // The source of contexts for all the url requests. | 86 // The source of contexts for all the url requests. |
85 virtual net::URLRequestContextGetter* RequestContext() const = 0; | 87 virtual net::URLRequestContextGetter* RequestContext() const = 0; |
86 | 88 |
87 // True means that all ops are performed in this process. | 89 // Returns a new DeltaUpdateOpFactory. May be in-process or out-of-process, |
88 virtual bool InProcess() const = 0; | 90 // depending on implementation. |
| 91 virtual DeltaUpdateOpFactory* CreateDeltaUpdateOpFactory() const = 0; |
89 | 92 |
90 // True means that this client can handle delta updates. | 93 // True means that this client can handle delta updates. |
91 virtual bool DeltasEnabled() const = 0; | 94 virtual bool DeltasEnabled() const = 0; |
92 | 95 |
93 // True means that the background downloader can be used for downloading | 96 // True means that the background downloader can be used for downloading |
94 // non on-demand components. | 97 // non on-demand components. |
95 virtual bool UseBackgroundDownloader() const = 0; | 98 virtual bool UseBackgroundDownloader() const = 0; |
96 | 99 |
97 // Gets a task runner to a blocking pool of threads suitable for worker jobs. | 100 // Gets a task runner to a blocking pool of threads suitable for worker jobs. |
98 virtual scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() | 101 virtual scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() |
99 const = 0; | 102 const = 0; |
100 | 103 |
101 // Gets a task runner for worker jobs guaranteed to run on a single thread. | 104 // Gets a task runner for worker jobs guaranteed to run on a single thread. |
102 // This thread must be capable of IO. On Windows, this thread must be | 105 // This thread must be capable of IO. On Windows, this thread must be |
103 // initialized for use of COM objects. | 106 // initialized for use of COM objects. |
104 virtual scoped_refptr<base::SingleThreadTaskRunner> | 107 virtual scoped_refptr<base::SingleThreadTaskRunner> |
105 GetSingleThreadTaskRunner() const = 0; | 108 GetSingleThreadTaskRunner() const = 0; |
106 }; | 109 }; |
107 | 110 |
108 Configurator* MakeChromeComponentUpdaterConfigurator( | 111 Configurator* MakeChromeComponentUpdaterConfigurator( |
109 const base::CommandLine* cmdline, | 112 const base::CommandLine* cmdline, |
110 net::URLRequestContextGetter* context_getter); | 113 net::URLRequestContextGetter* context_getter); |
111 | 114 |
112 } // namespace component_updater | 115 } // namespace component_updater |
113 | 116 |
114 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_CONFIGURATOR_H_ | 117 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_CONFIGURATOR_H_ |
OLD | NEW |