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

Side by Side Diff: extensions/browser/extension_registry.cc

Issue 1909773002: Convert //extensions/browser 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
« no previous file with comments | « extensions/browser/extension_registry.h ('k') | extensions/browser/extension_system.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "extensions/browser/extension_registry.h" 5 #include "extensions/browser/extension_registry.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "extensions/browser/extension_registry_factory.h" 8 #include "extensions/browser/extension_registry_factory.h"
9 #include "extensions/browser/extension_registry_observer.h" 9 #include "extensions/browser/extension_registry_observer.h"
10 10
11 namespace extensions { 11 namespace extensions {
12 12
13 ExtensionRegistry::ExtensionRegistry(content::BrowserContext* browser_context) 13 ExtensionRegistry::ExtensionRegistry(content::BrowserContext* browser_context)
14 : browser_context_(browser_context) {} 14 : browser_context_(browser_context) {}
15 ExtensionRegistry::~ExtensionRegistry() {} 15 ExtensionRegistry::~ExtensionRegistry() {}
16 16
17 // static 17 // static
18 ExtensionRegistry* ExtensionRegistry::Get(content::BrowserContext* context) { 18 ExtensionRegistry* ExtensionRegistry::Get(content::BrowserContext* context) {
19 return ExtensionRegistryFactory::GetForBrowserContext(context); 19 return ExtensionRegistryFactory::GetForBrowserContext(context);
20 } 20 }
21 21
22 scoped_ptr<ExtensionSet> ExtensionRegistry::GenerateInstalledExtensionsSet() 22 std::unique_ptr<ExtensionSet>
23 const { 23 ExtensionRegistry::GenerateInstalledExtensionsSet() const {
24 return GenerateInstalledExtensionsSet(EVERYTHING); 24 return GenerateInstalledExtensionsSet(EVERYTHING);
25 } 25 }
26 26
27 scoped_ptr<ExtensionSet> ExtensionRegistry::GenerateInstalledExtensionsSet( 27 std::unique_ptr<ExtensionSet> ExtensionRegistry::GenerateInstalledExtensionsSet(
28 int include_mask) const { 28 int include_mask) const {
29 scoped_ptr<ExtensionSet> installed_extensions(new ExtensionSet); 29 std::unique_ptr<ExtensionSet> installed_extensions(new ExtensionSet);
30 if (include_mask & IncludeFlag::ENABLED) 30 if (include_mask & IncludeFlag::ENABLED)
31 installed_extensions->InsertAll(enabled_extensions_); 31 installed_extensions->InsertAll(enabled_extensions_);
32 if (include_mask & IncludeFlag::DISABLED) 32 if (include_mask & IncludeFlag::DISABLED)
33 installed_extensions->InsertAll(disabled_extensions_); 33 installed_extensions->InsertAll(disabled_extensions_);
34 if (include_mask & IncludeFlag::TERMINATED) 34 if (include_mask & IncludeFlag::TERMINATED)
35 installed_extensions->InsertAll(terminated_extensions_); 35 installed_extensions->InsertAll(terminated_extensions_);
36 if (include_mask & IncludeFlag::BLACKLISTED) 36 if (include_mask & IncludeFlag::BLACKLISTED)
37 installed_extensions->InsertAll(blacklisted_extensions_); 37 installed_extensions->InsertAll(blacklisted_extensions_);
38 if (include_mask & IncludeFlag::BLOCKED) 38 if (include_mask & IncludeFlag::BLOCKED)
39 installed_extensions->InsertAll(blocked_extensions_); 39 installed_extensions->InsertAll(blocked_extensions_);
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 ready_extensions_.Clear(); 208 ready_extensions_.Clear();
209 } 209 }
210 210
211 void ExtensionRegistry::Shutdown() { 211 void ExtensionRegistry::Shutdown() {
212 // Release references to all Extension objects in the sets. 212 // Release references to all Extension objects in the sets.
213 ClearAll(); 213 ClearAll();
214 FOR_EACH_OBSERVER(ExtensionRegistryObserver, observers_, OnShutdown(this)); 214 FOR_EACH_OBSERVER(ExtensionRegistryObserver, observers_, OnShutdown(this));
215 } 215 }
216 216
217 } // namespace extensions 217 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/extension_registry.h ('k') | extensions/browser/extension_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698