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

Unified Diff: components/offline_pages/background/request_coordinator.h

Issue 2249303002: Simplify Observer callbacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR nits - fix TODOs Created 4 years, 4 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/background/request_coordinator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/background/request_coordinator.h
diff --git a/components/offline_pages/background/request_coordinator.h b/components/offline_pages/background/request_coordinator.h
index f548563f03a0675d7d2aeaad973932ae6da89b41..6804c9ba7376918c128c780c8c72adf9a67de611 100644
--- a/components/offline_pages/background/request_coordinator.h
+++ b/components/offline_pages/background/request_coordinator.h
@@ -35,6 +35,7 @@ class Scheduler;
class RequestCoordinator : public KeyedService {
public:
// Status to return for failed notifications.
+ // TODO(petewil): Can we find a better name for this enum?
dougarnett 2016/08/19 20:59:24 BackgroundSavePageResult or SavePageLaterResult ?
enum class SavePageStatus {
SUCCESS,
PRERENDER_FAILURE,
@@ -42,7 +43,7 @@ class RequestCoordinator : public KeyedService {
SAVE_FAILED,
EXPIRED,
RETRY_COUNT_EXCEEDED,
- REMOVED_BY_CLIENT,
+ REMOVED,
};
// Nested observer class. To make sure that no events are missed, the client
@@ -52,14 +53,9 @@ class RequestCoordinator : public KeyedService {
class Observer {
public:
virtual void OnAdded(const SavePageRequest& request) = 0;
- virtual void OnSucceeded(const SavePageRequest& request) = 0;
- virtual void OnFailed(const SavePageRequest& request,
- SavePageStatus status) = 0;
+ virtual void OnCompleted(const SavePageRequest& request,
+ SavePageStatus status) = 0;
virtual void OnChanged(const SavePageRequest& request) = 0;
- virtual void OnRemoved(const SavePageRequest& request,
- SavePageStatus status) = 0;
- // TODO(petewil): Merge OnSucceeded, OnFailed, and OnRemoved into a single
- // call.
};
// Callback to report when the processing of a triggered task is complete.
@@ -192,10 +188,8 @@ class RequestCoordinator : public KeyedService {
void TryNextRequest();
void NotifyAdded(const SavePageRequest& request);
- void NotifySucceeded(const SavePageRequest& request);
- void NotifyFailed(const SavePageRequest& request, SavePageStatus status);
+ void NotifyCompleted(const SavePageRequest& request, SavePageStatus status);
void NotifyChanged(const SavePageRequest& request);
- void NotifyRemoved(const SavePageRequest& request);
// Returns the appropriate offliner to use, getting a new one from the factory
// if needed.
« no previous file with comments | « no previous file | components/offline_pages/background/request_coordinator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698