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

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

Issue 2209813002: [Offline Pages] Moves Coordinator to using MarkAttemptStarted/MarkAttemptCompleted API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes status string send to event logger (was hardwired to "Saved" without checking actual status) 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
Index: components/offline_pages/background/offliner.h
diff --git a/components/offline_pages/background/offliner.h b/components/offline_pages/background/offliner.h
index 8bc6468af55a0f51565c935886665af2bb3cb7a0..5e11afb6946fc10f832d86fddd7c9a9c111bddb9 100644
--- a/components/offline_pages/background/offliner.h
+++ b/components/offline_pages/background/offliner.h
@@ -39,6 +39,20 @@ class Offliner {
STATUS_COUNT
};
+ static std::string RequestStatusToString(RequestStatus request_status) {
+ switch (request_status) {
+ case UNKNOWN: return "Unknown";
+ case LOADED: return "LOADED";
+ case SAVED: return "SAVED";
+ case REQUEST_COORDINATOR_CANCELED: return "REQUEST_COORDINATOR_CANCELED";
+ case PRERENDERING_CANCELED: return "PRERENDERING_CANCELED";
+ case PRERENDERING_FAILED: return "PRERENDERING_FAILED";
+ case SAVE_FAILED: return "SAVE_FAILED";
+ case FOREGROUND_CANCELED: return "FOREGROUND_CANCELED";
+ case STATUS_COUNT: return "STATUS_COUNT";
Pete Williamson 2016/08/03 20:44:55 SHould we really be returning a string for the cou
dougarnett 2016/08/03 21:40:01 update to DCHECK and empty string for non-Debug?
Pete Williamson 2016/08/03 22:29:12 sounds good
dougarnett 2016/08/03 23:33:51 Done.
+ }
+ }
+
// Reports the completion status of a request.
// TODO(dougarnett): consider passing back a request id instead of request.
typedef base::Callback<void(const SavePageRequest&, RequestStatus)>

Powered by Google App Engine
This is Rietveld 408576698