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

Unified Diff: chrome/browser/extensions/test_extension_system.cc

Issue 1165913002: [Cleanup] Used scoped pointers in KeyedServiceFactory's SetTestingFactory functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finish renaming profile -> context Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/test_extension_system.cc
diff --git a/chrome/browser/extensions/test_extension_system.cc b/chrome/browser/extensions/test_extension_system.cc
index 14835f1c01c36ba0b7316acf87b9fa68f16bebf6..4ba5e9561635f2e8a7333909eaa12e2e6a8d4b5d 100644
--- a/chrome/browser/extensions/test_extension_system.cc
+++ b/chrome/browser/extensions/test_extension_system.cc
@@ -44,7 +44,7 @@ void TestExtensionSystem::Shutdown() {
extension_service_->Shutdown();
}
-ExtensionPrefs* TestExtensionSystem::CreateExtensionPrefs(
+scoped_ptr<ExtensionPrefs> TestExtensionSystem::CreateExtensionPrefs(
const base::CommandLine* command_line,
const base::FilePath& install_directory) {
bool extensions_disabled =
@@ -55,11 +55,11 @@ ExtensionPrefs* TestExtensionSystem::CreateExtensionPrefs(
// are not reflected in the pref service. One would need to
// inject a new ExtensionPrefStore(extension_pref_value_map, false).
- return ExtensionPrefs::Create(
+ return make_scoped_ptr(ExtensionPrefs::Create(
profile_->GetPrefs(), install_directory,
ExtensionPrefValueMapFactory::GetForBrowserContext(profile_),
ExtensionsBrowserClient::Get()->CreateAppSorting().Pass(),
- extensions_disabled, std::vector<ExtensionPrefsObserver*>());
+ extensions_disabled, std::vector<ExtensionPrefsObserver*>()));
}
ExtensionService* TestExtensionSystem::CreateExtensionService(
@@ -137,8 +137,10 @@ scoped_ptr<ExtensionSet> TestExtensionSystem::GetDependentExtensions(
}
// static
-KeyedService* TestExtensionSystem::Build(content::BrowserContext* profile) {
- return new TestExtensionSystem(static_cast<Profile*>(profile));
+scoped_ptr<KeyedService> TestExtensionSystem::Build(
+ content::BrowserContext* profile) {
+ return make_scoped_ptr(
+ new TestExtensionSystem(static_cast<Profile*>(profile)));
}
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/test_extension_system.h ('k') | chrome/browser/history/web_history_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698