OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_UPDATE_CLIENT_CONFIGURATOR_H_ | 5 #ifndef COMPONENTS_UPDATE_CLIENT_CONFIGURATOR_H_ |
6 #define COMPONENTS_UPDATE_CLIENT_CONFIGURATOR_H_ | 6 #define COMPONENTS_UPDATE_CLIENT_CONFIGURATOR_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 | 13 |
14 class GURL; | 14 class GURL; |
15 class PrefService; | 15 class PrefService; |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class SequencedTaskRunner; | 18 class SequencedTaskRunner; |
19 class Version; | 19 class Version; |
20 } | 20 } |
21 | 21 |
22 namespace net { | 22 namespace net { |
23 class URLRequestContextGetter; | 23 class URLRequestContextGetter; |
24 } | 24 } |
25 | 25 |
26 namespace update_client { | 26 namespace update_client { |
27 | 27 |
28 class OutOfProcessPatcher; | 28 class OutOfProcessPatcher; |
29 class PersistedData; | |
29 | 30 |
30 // Controls the component updater behavior. | 31 // Controls the component updater behavior. |
31 // TODO(sorin): this class will be split soon in two. One class controls | 32 // TODO(sorin): this class will be split soon in two. One class controls |
32 // the behavior of the update client, and the other class controls the | 33 // the behavior of the update client, and the other class controls the |
33 // behavior of the component updater. | 34 // behavior of the component updater. |
34 class Configurator : public base::RefCountedThreadSafe<Configurator> { | 35 class Configurator : public base::RefCountedThreadSafe<Configurator> { |
35 public: | 36 public: |
36 // Delay in seconds from calling Start() to the first update check. | 37 // Delay in seconds from calling Start() to the first update check. |
37 virtual int InitialDelay() const = 0; | 38 virtual int InitialDelay() const = 0; |
38 | 39 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 // Gets a task runner to a blocking pool of threads suitable for worker jobs. | 120 // Gets a task runner to a blocking pool of threads suitable for worker jobs. |
120 virtual scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() | 121 virtual scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() |
121 const = 0; | 122 const = 0; |
122 | 123 |
123 // Returns a PrefService that the update_client can use to store persistent | 124 // Returns a PrefService that the update_client can use to store persistent |
124 // update information. The PrefService must outlive the entire update_client, | 125 // update information. The PrefService must outlive the entire update_client, |
125 // and be safe to access from the thread the update_client is constructed | 126 // and be safe to access from the thread the update_client is constructed |
126 // on. | 127 // on. |
127 // Returning null is safe and will disable any functionality that requires | 128 // Returning null is safe and will disable any functionality that requires |
128 // persistent storage. | 129 // persistent storage. |
129 virtual PrefService* GetPrefService() const = 0; | 130 virtual PrefService* GetPrefService() const = 0; |
Devlin
2017/05/16 23:03:09
A quick codesearch indicates that this is only use
Minh X. Nguyen
2017/06/01 21:04:19
Done.
| |
130 | 131 |
131 // Returns true if the Chrome is installed for the current user only, or false | 132 // Returns true if the Chrome is installed for the current user only, or false |
132 // if Chrome is installed for all users on the machine. This function must be | 133 // if Chrome is installed for all users on the machine. This function must be |
133 // called only from a blocking pool thread, as it may access the file system. | 134 // called only from a blocking pool thread, as it may access the file system. |
134 virtual bool IsPerUserInstall() const = 0; | 135 virtual bool IsPerUserInstall() const = 0; |
135 | 136 |
137 // Returns a PersistedData object that update_client can use to store | |
138 // persistent update information. | |
139 virtual std::unique_ptr<PersistedData> CreateMetadata() const = 0; | |
140 | |
136 protected: | 141 protected: |
137 friend class base::RefCountedThreadSafe<Configurator>; | 142 friend class base::RefCountedThreadSafe<Configurator>; |
138 | 143 |
139 virtual ~Configurator() {} | 144 virtual ~Configurator() {} |
140 }; | 145 }; |
141 | 146 |
142 } // namespace update_client | 147 } // namespace update_client |
143 | 148 |
144 #endif // COMPONENTS_UPDATE_CLIENT_CONFIGURATOR_H_ | 149 #endif // COMPONENTS_UPDATE_CLIENT_CONFIGURATOR_H_ |
OLD | NEW |