| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_OFFLINER_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_OFFLINER_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_OFFLINER_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_OFFLINER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 | 11 |
| 12 namespace offline_pages { | 12 namespace offline_pages { |
| 13 | 13 |
| 14 class SavePageRequest; | 14 class SavePageRequest; |
| 15 | 15 |
| 16 // Interface of a class responsible for constructing an offline page given | 16 // Interface of a class responsible for constructing an offline page given |
| 17 // a request with a URL. | 17 // a request with a URL. |
| 18 class Offliner { | 18 class Offliner { |
| 19 public: | 19 public: |
| 20 // Status of processing an offline page request. | 20 // Status of processing an offline page request. |
| 21 // WARNING: You must update histograms.xml to match any changes made to | 21 // WARNING: You must update histograms.xml to match any changes made to |
| 22 // this enum (ie, OfflinePagesBackgroundOfflinerRequestStatus histogram enum). | 22 // this enum (ie, OfflinePagesBackgroundOfflinerRequestStatus histogram enum). |
| 23 // Also update related switch code in RequestCoordinatorEventLogger. |
| 23 enum RequestStatus { | 24 enum RequestStatus { |
| 24 // No status determined/reported yet. Interim status, not sent in callback. | 25 // No status determined/reported yet. Interim status, not sent in callback. |
| 25 UNKNOWN = 0, | 26 UNKNOWN = 0, |
| 26 // Page loaded but not (yet) saved. Interim status, not sent in callback. | 27 // Page loaded but not (yet) saved. Interim status, not sent in callback. |
| 27 LOADED = 1, | 28 LOADED = 1, |
| 28 // Offline page snapshot saved. | 29 // Offline page snapshot saved. |
| 29 SAVED = 2, | 30 SAVED = 2, |
| 30 // RequestCoordinator canceled request. | 31 // RequestCoordinator canceled request. |
| 31 REQUEST_COORDINATOR_CANCELED = 3, | 32 REQUEST_COORDINATOR_CANCELED = 3, |
| 32 // Prerendering was canceled. | 33 // Prerendering was canceled. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 59 // Clears the currently processing request, if any, and skips running its | 60 // Clears the currently processing request, if any, and skips running its |
| 60 // CompletionCallback. | 61 // CompletionCallback. |
| 61 virtual void Cancel() = 0; | 62 virtual void Cancel() = 0; |
| 62 | 63 |
| 63 // TODO(dougarnett): add policy support methods. | 64 // TODO(dougarnett): add policy support methods. |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 } // namespace offline_pages | 67 } // namespace offline_pages |
| 67 | 68 |
| 68 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_OFFLINER_H_ | 69 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_OFFLINER_H_ |
| OLD | NEW |