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

Unified Diff: chrome/browser/extensions/api/content_settings/content_settings_store.cc

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: Rebase and fix header 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/content_settings/content_settings_store.cc
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_store.cc b/chrome/browser/extensions/api/content_settings/content_settings_store.cc
index ee4a2ccd7dae07d2c0dad4133ed7f64e34efcc20..765636dbf9ec3793ae39732d508de8bc37c38e5a 100644
--- a/chrome/browser/extensions/api/content_settings/content_settings_store.cc
+++ b/chrome/browser/extensions/api/content_settings/content_settings_store.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/extensions/api/content_settings/content_settings_store.h"
+#include <memory>
#include <set>
#include <utility>
#include <vector>
#include "base/debug/alias.h"
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/values.h"
@@ -55,18 +55,18 @@ ContentSettingsStore::~ContentSettingsStore() {
STLDeleteValues(&entries_);
}
-scoped_ptr<RuleIterator> ContentSettingsStore::GetRuleIterator(
+std::unique_ptr<RuleIterator> ContentSettingsStore::GetRuleIterator(
ContentSettingsType type,
const content_settings::ResourceIdentifier& identifier,
bool incognito) const {
- std::vector<scoped_ptr<RuleIterator>> iterators;
+ std::vector<std::unique_ptr<RuleIterator>> iterators;
// Iterate the extensions based on install time (last installed extensions
// first).
ExtensionEntryMap::const_reverse_iterator entry;
// The individual |RuleIterators| shouldn't lock; pass |lock_| to the
// |ConcatenationIterator| in a locked state.
- scoped_ptr<base::AutoLock> auto_lock(new base::AutoLock(lock_));
+ std::unique_ptr<base::AutoLock> auto_lock(new base::AutoLock(lock_));
for (entry = entries_.rbegin(); entry != entries_.rend(); ++entry) {
if (!entry->second->enabled)
@@ -88,7 +88,7 @@ scoped_ptr<RuleIterator> ContentSettingsStore::GetRuleIterator(
entry->second->settings.GetRuleIterator(type, identifier, NULL));
}
}
- return scoped_ptr<RuleIterator>(
+ return std::unique_ptr<RuleIterator>(
new ConcatenationIterator(std::move(iterators), auto_lock.release()));
}
@@ -255,10 +255,9 @@ base::ListValue* ContentSettingsStore::GetSettingsForExtension(
base::ListValue* settings = new base::ListValue();
OriginIdentifierValueMap::EntryMap::const_iterator it;
for (it = map->begin(); it != map->end(); ++it) {
- scoped_ptr<RuleIterator> rule_iterator(
- map->GetRuleIterator(it->first.content_type,
- it->first.resource_identifier,
- NULL)); // We already hold the lock.
+ std::unique_ptr<RuleIterator> rule_iterator(map->GetRuleIterator(
+ it->first.content_type, it->first.resource_identifier,
+ NULL)); // We already hold the lock.
while (rule_iterator->HasNext()) {
const Rule& rule = rule_iterator->Next();
base::DictionaryValue* setting_dict = new base::DictionaryValue();

Powered by Google App Engine
This is Rietveld 408576698