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

Unified Diff: chrome/browser/sync_file_system/drive_backend/conflict_resolver.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/drive_backend/conflict_resolver.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/conflict_resolver.cc b/chrome/browser/sync_file_system/drive_backend/conflict_resolver.cc
index 6e35474c22ff410072a5b7a148b743ad8b3b01a6..bf2db541218efa542a09376f6c4c3aa1e3bcf96d 100644
--- a/chrome/browser/sync_file_system/drive_backend/conflict_resolver.cc
+++ b/chrome/browser/sync_file_system/drive_backend/conflict_resolver.cc
@@ -33,10 +33,10 @@ ConflictResolver::ConflictResolver(SyncEngineContext* sync_context)
ConflictResolver::~ConflictResolver() {}
-void ConflictResolver::RunPreflight(scoped_ptr<SyncTaskToken> token) {
+void ConflictResolver::RunPreflight(std::unique_ptr<SyncTaskToken> token) {
token->InitializeTaskLog("Conflict Resolution");
- scoped_ptr<TaskBlocker> task_blocker(new TaskBlocker);
+ std::unique_ptr<TaskBlocker> task_blocker(new TaskBlocker);
task_blocker->exclusive = true;
SyncTaskManager::UpdateTaskBlocker(
std::move(token), std::move(task_blocker),
@@ -44,7 +44,7 @@ void ConflictResolver::RunPreflight(scoped_ptr<SyncTaskToken> token) {
weak_ptr_factory_.GetWeakPtr()));
}
-void ConflictResolver::RunExclusive(scoped_ptr<SyncTaskToken> token) {
+void ConflictResolver::RunExclusive(std::unique_ptr<SyncTaskToken> token) {
if (!IsContextReady()) {
SyncTaskManager::NotifyTaskDone(std::move(token), SYNC_STATUS_FAILED);
return;
@@ -128,7 +128,7 @@ void ConflictResolver::RunExclusive(scoped_ptr<SyncTaskToken> token) {
}
void ConflictResolver::DetachFromNonPrimaryParents(
- scoped_ptr<SyncTaskToken> token) {
+ std::unique_ptr<SyncTaskToken> token) {
DCHECK(!parents_to_remove_.empty());
// TODO(tzik): Check if ETag match is available for
@@ -148,7 +148,7 @@ void ConflictResolver::DetachFromNonPrimaryParents(
}
void ConflictResolver::DidDetachFromParent(
- scoped_ptr<SyncTaskToken> token,
+ std::unique_ptr<SyncTaskToken> token,
google_apis::DriveApiErrorCode error) {
SyncStatusCode status = DriveApiErrorCodeToSyncStatusCode(error);
if (status != SYNC_STATUS_OK) {
@@ -165,7 +165,7 @@ void ConflictResolver::DidDetachFromParent(
}
std::string ConflictResolver::PickPrimaryFile(const TrackerIDSet& trackers) {
- scoped_ptr<FileMetadata> primary;
+ std::unique_ptr<FileMetadata> primary;
for (TrackerIDSet::const_iterator itr = trackers.begin();
itr != trackers.end(); ++itr) {
FileTracker tracker;
@@ -174,7 +174,7 @@ std::string ConflictResolver::PickPrimaryFile(const TrackerIDSet& trackers) {
continue;
}
- scoped_ptr<FileMetadata> file_metadata(new FileMetadata);
+ std::unique_ptr<FileMetadata> file_metadata(new FileMetadata);
if (!metadata_database()->FindFileByFileID(
tracker.file_id(), file_metadata.get())) {
NOTREACHED();
@@ -229,7 +229,8 @@ std::string ConflictResolver::PickPrimaryFile(const TrackerIDSet& trackers) {
return std::string();
}
-void ConflictResolver::RemoveNonPrimaryFiles(scoped_ptr<SyncTaskToken> token) {
+void ConflictResolver::RemoveNonPrimaryFiles(
+ std::unique_ptr<SyncTaskToken> token) {
DCHECK(!non_primary_file_ids_.empty());
std::string file_id = non_primary_file_ids_.back().first;
@@ -250,7 +251,7 @@ void ConflictResolver::RemoveNonPrimaryFiles(scoped_ptr<SyncTaskToken> token) {
base::Passed(&token), file_id));
}
-void ConflictResolver::DidRemoveFile(scoped_ptr<SyncTaskToken> token,
+void ConflictResolver::DidRemoveFile(std::unique_ptr<SyncTaskToken> token,
const std::string& file_id,
google_apis::DriveApiErrorCode error) {
if (error == google_apis::HTTP_PRECONDITION ||
@@ -283,7 +284,7 @@ bool ConflictResolver::IsContextReady() {
void ConflictResolver::UpdateFileMetadata(
const std::string& file_id,
- scoped_ptr<SyncTaskToken> token) {
+ std::unique_ptr<SyncTaskToken> token) {
drive_service()->GetFileResource(
file_id,
base::Bind(&ConflictResolver::DidGetRemoteMetadata,
@@ -293,9 +294,9 @@ void ConflictResolver::UpdateFileMetadata(
void ConflictResolver::DidGetRemoteMetadata(
const std::string& file_id,
- scoped_ptr<SyncTaskToken> token,
+ std::unique_ptr<SyncTaskToken> token,
google_apis::DriveApiErrorCode error,
- scoped_ptr<google_apis::FileResource> entry) {
+ std::unique_ptr<google_apis::FileResource> entry) {
SyncStatusCode status = DriveApiErrorCodeToSyncStatusCode(error);
if (status != SYNC_STATUS_OK && error != google_apis::HTTP_NOT_FOUND) {
SyncTaskManager::NotifyTaskDone(std::move(token), status);

Powered by Google App Engine
This is Rietveld 408576698