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

Unified Diff: components/offline_pages/background/mark_attempt_completed_task.cc

Issue 2463713003: [Offline Pages] Converts MarkAttemptCompleted to use TaskQueue (Closed)
Patch Set: Ternary nit and format fix Created 4 years, 1 month 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: components/offline_pages/background/mark_attempt_completed_task.cc
diff --git a/components/offline_pages/background/mark_attempt_started_task.cc b/components/offline_pages/background/mark_attempt_completed_task.cc
similarity index 68%
copy from components/offline_pages/background/mark_attempt_started_task.cc
copy to components/offline_pages/background/mark_attempt_completed_task.cc
index f1a82ac82bd9f7b568225b545966ab2b2abc8b24..d3ec900f488cf62bebd3a647780cbbd9ff36b50c 100644
--- a/components/offline_pages/background/mark_attempt_started_task.cc
+++ b/components/offline_pages/background/mark_attempt_completed_task.cc
@@ -2,22 +2,24 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/offline_pages/background/mark_attempt_started_task.h"
+#include "components/offline_pages/background/mark_attempt_completed_task.h"
+
+#include <utility>
#include "base/bind.h"
#include "base/time/time.h"
namespace offline_pages {
-MarkAttemptStartedTask::MarkAttemptStartedTask(
+MarkAttemptCompletedTask::MarkAttemptCompletedTask(
RequestQueueStore* store,
int64_t request_id,
const RequestQueueStore::UpdateCallback& callback)
: UpdateRequestTask(store, request_id, callback) {}
-MarkAttemptStartedTask::~MarkAttemptStartedTask() {}
+MarkAttemptCompletedTask::~MarkAttemptCompletedTask() {}
-void MarkAttemptStartedTask::UpdateRequestImpl(
+void MarkAttemptCompletedTask::UpdateRequestImpl(
std::unique_ptr<UpdateRequestsResult> read_result) {
if (!ValidateReadResult(read_result.get())) {
CompleteWithResult(std::move(read_result));
@@ -26,10 +28,10 @@ void MarkAttemptStartedTask::UpdateRequestImpl(
// It is perfectly fine to reuse the read_result->updated_items collection, as
// it is owned by this callback and will be destroyed when out of scope.
- read_result->updated_items[0].MarkAttemptStarted(base::Time::Now());
+ read_result->updated_items[0].MarkAttemptCompleted();
store()->UpdateRequests(
read_result->updated_items,
- base::Bind(&MarkAttemptStartedTask::CompleteWithResult, GetWeakPtr()));
+ base::Bind(&MarkAttemptCompletedTask::CompleteWithResult, GetWeakPtr()));
}
} // namespace offline_pages

Powered by Google App Engine
This is Rietveld 408576698