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

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

Issue 1815363002: Add RetainedRef uses where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/canned_syncable_file_system.cc
diff --git a/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc b/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc
index 309a53a2418c17ccef3a2c63d6e16240a2f9dfa1..3c09c35a74bb0f00ab225ac76abfcf664f33eec0 100644
--- a/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc
+++ b/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc
@@ -69,9 +69,9 @@ R RunOnThread(
task_runner->PostTask(
location,
base::Bind(task, base::Bind(&AssignAndQuit<R>,
- base::ThreadTaskRunnerHandle::Get(),
- run_loop.QuitClosure(),
- &result)));
+ base::RetainedRef(
+ base::ThreadTaskRunnerHandle::Get()),
+ run_loop.QuitClosure(), &result)));
run_loop.Run();
return result;
}
@@ -99,7 +99,7 @@ void VerifySameTaskRunner(
ASSERT_TRUE(runner1 != nullptr);
ASSERT_TRUE(runner2 != nullptr);
runner1->PostTask(FROM_HERE,
- base::Bind(&EnsureRunningOn, make_scoped_refptr(runner2)));
+ base::Bind(&EnsureRunningOn, base::RetainedRef(runner2)));
}
void OnCreateSnapshotFileAndVerifyData(
@@ -292,12 +292,12 @@ File::Error CannedSyncableFileSystem::OpenFileSystem() {
base::RunLoop run_loop;
io_task_runner_->PostTask(
FROM_HERE,
- base::Bind(&CannedSyncableFileSystem::DoOpenFileSystem,
- base::Unretained(this),
- base::Bind(&CannedSyncableFileSystem::DidOpenFileSystem,
- base::Unretained(this),
- base::ThreadTaskRunnerHandle::Get(),
- run_loop.QuitClosure())));
+ base::Bind(
+ &CannedSyncableFileSystem::DoOpenFileSystem, base::Unretained(this),
+ base::Bind(&CannedSyncableFileSystem::DidOpenFileSystem,
+ base::Unretained(this),
+ base::RetainedRef(base::ThreadTaskRunnerHandle::Get()),
+ run_loop.QuitClosure())));
run_loop.Run();
if (backend()->sync_context()) {
@@ -738,12 +738,10 @@ void CannedSyncableFileSystem::DidOpenFileSystem(
if (!original_task_runner->RunsTasksOnCurrentThread()) {
DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
original_task_runner->PostTask(
- FROM_HERE,
- base::Bind(&CannedSyncableFileSystem::DidOpenFileSystem,
- base::Unretained(this),
- make_scoped_refptr(original_task_runner),
- quit_closure,
- root, name, result));
+ FROM_HERE, base::Bind(&CannedSyncableFileSystem::DidOpenFileSystem,
+ base::Unretained(this),
+ base::RetainedRef(original_task_runner),
+ quit_closure, root, name, result));
return;
}
result_ = result;

Powered by Google App Engine
This is Rietveld 408576698