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

Unified Diff: sql/connection.cc

Issue 1851913002: Convert //sql to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU fixup in precache_url_table_unittest.cc 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 | « sql/connection.h ('k') | sql/connection_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/connection.cc
diff --git a/sql/connection.cc b/sql/connection.cc
index 7787adfe28330e4fdadcc8fb4d16eab74b952da9..b1be62f586a782d64fca587e671254f912e29493 100644
--- a/sql/connection.cc
+++ b/sql/connection.cc
@@ -8,6 +8,7 @@
#include <stddef.h>
#include <stdint.h>
#include <string.h>
+
#include <utility>
#include "base/bind.h"
@@ -542,7 +543,7 @@ void Connection::Preload() {
if (preload_size > file_size)
preload_size = file_size;
- scoped_ptr<char[]> buf(new char[page_size]);
+ std::unique_ptr<char[]> buf(new char[page_size]);
for (sqlite3_int64 pos = 0; pos < preload_size; pos += page_size) {
rc = file->pMethods->xRead(file, buf.get(), page_size, pos);
@@ -679,12 +680,13 @@ bool Connection::RegisterIntentToUpload() const {
// already bad.
base::AutoLock lock(g_sqlite_init_lock.Get());
- scoped_ptr<base::Value> root;
+ std::unique_ptr<base::Value> root;
if (!base::PathExists(breadcrumb_path)) {
- scoped_ptr<base::DictionaryValue> root_dict(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> root_dict(
+ new base::DictionaryValue());
root_dict->SetInteger(kVersionKey, kVersion);
- scoped_ptr<base::ListValue> dumps(new base::ListValue);
+ std::unique_ptr<base::ListValue> dumps(new base::ListValue);
dumps->AppendString(histogram_tag_);
root_dict->Set(kDiagnosticDumpsKey, std::move(dumps));
@@ -693,11 +695,11 @@ bool Connection::RegisterIntentToUpload() const {
// Failure to read a valid dictionary implies that something is going wrong
// on the system.
JSONFileValueDeserializer deserializer(breadcrumb_path);
- scoped_ptr<base::Value> read_root(
+ std::unique_ptr<base::Value> read_root(
deserializer.Deserialize(nullptr, nullptr));
if (!read_root.get())
return false;
- scoped_ptr<base::DictionaryValue> root_dict =
+ std::unique_ptr<base::DictionaryValue> root_dict =
base::DictionaryValue::From(std::move(read_root));
if (!root_dict)
return false;
« no previous file with comments | « sql/connection.h ('k') | sql/connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698