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

Unified Diff: extensions/browser/api/declarative/rules_registry.cc

Issue 1902873002: Convert //extensions/browser/api 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/declarative/rules_registry.cc
diff --git a/extensions/browser/api/declarative/rules_registry.cc b/extensions/browser/api/declarative/rules_registry.cc
index ffbcb7f896b1edabd06c96f39002de90137480c4..fd77d4646ff67579f69a5158e7e89465fef7c725 100644
--- a/extensions/browser/api/declarative/rules_registry.cc
+++ b/extensions/browser/api/declarative/rules_registry.cc
@@ -38,9 +38,9 @@ const char kDuplicateRuleId[] = "Duplicate rule ID: %s";
const char kErrorCannotRemoveManifestRules[] =
"Rules declared in the 'event_rules' manifest field cannot be removed";
-scoped_ptr<base::Value> RulesToValue(
+std::unique_ptr<base::Value> RulesToValue(
const std::vector<linked_ptr<api::events::Rule>>& rules) {
- scoped_ptr<base::ListValue> list(new base::ListValue());
+ std::unique_ptr<base::ListValue> list(new base::ListValue());
for (size_t i = 0; i < rules.size(); ++i)
list->Append(rules[i]->ToValue().release());
return std::move(list);
@@ -297,9 +297,8 @@ size_t RulesRegistry::GetNumberOfUsedRuleIdentifiersForTesting() const {
return entry_count;
}
-void RulesRegistry::DeserializeAndAddRules(
- const std::string& extension_id,
- scoped_ptr<base::Value> rules) {
+void RulesRegistry::DeserializeAndAddRules(const std::string& extension_id,
+ std::unique_ptr<base::Value> rules) {
DCHECK_CURRENTLY_ON(owner_thread());
std::string error =
@@ -310,7 +309,7 @@ void RulesRegistry::DeserializeAndAddRules(
void RulesRegistry::ReportInternalError(const std::string& extension_id,
const std::string& error) {
- scoped_ptr<ExtensionError> error_instance(new InternalError(
+ std::unique_ptr<ExtensionError> error_instance(new InternalError(
extension_id, base::ASCIIToUTF16(error), logging::LOG_ERROR));
ExtensionsBrowserClient::Get()->ReportError(browser_context_,
std::move(error_instance));
« no previous file with comments | « extensions/browser/api/declarative/rules_registry.h ('k') | extensions/browser/api/declarative/rules_registry_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698