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

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

Issue 11415216: Make Blacklist::IsBlacklist asynchronous (it will need to be for safe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase past conflict #2 Created 8 years 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_SERVICE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 extensions::Blacklist* blacklist, 204 extensions::Blacklist* blacklist,
205 bool autoupdate_enabled, 205 bool autoupdate_enabled,
206 bool extensions_enabled); 206 bool extensions_enabled);
207 207
208 virtual ~ExtensionService(); 208 virtual ~ExtensionService();
209 209
210 // Gets the list of currently installed extensions. 210 // Gets the list of currently installed extensions.
211 virtual const ExtensionSet* extensions() const OVERRIDE; 211 virtual const ExtensionSet* extensions() const OVERRIDE;
212 virtual const ExtensionSet* disabled_extensions() const OVERRIDE; 212 virtual const ExtensionSet* disabled_extensions() const OVERRIDE;
213 const ExtensionSet* terminated_extensions() const; 213 const ExtensionSet* terminated_extensions() const;
214 const ExtensionSet* blacklisted_extensions() const;
214 215
215 // Returns a set of all installed, disabled, and terminated extensions and 216 // Returns a set of all installed, disabled, and terminated extensions.
216 // transfers ownership to caller. 217 scoped_ptr<const ExtensionSet> GenerateInstalledExtensionsSet() const;
217 const ExtensionSet* GenerateInstalledExtensionsSet() const;
218 218
219 // Returns a set of all extensions disabled by the sideload wipeout 219 // Returns a set of all extensions disabled by the sideload wipeout
220 // initiative. 220 // initiative.
221 const ExtensionSet* GetWipedOutExtensions() const; 221 scoped_ptr<const ExtensionSet> GetWipedOutExtensions() const;
222 222
223 // Gets the object managing the set of pending extensions. 223 // Gets the object managing the set of pending extensions.
224 virtual extensions::PendingExtensionManager* 224 virtual extensions::PendingExtensionManager*
225 pending_extension_manager() OVERRIDE; 225 pending_extension_manager() OVERRIDE;
226 226
227 const FilePath& install_directory() const { return install_directory_; } 227 const FilePath& install_directory() const { return install_directory_; }
228 228
229 extensions::ProcessMap* process_map() { return &process_map_; } 229 extensions::ProcessMap* process_map() { return &process_map_; }
230 230
231 // Whether this extension can run in an incognito window. 231 // Whether this extension can run in an incognito window.
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 bool IsExtensionIdle(const std::string& extension_id) const; 837 bool IsExtensionIdle(const std::string& extension_id) const;
838 838
839 // Helper to determine if updating an extensions should proceed immediately, 839 // Helper to determine if updating an extensions should proceed immediately,
840 // or if we should delay the update until further notice. 840 // or if we should delay the update until further notice.
841 bool ShouldDelayExtensionUpdate(const std::string& extension_id, 841 bool ShouldDelayExtensionUpdate(const std::string& extension_id,
842 bool wait_for_idle) const; 842 bool wait_for_idle) const;
843 843
844 // extensions::Blacklist::Observer implementation. 844 // extensions::Blacklist::Observer implementation.
845 virtual void OnBlacklistUpdated() OVERRIDE; 845 virtual void OnBlacklistUpdated() OVERRIDE;
846 846
847 // Manages the blacklisted extensions, intended as callback from
848 // Blacklist::GetBlacklistedIDs.
849 void ManageBlacklist(const std::set<std::string>& old_blacklisted_ids,
850 const std::set<std::string>& new_blacklisted_ids);
851
847 // The normal profile associated with this ExtensionService. 852 // The normal profile associated with this ExtensionService.
848 Profile* profile_; 853 Profile* profile_;
849 854
850 // The ExtensionSystem for the profile above. 855 // The ExtensionSystem for the profile above.
851 extensions::ExtensionSystem* system_; 856 extensions::ExtensionSystem* system_;
852 857
853 // Preferences for the owning profile (weak reference). 858 // Preferences for the owning profile.
854 extensions::ExtensionPrefs* extension_prefs_; 859 extensions::ExtensionPrefs* extension_prefs_;
855 860
861 // Blacklist for the owning profile.
862 extensions::Blacklist* blacklist_;
863
856 // Settings for the owning profile. 864 // Settings for the owning profile.
857 scoped_ptr<extensions::SettingsFrontend> settings_frontend_; 865 scoped_ptr<extensions::SettingsFrontend> settings_frontend_;
858 866
859 // The current list of installed extensions. 867 // The current list of installed extensions.
860 ExtensionSet extensions_; 868 ExtensionSet extensions_;
861 869
862 // The list of installed extensions that have been disabled. 870 // The list of installed extensions that have been disabled.
863 ExtensionSet disabled_extensions_; 871 ExtensionSet disabled_extensions_;
864 872
865 // The list of installed extensions that have been terminated. 873 // The list of installed extensions that have been terminated.
866 ExtensionSet terminated_extensions_; 874 ExtensionSet terminated_extensions_;
867 875
876 // The list of installed extensions that have been blacklisted. Generally
877 // these shouldn't be considered as installed by the extension platform: we
878 // only keep them around so that if extensions are blacklisted by mistake
879 // they can easily be un-blacklisted.
880 ExtensionSet blacklisted_extensions_;
881
868 // The list of extension updates that are waiting to be installed. 882 // The list of extension updates that are waiting to be installed.
869 ExtensionSet pending_extension_updates_; 883 ExtensionSet pending_extension_updates_;
870 884
871 // Hold the set of pending extensions. 885 // Hold the set of pending extensions.
872 extensions::PendingExtensionManager pending_extension_manager_; 886 extensions::PendingExtensionManager pending_extension_manager_;
873 887
874 // The map of extension IDs to their runtime data. 888 // The map of extension IDs to their runtime data.
875 ExtensionRuntimeDataMap extension_runtime_data_; 889 ExtensionRuntimeDataMap extension_runtime_data_;
876 890
877 // The full path to the directory where extensions are installed. 891 // The full path to the directory where extensions are installed.
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 #endif 1022 #endif
1009 1023
1010 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 1024 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
1011 InstallAppsWithUnlimtedStorage); 1025 InstallAppsWithUnlimtedStorage);
1012 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 1026 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
1013 InstallAppsAndCheckStorageProtection); 1027 InstallAppsAndCheckStorageProtection);
1014 DISALLOW_COPY_AND_ASSIGN(ExtensionService); 1028 DISALLOW_COPY_AND_ASSIGN(ExtensionService);
1015 }; 1029 };
1016 1030
1017 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 1031 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698