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

Side by Side Diff: chrome/browser/extensions/extension_system.h

Issue 131743021: app_shell: Extract extension runtime data from ExtensionService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: TriggerOnUnloaded (runtime_data) Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_EXTENSIONS_EXTENSION_SYSTEM_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_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"
(...skipping 22 matching lines...) Expand all
33 class Extension; 33 class Extension;
34 class ExtensionSystemSharedFactory; 34 class ExtensionSystemSharedFactory;
35 class ExtensionWarningBadgeService; 35 class ExtensionWarningBadgeService;
36 class ExtensionWarningService; 36 class ExtensionWarningService;
37 class InfoMap; 37 class InfoMap;
38 class InstallVerifier; 38 class InstallVerifier;
39 class LazyBackgroundTaskQueue; 39 class LazyBackgroundTaskQueue;
40 class ManagementPolicy; 40 class ManagementPolicy;
41 class NavigationObserver; 41 class NavigationObserver;
42 class ProcessManager; 42 class ProcessManager;
43 class RuntimeData;
43 class StandardManagementPolicyProvider; 44 class StandardManagementPolicyProvider;
44 class StateStore; 45 class StateStore;
45 class UserScriptMaster; 46 class UserScriptMaster;
46 47
47 // The ExtensionSystem manages the creation and destruction of services 48 // The ExtensionSystem manages the creation and destruction of services
48 // related to extensions. Most objects are shared between normal 49 // related to extensions. Most objects are shared between normal
49 // and incognito Profiles, except as called out in comments. 50 // and incognito Profiles, except as called out in comments.
50 // This interface supports using TestExtensionSystem for TestingProfiles 51 // This interface supports using TestExtensionSystem for TestingProfiles
51 // that don't want all of the extensions baggage in their tests. 52 // that don't want all of the extensions baggage in their tests.
52 class ExtensionSystem : public BrowserContextKeyedService { 53 class ExtensionSystem : public BrowserContextKeyedService {
(...skipping 13 matching lines...) Expand all
66 virtual void Shutdown() OVERRIDE {} 67 virtual void Shutdown() OVERRIDE {}
67 68
68 // Initializes extensions machinery. 69 // Initializes extensions machinery.
69 // Component extensions are always enabled, external and user extensions are 70 // Component extensions are always enabled, external and user extensions are
70 // controlled by |extensions_enabled|. 71 // controlled by |extensions_enabled|.
71 virtual void InitForRegularProfile(bool extensions_enabled) = 0; 72 virtual void InitForRegularProfile(bool extensions_enabled) = 0;
72 73
73 // The ExtensionService is created at startup. 74 // The ExtensionService is created at startup.
74 virtual ExtensionService* extension_service() = 0; 75 virtual ExtensionService* extension_service() = 0;
75 76
77 // Per-extension data that can change during the life of the process but
78 // does not persist across restarts. Lives on UI thread. Created at startup.
79 virtual RuntimeData* runtime_data() = 0;
80
76 // The class controlling whether users are permitted to perform certain 81 // The class controlling whether users are permitted to perform certain
77 // actions on extensions (install, uninstall, disable, etc.). 82 // actions on extensions (install, uninstall, disable, etc.).
78 // The ManagementPolicy is created at startup. 83 // The ManagementPolicy is created at startup.
79 virtual ManagementPolicy* management_policy() = 0; 84 virtual ManagementPolicy* management_policy() = 0;
80 85
81 // The UserScriptMaster is created at startup. 86 // The UserScriptMaster is created at startup.
82 virtual UserScriptMaster* user_script_master() = 0; 87 virtual UserScriptMaster* user_script_master() = 0;
83 88
84 // The ProcessManager is created at startup. 89 // The ProcessManager is created at startup.
85 virtual ProcessManager* process_manager() = 0; 90 virtual ProcessManager* process_manager() = 0;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 public: 144 public:
140 explicit ExtensionSystemImpl(Profile* profile); 145 explicit ExtensionSystemImpl(Profile* profile);
141 virtual ~ExtensionSystemImpl(); 146 virtual ~ExtensionSystemImpl();
142 147
143 // BrowserContextKeyedService implementation. 148 // BrowserContextKeyedService implementation.
144 virtual void Shutdown() OVERRIDE; 149 virtual void Shutdown() OVERRIDE;
145 150
146 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE; 151 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE;
147 152
148 virtual ExtensionService* extension_service() OVERRIDE; // shared 153 virtual ExtensionService* extension_service() OVERRIDE; // shared
154 virtual RuntimeData* runtime_data() OVERRIDE; // shared
149 virtual ManagementPolicy* management_policy() OVERRIDE; // shared 155 virtual ManagementPolicy* management_policy() OVERRIDE; // shared
150 virtual UserScriptMaster* user_script_master() OVERRIDE; // shared 156 virtual UserScriptMaster* user_script_master() OVERRIDE; // shared
151 virtual ProcessManager* process_manager() OVERRIDE; 157 virtual ProcessManager* process_manager() OVERRIDE;
152 virtual StateStore* state_store() OVERRIDE; // shared 158 virtual StateStore* state_store() OVERRIDE; // shared
153 virtual StateStore* rules_store() OVERRIDE; // shared 159 virtual StateStore* rules_store() OVERRIDE; // shared
154 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() 160 virtual LazyBackgroundTaskQueue* lazy_background_task_queue()
155 OVERRIDE; // shared 161 OVERRIDE; // shared
156 virtual InfoMap* info_map() OVERRIDE; // shared 162 virtual InfoMap* info_map() OVERRIDE; // shared
157 virtual EventRouter* event_router() OVERRIDE; // shared 163 virtual EventRouter* event_router() OVERRIDE; // shared
158 virtual ExtensionWarningService* warning_service() OVERRIDE; 164 virtual ExtensionWarningService* warning_service() OVERRIDE;
(...skipping 25 matching lines...) Expand all
184 // This must not be called until all the providers have been created. 190 // This must not be called until all the providers have been created.
185 void RegisterManagementPolicyProviders(); 191 void RegisterManagementPolicyProviders();
186 void Init(bool extensions_enabled); 192 void Init(bool extensions_enabled);
187 193
188 // BrowserContextKeyedService implementation. 194 // BrowserContextKeyedService implementation.
189 virtual void Shutdown() OVERRIDE; 195 virtual void Shutdown() OVERRIDE;
190 196
191 StateStore* state_store(); 197 StateStore* state_store();
192 StateStore* rules_store(); 198 StateStore* rules_store();
193 ExtensionService* extension_service(); 199 ExtensionService* extension_service();
200 RuntimeData* runtime_data();
194 ManagementPolicy* management_policy(); 201 ManagementPolicy* management_policy();
195 UserScriptMaster* user_script_master(); 202 UserScriptMaster* user_script_master();
196 Blacklist* blacklist(); 203 Blacklist* blacklist();
197 InfoMap* info_map(); 204 InfoMap* info_map();
198 LazyBackgroundTaskQueue* lazy_background_task_queue(); 205 LazyBackgroundTaskQueue* lazy_background_task_queue();
199 EventRouter* event_router(); 206 EventRouter* event_router();
200 ExtensionWarningService* warning_service(); 207 ExtensionWarningService* warning_service();
201 ErrorConsole* error_console(); 208 ErrorConsole* error_console();
202 InstallVerifier* install_verifier(); 209 InstallVerifier* install_verifier();
203 const OneShotEvent& ready() const { return ready_; } 210 const OneShotEvent& ready() const { return ready_; }
204 211
205 private: 212 private:
206 Profile* profile_; 213 Profile* profile_;
207 214
208 // The services that are shared between normal and incognito profiles. 215 // The services that are shared between normal and incognito profiles.
209 216
210 scoped_ptr<StateStore> state_store_; 217 scoped_ptr<StateStore> state_store_;
211 scoped_ptr<StateStore> rules_store_; 218 scoped_ptr<StateStore> rules_store_;
212 // LazyBackgroundTaskQueue is a dependency of 219 // LazyBackgroundTaskQueue is a dependency of
213 // MessageService and EventRouter. 220 // MessageService and EventRouter.
214 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; 221 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_;
215 scoped_ptr<EventRouter> event_router_; 222 scoped_ptr<EventRouter> event_router_;
216 scoped_ptr<NavigationObserver> navigation_observer_; 223 scoped_ptr<NavigationObserver> navigation_observer_;
217 scoped_refptr<UserScriptMaster> user_script_master_; 224 scoped_refptr<UserScriptMaster> user_script_master_;
218 scoped_ptr<Blacklist> blacklist_; 225 scoped_ptr<Blacklist> blacklist_;
219 // StandardManagementPolicyProvider depends on Blacklist. 226 // StandardManagementPolicyProvider depends on Blacklist.
220 scoped_ptr<StandardManagementPolicyProvider> 227 scoped_ptr<StandardManagementPolicyProvider>
221 standard_management_policy_provider_; 228 standard_management_policy_provider_;
222 // ExtensionService depends on StateStore and Blacklist. 229 scoped_ptr<RuntimeData> runtime_data_;
230 // ExtensionService depends on StateStore, Blacklist and RuntimeData.
223 scoped_ptr<ExtensionService> extension_service_; 231 scoped_ptr<ExtensionService> extension_service_;
224 scoped_ptr<ManagementPolicy> management_policy_; 232 scoped_ptr<ManagementPolicy> management_policy_;
225 // extension_info_map_ needs to outlive process_manager_. 233 // extension_info_map_ needs to outlive process_manager_.
226 scoped_refptr<InfoMap> extension_info_map_; 234 scoped_refptr<InfoMap> extension_info_map_;
227 scoped_ptr<ExtensionWarningService> extension_warning_service_; 235 scoped_ptr<ExtensionWarningService> extension_warning_service_;
228 scoped_ptr<ExtensionWarningBadgeService> extension_warning_badge_service_; 236 scoped_ptr<ExtensionWarningBadgeService> extension_warning_badge_service_;
229 scoped_ptr<ErrorConsole> error_console_; 237 scoped_ptr<ErrorConsole> error_console_;
230 scoped_ptr<InstallVerifier> install_verifier_; 238 scoped_ptr<InstallVerifier> install_verifier_;
231 239
232 #if defined(OS_CHROMEOS) 240 #if defined(OS_CHROMEOS)
(...skipping 13 matching lines...) Expand all
246 // extension processes and those require access to the ResourceContext owned 254 // extension processes and those require access to the ResourceContext owned
247 // by |io_data_|. 255 // by |io_data_|.
248 scoped_ptr<ProcessManager> process_manager_; 256 scoped_ptr<ProcessManager> process_manager_;
249 257
250 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); 258 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl);
251 }; 259 };
252 260
253 } // namespace extensions 261 } // namespace extensions
254 262
255 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ 263 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698