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

Unified Diff: extensions/common/extension_api.cc

Issue 1908953003: Convert //extensions/{common,shell} from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase? 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
« no previous file with comments | « extensions/common/extension_api.h ('k') | extensions/common/extension_builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/extension_api.cc
diff --git a/extensions/common/extension_api.cc b/extensions/common/extension_api.cc
index b30af5f28d1b86243f0c9d4ac5e4c3a776aaec09..1fee5b3c8b272719f2db9108d0288ec63655c8fc 100644
--- a/extensions/common/extension_api.cc
+++ b/extensions/common/extension_api.cc
@@ -45,15 +45,15 @@ base::StringPiece ReadFromResource(int resource_id) {
resource_id);
}
-scoped_ptr<base::ListValue> LoadSchemaList(const std::string& name,
- const base::StringPiece& schema) {
+std::unique_ptr<base::ListValue> LoadSchemaList(
+ const std::string& name,
+ const base::StringPiece& schema) {
std::string error_message;
- scoped_ptr<base::Value> result(
- base::JSONReader::ReadAndReturnError(
- schema,
- base::JSON_PARSE_RFC | base::JSON_DETACHABLE_CHILDREN, // options
- NULL, // error code
- &error_message));
+ std::unique_ptr<base::Value> result(base::JSONReader::ReadAndReturnError(
+ schema,
+ base::JSON_PARSE_RFC | base::JSON_DETACHABLE_CHILDREN, // options
+ NULL, // error code
+ &error_message));
// Tracking down http://crbug.com/121424
char buf[128];
@@ -102,7 +102,7 @@ struct Static {
Static()
: api(ExtensionAPI::CreateWithDefaultConfiguration()) {
}
- scoped_ptr<ExtensionAPI> api;
+ std::unique_ptr<ExtensionAPI> api;
};
base::LazyInstance<Static> g_lazy_instance = LAZY_INSTANCE_INITIALIZER;
@@ -213,7 +213,7 @@ ExtensionAPI::OverrideSharedInstanceForTest::~OverrideSharedInstanceForTest() {
void ExtensionAPI::LoadSchema(const std::string& name,
const base::StringPiece& schema) {
- scoped_ptr<base::ListValue> schema_list(LoadSchemaList(name, schema));
+ std::unique_ptr<base::ListValue> schema_list(LoadSchemaList(name, schema));
std::string schema_namespace;
extensions::ExtensionsClient* extensions_client =
extensions::ExtensionsClient::Get();
@@ -221,7 +221,7 @@ void ExtensionAPI::LoadSchema(const std::string& name,
while (!schema_list->empty()) {
base::DictionaryValue* schema = NULL;
{
- scoped_ptr<base::Value> value;
+ std::unique_ptr<base::Value> value;
schema_list->Remove(schema_list->GetSize() - 1, &value);
CHECK(value.release()->GetAsDictionary(&schema));
}
« no previous file with comments | « extensions/common/extension_api.h ('k') | extensions/common/extension_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698