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

Side by Side Diff: trunk/src/chrome/browser/extensions/user_script_master.h

Issue 307933008: Revert 273866 "Block content scripts from executing until user g..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 | 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_USER_SCRIPT_MASTER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_
6 #define CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 const content::NotificationDetails& details) OVERRIDE; 142 const content::NotificationDetails& details) OVERRIDE;
143 143
144 // ExtensionRegistryObserver implementation. 144 // ExtensionRegistryObserver implementation.
145 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, 145 virtual void OnExtensionLoaded(content::BrowserContext* browser_context,
146 const Extension* extension) OVERRIDE; 146 const Extension* extension) OVERRIDE;
147 virtual void OnExtensionUnloaded( 147 virtual void OnExtensionUnloaded(
148 content::BrowserContext* browser_context, 148 content::BrowserContext* browser_context,
149 const Extension* extension, 149 const Extension* extension,
150 UnloadedExtensionInfo::Reason reason) OVERRIDE; 150 UnloadedExtensionInfo::Reason reason) OVERRIDE;
151 151
152 // Sends the renderer process a new set of user scripts. If 152 // Sends the renderer process a new set of user scripts.
153 // |changed_extensions| is not empty, this signals that only the scripts from
154 // those extensions should be updated. Otherwise, all extensions will be
155 // updated.
156 void SendUpdate(content::RenderProcessHost* process, 153 void SendUpdate(content::RenderProcessHost* process,
157 base::SharedMemory* shared_memory, 154 base::SharedMemory* shared_memory);
158 const std::set<std::string>& changed_extensions);
159 155
160 // Manages our notification registrations. 156 // Manages our notification registrations.
161 content::NotificationRegistrar registrar_; 157 content::NotificationRegistrar registrar_;
162 158
163 // We hang on to our pointer to know if we've already got one running. 159 // We hang on to our pointer to know if we've already got one running.
164 scoped_refptr<ScriptReloader> script_reloader_; 160 scoped_refptr<ScriptReloader> script_reloader_;
165 161
166 // Contains the scripts that were found the last time scripts were updated. 162 // Contains the scripts that were found the last time scripts were updated.
167 scoped_ptr<base::SharedMemory> shared_memory_; 163 scoped_ptr<base::SharedMemory> shared_memory_;
168 164
169 // List of scripts from currently-installed extensions we should load. 165 // List of scripts from currently-installed extensions we should load.
170 UserScriptList user_scripts_; 166 UserScriptList user_scripts_;
171 167
172 // Maps extension info needed for localization to an extension ID. 168 // Maps extension info needed for localization to an extension ID.
173 ExtensionsInfo extensions_info_; 169 ExtensionsInfo extensions_info_;
174 170
175 // The IDs of the extensions which have changed since the last update sent to
176 // the renderer.
177 std::set<std::string> changed_extensions_;
178
179 // If the extensions service has finished loading its initial set of 171 // If the extensions service has finished loading its initial set of
180 // extensions. 172 // extensions.
181 bool extensions_service_ready_; 173 bool extensions_service_ready_;
182 174
183 // If list of user scripts is modified while we're loading it, we note 175 // If list of user scripts is modified while we're loading it, we note
184 // that we're currently mid-load and then start over again once the load 176 // that we're currently mid-load and then start over again once the load
185 // finishes. This boolean tracks whether another load is pending. 177 // finishes. This boolean tracks whether another load is pending.
186 bool pending_load_; 178 bool pending_load_;
187 179
188 // The profile for which the scripts managed here are installed. 180 // The profile for which the scripts managed here are installed.
189 Profile* profile_; 181 Profile* profile_;
190 182
191 // Listen to extension load, unloaded notifications. 183 // Listen to extension load, unloaded notifications.
192 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> 184 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
193 extension_registry_observer_; 185 extension_registry_observer_;
194 186
195 DISALLOW_COPY_AND_ASSIGN(UserScriptMaster); 187 DISALLOW_COPY_AND_ASSIGN(UserScriptMaster);
196 }; 188 };
197 189
198 } // namespace extensions 190 } // namespace extensions
199 191
200 #endif // CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_ 192 #endif // CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698