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