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

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

Issue 1066993002: Make DeclarativeUserScriptManager non-shared between profiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make DeclarativeUserScriptManager be a KeyedService. Created 5 years, 8 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_
7 7
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "extensions/browser/extension_system.h" 9 #include "extensions/browser/extension_system.h"
10 #include "extensions/common/one_shot_event.h" 10 #include "extensions/common/one_shot_event.h"
11 11
12 class DeclarativeUserScriptManager;
13 class Profile; 12 class Profile;
14 13
15 namespace extensions { 14 namespace extensions {
16 15
17 class ContentVerifier; 16 class ContentVerifier;
18 class ExtensionSystemSharedFactory; 17 class ExtensionSystemSharedFactory;
19 class NavigationObserver; 18 class NavigationObserver;
20 class SharedUserScriptMaster; 19 class SharedUserScriptMaster;
21 class StateStoreNotificationObserver; 20 class StateStoreNotificationObserver;
22 21
23 // The ExtensionSystem for ProfileImpl and OffTheRecordProfileImpl. 22 // The ExtensionSystem for ProfileImpl and OffTheRecordProfileImpl.
24 // Implementation details: non-shared services are owned by 23 // Implementation details: non-shared services are owned by
25 // ExtensionSystemImpl, a KeyedService with separate incognito 24 // ExtensionSystemImpl, a KeyedService with separate incognito
26 // instances. A private Shared class (also a KeyedService, 25 // instances. A private Shared class (also a KeyedService,
27 // but with a shared instance for incognito) keeps the common services. 26 // but with a shared instance for incognito) keeps the common services.
28 class ExtensionSystemImpl : public ExtensionSystem { 27 class ExtensionSystemImpl : public ExtensionSystem {
29 public: 28 public:
30 explicit ExtensionSystemImpl(Profile* profile); 29 explicit ExtensionSystemImpl(Profile* profile);
31 ~ExtensionSystemImpl() override; 30 ~ExtensionSystemImpl() override;
32 31
33 // KeyedService implementation. 32 // KeyedService implementation.
34 void Shutdown() override; 33 void Shutdown() override;
35 34
36 void InitForRegularProfile(bool extensions_enabled) override; 35 void InitForRegularProfile(bool extensions_enabled) override;
37 36
38 ExtensionService* extension_service() override; // shared 37 ExtensionService* extension_service() override; // shared
39 RuntimeData* runtime_data() override; // shared 38 RuntimeData* runtime_data() override; // shared
40 ManagementPolicy* management_policy() override; // shared 39 ManagementPolicy* management_policy() override; // shared
41 SharedUserScriptMaster* shared_user_script_master() override; // shared 40 SharedUserScriptMaster* shared_user_script_master() override; // shared
42 DeclarativeUserScriptManager* declarative_user_script_manager()
43 override; // shared
44 StateStore* state_store() override; // shared 41 StateStore* state_store() override; // shared
45 StateStore* rules_store() override; // shared 42 StateStore* rules_store() override; // shared
46 LazyBackgroundTaskQueue* lazy_background_task_queue() override; // shared 43 LazyBackgroundTaskQueue* lazy_background_task_queue() override; // shared
47 InfoMap* info_map() override; // shared 44 InfoMap* info_map() override; // shared
48 EventRouter* event_router() override; // shared 45 EventRouter* event_router() override; // shared
49 ErrorConsole* error_console() override; 46 ErrorConsole* error_console() override;
50 InstallVerifier* install_verifier() override; 47 InstallVerifier* install_verifier() override;
51 QuotaService* quota_service() override; // shared 48 QuotaService* quota_service() override; // shared
52 49
53 void RegisterExtensionWithRequestContexts( 50 void RegisterExtensionWithRequestContexts(
(...skipping 26 matching lines...) Expand all
80 77
81 // KeyedService implementation. 78 // KeyedService implementation.
82 void Shutdown() override; 79 void Shutdown() override;
83 80
84 StateStore* state_store(); 81 StateStore* state_store();
85 StateStore* rules_store(); 82 StateStore* rules_store();
86 ExtensionService* extension_service(); 83 ExtensionService* extension_service();
87 RuntimeData* runtime_data(); 84 RuntimeData* runtime_data();
88 ManagementPolicy* management_policy(); 85 ManagementPolicy* management_policy();
89 SharedUserScriptMaster* shared_user_script_master(); 86 SharedUserScriptMaster* shared_user_script_master();
90 DeclarativeUserScriptManager* declarative_user_script_manager();
91 InfoMap* info_map(); 87 InfoMap* info_map();
92 LazyBackgroundTaskQueue* lazy_background_task_queue(); 88 LazyBackgroundTaskQueue* lazy_background_task_queue();
93 EventRouter* event_router(); 89 EventRouter* event_router();
94 ErrorConsole* error_console(); 90 ErrorConsole* error_console();
95 InstallVerifier* install_verifier(); 91 InstallVerifier* install_verifier();
96 QuotaService* quota_service(); 92 QuotaService* quota_service();
97 const OneShotEvent& ready() const { return ready_; } 93 const OneShotEvent& ready() const { return ready_; }
98 ContentVerifier* content_verifier(); 94 ContentVerifier* content_verifier();
99 95
100 private: 96 private:
101 Profile* profile_; 97 Profile* profile_;
102 98
103 // The services that are shared between normal and incognito profiles. 99 // The services that are shared between normal and incognito profiles.
104 100
105 scoped_ptr<StateStore> state_store_; 101 scoped_ptr<StateStore> state_store_;
106 scoped_ptr<StateStoreNotificationObserver> 102 scoped_ptr<StateStoreNotificationObserver>
107 state_store_notification_observer_; 103 state_store_notification_observer_;
108 scoped_ptr<StateStore> rules_store_; 104 scoped_ptr<StateStore> rules_store_;
109 // LazyBackgroundTaskQueue is a dependency of 105 // LazyBackgroundTaskQueue is a dependency of
110 // MessageService and EventRouter. 106 // MessageService and EventRouter.
111 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; 107 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_;
112 scoped_ptr<EventRouter> event_router_; 108 scoped_ptr<EventRouter> event_router_;
113 scoped_ptr<NavigationObserver> navigation_observer_; 109 scoped_ptr<NavigationObserver> navigation_observer_;
114 // Shared memory region manager for scripts statically declared in extension 110 // Shared memory region manager for scripts statically declared in extension
115 // manifests. This region is shared between all extensions. 111 // manifests. This region is shared between all extensions.
116 scoped_ptr<SharedUserScriptMaster> shared_user_script_master_; 112 scoped_ptr<SharedUserScriptMaster> shared_user_script_master_;
117 // Manager of a set of DeclarativeUserScript objects for programmatically
118 // declared scripts.
119 scoped_ptr<DeclarativeUserScriptManager> declarative_user_script_manager_;
120 scoped_ptr<RuntimeData> runtime_data_; 113 scoped_ptr<RuntimeData> runtime_data_;
121 // ExtensionService depends on StateStore, Blacklist and RuntimeData. 114 // ExtensionService depends on StateStore, Blacklist and RuntimeData.
122 scoped_ptr<ExtensionService> extension_service_; 115 scoped_ptr<ExtensionService> extension_service_;
123 scoped_ptr<ManagementPolicy> management_policy_; 116 scoped_ptr<ManagementPolicy> management_policy_;
124 // extension_info_map_ needs to outlive process_manager_. 117 // extension_info_map_ needs to outlive process_manager_.
125 scoped_refptr<InfoMap> extension_info_map_; 118 scoped_refptr<InfoMap> extension_info_map_;
126 scoped_ptr<ErrorConsole> error_console_; 119 scoped_ptr<ErrorConsole> error_console_;
127 scoped_ptr<InstallVerifier> install_verifier_; 120 scoped_ptr<InstallVerifier> install_verifier_;
128 scoped_ptr<QuotaService> quota_service_; 121 scoped_ptr<QuotaService> quota_service_;
129 122
(...skipping 11 matching lines...) Expand all
141 Profile* profile_; 134 Profile* profile_;
142 135
143 Shared* shared_; 136 Shared* shared_;
144 137
145 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); 138 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl);
146 }; 139 };
147 140
148 } // namespace extensions 141 } // namespace extensions
149 142
150 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ 143 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698