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

Unified Diff: content/test/test_background_sync_manager.cc

Issue 2954433002: BackgroundSync: Convert to base::BindOnce/OnceCallback/OnceClosure (Closed)
Patch Set: rename local variable Created 3 years, 6 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 | « content/test/test_background_sync_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_background_sync_manager.cc
diff --git a/content/test/test_background_sync_manager.cc b/content/test/test_background_sync_manager.cc
index 85636e57395157786b73025327c316220cfc8418..2585d439ec7b2d72486ca3354fdd56168de18d60 100644
--- a/content/test/test_background_sync_manager.cc
+++ b/content/test/test_background_sync_manager.cc
@@ -24,8 +24,7 @@ void TestBackgroundSyncManager::DoInit() {
void TestBackgroundSyncManager::ResumeBackendOperation() {
ASSERT_FALSE(continuation_.is_null());
- continuation_.Run();
- continuation_.Reset();
+ std::move(continuation_).Run();
}
void TestBackgroundSyncManager::ClearDelayedTask() {
@@ -41,10 +40,10 @@ void TestBackgroundSyncManager::StoreDataInBackend(
EXPECT_TRUE(continuation_.is_null());
if (corrupt_backend_) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::Bind(callback, SERVICE_WORKER_ERROR_FAILED));
+ FROM_HERE, base::BindOnce(callback, SERVICE_WORKER_ERROR_FAILED));
return;
}
- continuation_ = base::Bind(
+ continuation_ = base::BindOnce(
&TestBackgroundSyncManager::StoreDataInBackendContinue,
base::Unretained(this), sw_registration_id, origin, key, data, callback);
if (delay_backend_)
@@ -66,8 +65,8 @@ void TestBackgroundSyncManager::GetDataFromBackend(
return;
}
continuation_ =
- base::Bind(&TestBackgroundSyncManager::GetDataFromBackendContinue,
- base::Unretained(this), key, callback);
+ base::BindOnce(&TestBackgroundSyncManager::GetDataFromBackendContinue,
+ base::Unretained(this), key, callback);
if (delay_backend_)
return;
@@ -84,17 +83,16 @@ void TestBackgroundSyncManager::DispatchSyncEvent(
dispatch_sync_callback_.Run(active_version, callback);
}
-void TestBackgroundSyncManager::ScheduleDelayedTask(
- const base::Closure& callback,
- base::TimeDelta delay) {
- delayed_task_ = callback;
+void TestBackgroundSyncManager::ScheduleDelayedTask(base::OnceClosure callback,
+ base::TimeDelta delay) {
+ delayed_task_ = std::move(callback);
delayed_task_delta_ = delay;
}
void TestBackgroundSyncManager::HasMainFrameProviderHost(
const GURL& origin,
- const BoolCallback& callback) {
- callback.Run(has_main_frame_provider_host_);
+ BoolCallback callback) {
+ std::move(callback).Run(has_main_frame_provider_host_);
}
void TestBackgroundSyncManager::StoreDataInBackendContinue(
« no previous file with comments | « content/test/test_background_sync_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698