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

Unified Diff: chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc

Issue 2605433002: Remove base::ScopedPtrHashMap from chrome/browser/sync_file_system/drive_backend/ (Closed)
Patch Set: no crash Created 4 years 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 | « chrome/browser/sync_file_system/drive_backend/sync_task_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc b/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc
index acdb242094c308a931a5d656494b07867b36abd8..b971db1f29c43ff88ef072d43e154d13788c7744 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc
+++ b/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc
@@ -201,7 +201,8 @@ bool SyncTaskManager::IsRunningTask(int64_t token_id) const {
if (token_id == SyncTaskToken::kForegroundTaskTokenID)
return true;
- return ContainsKey(running_background_tasks_, token_id);
+ return running_background_tasks_.find(token_id) !=
+ running_background_tasks_.end();
}
void SyncTaskManager::DetachFromSequence() {
@@ -240,7 +241,8 @@ void SyncTaskManager::NotifyTaskDoneBody(std::unique_ptr<SyncTaskToken> token,
token_ = std::move(token);
task = std::move(running_foreground_task_);
} else {
- task = running_background_tasks_.take_and_erase(token->token_id());
+ task = std::move(running_background_tasks_[token->token_id()]);
+ running_background_tasks_.erase(token->token_id());
}
// Acquire the token to prevent a new task to jump into the queue.
@@ -343,8 +345,8 @@ void SyncTaskManager::UpdateTaskBlockerBody(
weak_ptr_factory_.GetWeakPtr(), task_runner_.get(), task_token_seq_++,
std::move(task_blocker));
background_task_token->UpdateTask(from_here, callback);
- running_background_tasks_.set(background_task_token->token_id(),
- std::move(running_foreground_task_));
+ running_background_tasks_[background_task_token->token_id()] =
+ std::move(running_foreground_task_);
}
token_ = std::move(foreground_task_token);
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend/sync_task_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698