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

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

Issue 2104393002: Adds UMA for PrerenderingOffliner request processing result status. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clarifies and fixes behavior wrt Offliner::Cancel() not calling the callback Created 4 years, 5 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: components/offline_pages/background/offliner.h
diff --git a/components/offline_pages/background/offliner.h b/components/offline_pages/background/offliner.h
index 745fc6181b678670a377ce8ecaa41c2b0e22c38d..dff2b31d545d19f57d6aaf91202a28a8f9bbab59 100644
--- a/components/offline_pages/background/offliner.h
+++ b/components/offline_pages/background/offliner.h
@@ -16,14 +16,18 @@ class SavePageRequest;
class Offliner {
public:
// Status of processing an offline page request.
- enum class RequestStatus {
- UNKNOWN, // No status determined/reported yet.
- LOADED, // Page loaded but not (yet) saved.
- SAVED, // Offline page snapshot saved.
- CANCELED, // Request was canceled.
- FAILED, // Failed to load page.
- FAILED_SAVE, // Failed to save loaded page.
- // TODO(dougarnett): Define a retry-able failure status.
+ // WARNING: You must update histograms.xml to match any changes made to
+ // this enum (ie, OfflinePagesBackgroundOfflinerRequestStatus histogram enum).
+ enum RequestStatus {
+ UNKNOWN = 0, // No status determined/reported yet.
+ LOADED = 1, // Page loaded but not (yet) saved.
+ SAVED = 2, // Offline page snapshot saved.
+ REQUEST_COORDINATOR_CANCELED = 3, // RequestCoordinator canceled request.
+ PRERENDERING_CANCELED = 4, // Prerendering was canceled.
+ PRERENDERING_FAILED = 5, // Prerendering failed to load page.
+ SAVE_FAILED = 6, // Failed to save loaded page.
+ // NOTE: insert new values above this line and update histogram enum too.
+ STATUS_COUNT
};
// Reports the completion status of a request.
@@ -41,7 +45,8 @@ class Offliner {
const SavePageRequest& request,
const CompletionCallback& callback) = 0;
- // Clears the currently processing request, if any.
+ // Clears the currently processing request, if any, and skips running its
+ // CompletionCallback.
virtual void Cancel() = 0;
// TODO(dougarnett): add policy support methods.

Powered by Google App Engine
This is Rietveld 408576698