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

Unified Diff: components/offline_pages/core/background/cleanup_task.h

Issue 2882213003: [Offline pages] Reporting correct expiration reason in CleanupTask (Closed)
Patch Set: Addressing feedback Created 3 years, 7 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 | « no previous file | components/offline_pages/core/background/cleanup_task.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/core/background/cleanup_task.h
diff --git a/components/offline_pages/core/background/cleanup_task.h b/components/offline_pages/core/background/cleanup_task.h
index fbe8e0c4e5b4eb4dc706f266e8ac2bfa98a6f3ea..2201982b5a344745b9f53d65c3f4d1587377eab1 100644
--- a/components/offline_pages/core/background/cleanup_task.h
+++ b/components/offline_pages/core/background/cleanup_task.h
@@ -5,10 +5,12 @@
#ifndef COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_CLEANUP_TASK_H_
#define COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_CLEANUP_TASK_H_
+#include <map>
#include <memory>
#include <vector>
#include "base/memory/weak_ptr.h"
+#include "components/offline_pages/core/background/offliner_policy_utils.h"
#include "components/offline_pages/core/background/request_queue_results.h"
#include "components/offline_pages/core/background/save_page_request.h"
#include "components/offline_pages/core/task.h"
@@ -43,15 +45,19 @@ class CleanupTask : public Task {
void OnRequestsExpired(std::unique_ptr<UpdateRequestsResult> result);
// Build a list of IDs whose request has expired.
- void GetExpiredRequestIds(
- std::vector<std::unique_ptr<SavePageRequest>> requests,
- std::vector<int64_t>* expired_request_ids);
+ void PopulateExpiredRequestIdsAndReasons(
+ std::vector<std::unique_ptr<SavePageRequest>> requests);
// Member variables, all pointers are not owned here.
RequestQueueStore* store_;
OfflinerPolicy* policy_;
RequestNotifier* notifier_;
RequestCoordinatorEventLogger* event_logger_;
+
+ // Holds a map of expired request IDs and respective expiration reasons.
+ std::map<int64_t, OfflinerPolicyUtils::RequestExpirationStatus>
+ expired_request_ids_and_reasons_;
+
// Allows us to pass a weak pointer to callbacks.
base::WeakPtrFactory<CleanupTask> weak_ptr_factory_;
};
« no previous file with comments | « no previous file | components/offline_pages/core/background/cleanup_task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698