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

Unified Diff: content/browser/background_fetch/background_fetch_embedded_worker_test_helper.cc

Issue 2824193002: Enable use_once_callback for //content/common/*.mojom (Closed)
Patch Set: rebase Created 3 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: content/browser/background_fetch/background_fetch_embedded_worker_test_helper.cc
diff --git a/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.cc b/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.cc
index 62c73b2f20e344d743b2934364d9639a1af8a39d..e5d4b165cd07aa9684d868d2d8cb21e5de1ec9d8 100644
--- a/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.cc
+++ b/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.cc
@@ -21,15 +21,15 @@ BackgroundFetchEmbeddedWorkerTestHelper::
void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchAbortEvent(
const std::string& tag,
- const mojom::ServiceWorkerEventDispatcher::
- DispatchBackgroundFetchAbortEventCallback& callback) {
+ mojom::ServiceWorkerEventDispatcher::
+ DispatchBackgroundFetchAbortEventCallback callback) {
last_tag_ = tag;
if (fail_abort_event_) {
- callback.Run(SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED,
- base::Time::Now());
+ std::move(callback).Run(SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED,
+ base::Time::Now());
} else {
- callback.Run(SERVICE_WORKER_OK, base::Time::Now());
+ std::move(callback).Run(SERVICE_WORKER_OK, base::Time::Now());
}
if (abort_event_closure_)
@@ -39,16 +39,16 @@ void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchAbortEvent(
void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchClickEvent(
const std::string& tag,
mojom::BackgroundFetchState state,
- const mojom::ServiceWorkerEventDispatcher::
- DispatchBackgroundFetchClickEventCallback& callback) {
+ mojom::ServiceWorkerEventDispatcher::
+ DispatchBackgroundFetchClickEventCallback callback) {
last_tag_ = tag;
last_state_ = state;
if (fail_click_event_) {
- callback.Run(SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED,
- base::Time::Now());
+ std::move(callback).Run(SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED,
+ base::Time::Now());
} else {
- callback.Run(SERVICE_WORKER_OK, base::Time::Now());
+ std::move(callback).Run(SERVICE_WORKER_OK, base::Time::Now());
}
if (click_event_closure_)
@@ -58,16 +58,16 @@ void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchClickEvent(
void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchFailEvent(
const std::string& tag,
const std::vector<BackgroundFetchSettledFetch>& fetches,
- const mojom::ServiceWorkerEventDispatcher::
- DispatchBackgroundFetchFailEventCallback& callback) {
+ mojom::ServiceWorkerEventDispatcher::
+ DispatchBackgroundFetchFailEventCallback callback) {
last_tag_ = tag;
last_fetches_ = fetches;
if (fail_fetch_fail_event_) {
- callback.Run(SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED,
- base::Time::Now());
+ std::move(callback).Run(SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED,
+ base::Time::Now());
} else {
- callback.Run(SERVICE_WORKER_OK, base::Time::Now());
+ std::move(callback).Run(SERVICE_WORKER_OK, base::Time::Now());
}
if (fetch_fail_event_closure_)
@@ -77,16 +77,16 @@ void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchFailEvent(
void BackgroundFetchEmbeddedWorkerTestHelper::OnBackgroundFetchedEvent(
const std::string& tag,
const std::vector<BackgroundFetchSettledFetch>& fetches,
- const mojom::ServiceWorkerEventDispatcher::
- DispatchBackgroundFetchedEventCallback& callback) {
+ mojom::ServiceWorkerEventDispatcher::DispatchBackgroundFetchedEventCallback
+ callback) {
last_tag_ = tag;
last_fetches_ = fetches;
if (fail_fetched_event_) {
- callback.Run(SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED,
- base::Time::Now());
+ std::move(callback).Run(SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED,
+ base::Time::Now());
} else {
- callback.Run(SERVICE_WORKER_OK, base::Time::Now());
+ std::move(callback).Run(SERVICE_WORKER_OK, base::Time::Now());
}
if (fetched_event_closure_)

Powered by Google App Engine
This is Rietveld 408576698