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..9e21ff6e33533aa6748292fcc20fb415d4c90369 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. |
+ // NOTE: These values correspond to the OfflinePagesBackgroundOfflinerStatus |
+ // histogram enum. |
+ enum RequestStatus { |
+ UNKNOWN = 0, // No status determined/reported yet. |
fgorski
2016/06/29 18:47:03
Value assignments are not necessary here.
dougarnett
2016/06/29 19:42:52
But the histogram enum values need to match, right
jianli
2016/06/29 20:47:34
IMO, assigning value seems to often imply that it
dougarnett
2016/06/30 18:09:15
I think that would be fairly easy to catch in code
fgorski
2016/06/30 18:50:54
OK. I think dimich@ got that suggestion from a UMA
|
+ LOADED = 1, // Page loaded but not (yet) saved. |
+ SAVED = 2, // Offline page snapshot saved. |
fgorski
2016/06/29 18:47:02
Is it possible that a single request will end up r
dougarnett
2016/06/29 19:42:52
No, just one final status recorded per request is
fgorski
2016/06/30 18:50:54
Please document that in the code. I will have the
dougarnett
2016/06/30 19:24:06
Added comment to RecordStatusUMA method as it seem
|
+ REQUEST_CANCELED = 3, // Request was canceled by requester (from above). |
+ LOAD_CANCELED = 4, // Load was canceled vs. failed (from below). |
fgorski
2016/06/29 18:47:02
Is that a cancel for reasons different than user c
dougarnett
2016/06/29 19:42:52
This "from below" is a cancel from the prerenderer
fgorski
2016/06/30 18:50:54
Please document that in the code. I will have the
Dmitry Titov
2016/06/30 18:54:04
Maybe change name to say CANCELED_BY_PRERENDERER a
dougarnett
2016/06/30 19:24:06
Yeah, I struggle with that a bit here as it is at
|
+ LOAD_FAILED = 5, // 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. |