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

Side by Side Diff: components/update_client/configurator.h

Issue 2873533002: Prepare to abstract PersistedData by making it part of the configurator.
Patch Set: Rename pref_ to pref_service_. Created 3 years, 6 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 unified diff | Download patch
OLDNEW
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // non on-demand components. 114 // non on-demand components.
114 virtual bool EnabledBackgroundDownloader() const = 0; 115 virtual bool EnabledBackgroundDownloader() const = 0;
115 116
116 // True if signing of update checks is enabled. 117 // True if signing of update checks is enabled.
117 virtual bool EnabledCupSigning() const = 0; 118 virtual bool EnabledCupSigning() const = 0;
118 119
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 // 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 // on.
127 // Returning null is safe and will disable any functionality that requires
128 // persistent storage.
129 virtual PrefService* GetPrefService() const = 0;
130
131 // Returns true if the Chrome is installed for the current user only, or false 124 // 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 125 // 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. 126 // called only from a blocking pool thread, as it may access the file system.
134 virtual bool IsPerUserInstall() const = 0; 127 virtual bool IsPerUserInstall() const = 0;
135 128
129 // Returns a PersistedData object that update_client can use to store
130 // persistent update information. This persisted data depends on a
131 // PrefService, which must outlive the entire update_client.
132 // When this PrefService is null, any functionality requaring persistent
133 // storage will be disabled.
134 virtual std::unique_ptr<PersistedData> CreateMetadata() const = 0;
135
136 protected: 136 protected:
137 friend class base::RefCountedThreadSafe<Configurator>; 137 friend class base::RefCountedThreadSafe<Configurator>;
138 138
139 virtual ~Configurator() {} 139 virtual ~Configurator() {}
140 }; 140 };
141 141
142 } // namespace update_client 142 } // namespace update_client
143 143
144 #endif // COMPONENTS_UPDATE_CLIENT_CONFIGURATOR_H_ 144 #endif // COMPONENTS_UPDATE_CLIENT_CONFIGURATOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/updater/chrome_update_client_config.cc ('k') | components/update_client/test_configurator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698