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

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

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 (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 <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 bool show_extensions_prompts_ = true; 635 bool show_extensions_prompts_ = true;
636 636
637 // Whether to delay installing of extension updates until the extension is 637 // Whether to delay installing of extension updates until the extension is
638 // idle. 638 // idle.
639 bool install_updates_when_idle_ = true; 639 bool install_updates_when_idle_ = true;
640 640
641 // Signaled when all extensions are loaded. 641 // Signaled when all extensions are loaded.
642 extensions::OneShotEvent* const ready_; 642 extensions::OneShotEvent* const ready_;
643 643
644 // Our extension updater, if updates are turned on. 644 // Our extension updater, if updates are turned on.
645 scoped_ptr<extensions::ExtensionUpdater> updater_; 645 std::unique_ptr<extensions::ExtensionUpdater> updater_;
646 646
647 // Map unloaded extensions' ids to their paths. When a temporarily loaded 647 // Map unloaded extensions' ids to their paths. When a temporarily loaded
648 // extension is unloaded, we lose the information about it and don't have 648 // extension is unloaded, we lose the information about it and don't have
649 // any in the extension preferences file. 649 // any in the extension preferences file.
650 using UnloadedExtensionPathMap = std::map<std::string, base::FilePath>; 650 using UnloadedExtensionPathMap = std::map<std::string, base::FilePath>;
651 UnloadedExtensionPathMap unloaded_extension_paths_; 651 UnloadedExtensionPathMap unloaded_extension_paths_;
652 652
653 // Map of DevToolsAgentHost instances that are detached, 653 // Map of DevToolsAgentHost instances that are detached,
654 // waiting for an extension to be reloaded. 654 // waiting for an extension to be reloaded.
655 using OrphanedDevTools = 655 using OrphanedDevTools =
656 std::map<std::string, scoped_refptr<content::DevToolsAgentHost>>; 656 std::map<std::string, scoped_refptr<content::DevToolsAgentHost>>;
657 OrphanedDevTools orphaned_dev_tools_; 657 OrphanedDevTools orphaned_dev_tools_;
658 658
659 content::NotificationRegistrar registrar_; 659 content::NotificationRegistrar registrar_;
660 660
661 // Keeps track of loading and unloading component extensions. 661 // Keeps track of loading and unloading component extensions.
662 scoped_ptr<extensions::ComponentLoader> component_loader_; 662 std::unique_ptr<extensions::ComponentLoader> component_loader_;
663 663
664 // A collection of external extension providers. Each provider reads 664 // A collection of external extension providers. Each provider reads
665 // a source of external extension information. Examples include the 665 // a source of external extension information. Examples include the
666 // windows registry and external_extensions.json. 666 // windows registry and external_extensions.json.
667 extensions::ProviderCollection external_extension_providers_; 667 extensions::ProviderCollection external_extension_providers_;
668 668
669 // Set to true by OnExternalExtensionUpdateUrlFound() when an external 669 // Set to true by OnExternalExtensionUpdateUrlFound() when an external
670 // extension URL is found, and by CheckForUpdatesSoon() when an update check 670 // extension URL is found, and by CheckForUpdatesSoon() when an update check
671 // has to wait for the external providers. Used in 671 // has to wait for the external providers. Used in
672 // OnAllExternalProvidersReady() to determine if an update check is needed to 672 // OnAllExternalProvidersReady() to determine if an update check is needed to
(...skipping 27 matching lines...) Expand all
700 // Store the ids of reloading extensions. We use this to re-enable extensions 700 // Store the ids of reloading extensions. We use this to re-enable extensions
701 // which were disabled for a reload. 701 // which were disabled for a reload.
702 std::set<std::string> reloading_extensions_; 702 std::set<std::string> reloading_extensions_;
703 703
704 // A set of the extension ids currently being terminated. We use this to 704 // A set of the extension ids currently being terminated. We use this to
705 // avoid trying to unload the same extension twice. 705 // avoid trying to unload the same extension twice.
706 std::set<std::string> extensions_being_terminated_; 706 std::set<std::string> extensions_being_terminated_;
707 707
708 // The controller for the UI that alerts the user about any blacklisted 708 // The controller for the UI that alerts the user about any blacklisted
709 // extensions. 709 // extensions.
710 scoped_ptr<extensions::ExtensionErrorController> error_controller_; 710 std::unique_ptr<extensions::ExtensionErrorController> error_controller_;
711 711
712 // The manager for extensions that were externally installed that is 712 // The manager for extensions that were externally installed that is
713 // responsible for prompting the user about suspicious extensions. 713 // responsible for prompting the user about suspicious extensions.
714 scoped_ptr<extensions::ExternalInstallManager> external_install_manager_; 714 std::unique_ptr<extensions::ExternalInstallManager> external_install_manager_;
715 715
716 // Sequenced task runner for extension related file operations. 716 // Sequenced task runner for extension related file operations.
717 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; 717 scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
718 718
719 scoped_ptr<extensions::ExtensionActionStorageManager> 719 std::unique_ptr<extensions::ExtensionActionStorageManager>
720 extension_action_storage_manager_; 720 extension_action_storage_manager_;
721 721
722 // The SharedModuleService used to check for import dependencies. 722 // The SharedModuleService used to check for import dependencies.
723 scoped_ptr<extensions::SharedModuleService> shared_module_service_; 723 std::unique_ptr<extensions::SharedModuleService> shared_module_service_;
724 724
725 base::ObserverList<extensions::UpdateObserver, true> update_observers_; 725 base::ObserverList<extensions::UpdateObserver, true> update_observers_;
726 726
727 // Migrates app data when upgrading a legacy packaged app to a platform app 727 // Migrates app data when upgrading a legacy packaged app to a platform app
728 scoped_ptr<extensions::AppDataMigrator> app_data_migrator_; 728 std::unique_ptr<extensions::AppDataMigrator> app_data_migrator_;
729 729
730 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 730 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
731 DestroyingProfileClearsExtensions); 731 DestroyingProfileClearsExtensions);
732 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, SetUnsetBlacklistInPrefs); 732 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, SetUnsetBlacklistInPrefs);
733 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 733 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
734 BlacklistedExtensionWillNotInstall); 734 BlacklistedExtensionWillNotInstall);
735 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 735 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
736 UnloadBlacklistedExtensionPolicy); 736 UnloadBlacklistedExtensionPolicy);
737 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 737 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
738 WillNotLoadBlacklistedExtensionsFromDirectory); 738 WillNotLoadBlacklistedExtensionsFromDirectory);
739 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, ReloadBlacklistedExtension); 739 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, ReloadBlacklistedExtension);
740 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, BlacklistedInPrefsFromStartup); 740 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, BlacklistedInPrefsFromStartup);
741 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 741 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
742 GreylistedExtensionDisabled); 742 GreylistedExtensionDisabled);
743 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 743 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
744 GreylistDontEnableManuallyDisabled); 744 GreylistDontEnableManuallyDisabled);
745 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 745 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
746 GreylistUnknownDontChange); 746 GreylistUnknownDontChange);
747 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 747 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
748 ManagementPolicyProhibitsEnableOnInstalled); 748 ManagementPolicyProhibitsEnableOnInstalled);
749 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 749 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
750 BlockAndUnblockBlacklistedExtension); 750 BlockAndUnblockBlacklistedExtension);
751 751
752 DISALLOW_COPY_AND_ASSIGN(ExtensionService); 752 DISALLOW_COPY_AND_ASSIGN(ExtensionService);
753 }; 753 };
754 754
755 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 755 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698