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

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: Fix trybot complaint for no return value on string mapping methods 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..7370091d5eb463454c5a463565637a3448dfc6fd 100644
--- a/components/offline_pages/background/offliner.h
+++ b/components/offline_pages/background/offliner.h
@@ -5,6 +5,8 @@
#ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_OFFLINER_H_
#define COMPONENTS_OFFLINE_PAGES_BACKGROUND_OFFLINER_H_
+#include <string>
+
#include "base/callback.h"
namespace offline_pages {
@@ -39,6 +41,22 @@ 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";
+ default:
+ DCHECK(false);
+ return "";
+ }
+ }
+
// 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