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

Unified Diff: chrome/browser/sync_file_system/local/local_file_change_tracker.cc

Issue 1873683002: Convert //chrome/browser/sync_file_system 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: chrome/browser/sync_file_system/local/local_file_change_tracker.cc
diff --git a/chrome/browser/sync_file_system/local/local_file_change_tracker.cc b/chrome/browser/sync_file_system/local/local_file_change_tracker.cc
index a97612c449215630102de83119f410cd6353734a..49aacd9e83b841a20c819a99649f68578ce16b20 100644
--- a/chrome/browser/sync_file_system/local/local_file_change_tracker.cc
+++ b/chrome/browser/sync_file_system/local/local_file_change_tracker.cc
@@ -50,7 +50,7 @@ class LocalFileChangeTracker::TrackerDB {
SyncStatusCode ClearDirty(const std::string& url);
SyncStatusCode GetDirtyEntries(
std::queue<FileSystemURL>* dirty_files);
- SyncStatusCode WriteBatch(scoped_ptr<leveldb::WriteBatch> batch);
+ SyncStatusCode WriteBatch(std::unique_ptr<leveldb::WriteBatch> batch);
private:
enum RecoveryOption {
@@ -65,7 +65,7 @@ class LocalFileChangeTracker::TrackerDB {
const base::FilePath base_path_;
leveldb::Env* env_override_;
- scoped_ptr<leveldb::DB> db_;
+ std::unique_ptr<leveldb::DB> db_;
SyncStatusCode db_status_;
DISALLOW_COPY_AND_ASSIGN(TrackerDB);
@@ -277,7 +277,7 @@ SyncStatusCode LocalFileChangeTracker::Initialize(
void LocalFileChangeTracker::ResetForFileSystem(const GURL& origin,
storage::FileSystemType type) {
DCHECK(file_task_runner_->RunsTasksOnCurrentThread());
- scoped_ptr<leveldb::WriteBatch> batch(new leveldb::WriteBatch);
+ std::unique_ptr<leveldb::WriteBatch> batch(new leveldb::WriteBatch);
for (FileChangeMap::iterator iter = changes_.begin();
iter != changes_.end();) {
storage::FileSystemURL url = iter->first;
@@ -358,7 +358,7 @@ SyncStatusCode LocalFileChangeTracker::CollectLastDirtyChanges(
FileSystemFileUtil* file_util =
file_system_context->sandbox_delegate()->sync_file_util();
DCHECK(file_util);
- scoped_ptr<FileSystemOperationContext> context(
+ std::unique_ptr<FileSystemOperationContext> context(
new FileSystemOperationContext(file_system_context));
base::File::Info file_info;
@@ -383,7 +383,7 @@ SyncStatusCode LocalFileChangeTracker::CollectLastDirtyChanges(
SYNC_FILE_TYPE_DIRECTORY));
// Push files and directories in this directory into |dirty_files|.
- scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> enumerator(
+ std::unique_ptr<FileSystemFileUtil::AbstractFileEnumerator> enumerator(
file_util->CreateFileEnumerator(context.get(), url));
base::FilePath path_each;
while (!(path_each = enumerator->Next()).empty()) {
@@ -591,7 +591,8 @@ SyncStatusCode LocalFileChangeTracker::TrackerDB::GetDirtyEntries(
return db_status_;
}
- scoped_ptr<leveldb::Iterator> iter(db_->NewIterator(leveldb::ReadOptions()));
+ std::unique_ptr<leveldb::Iterator> iter(
+ db_->NewIterator(leveldb::ReadOptions()));
iter->SeekToFirst();
FileSystemURL url;
while (iter->Valid()) {
@@ -610,7 +611,7 @@ SyncStatusCode LocalFileChangeTracker::TrackerDB::GetDirtyEntries(
}
SyncStatusCode LocalFileChangeTracker::TrackerDB::WriteBatch(
- scoped_ptr<leveldb::WriteBatch> batch) {
+ std::unique_ptr<leveldb::WriteBatch> batch) {
if (db_status_ != SYNC_STATUS_OK)
return db_status_;

Powered by Google App Engine
This is Rietveld 408576698