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

Side by Side Diff: components/offline_pages/core/background/offliner.h

Issue 2818783002: [Offline pages]: Implement background loader to save on last retry, and record last retry success U… (Closed)
Patch Set: Resolving code review comments Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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_CORE_BACKGROUND_OFFLINER_H_ 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_H_
6 #define COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_H_ 6 #define COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // processing another request at this time. 48 // processing another request at this time.
49 LOADING_FAILED_NO_NEXT = 11, 49 LOADING_FAILED_NO_NEXT = 11,
50 // The RequestCoordinator tried to start loading the request but the 50 // The RequestCoordinator tried to start loading the request but the
51 // loading request was not accepted. 51 // loading request was not accepted.
52 LOADING_NOT_ACCEPTED = 12, 52 LOADING_NOT_ACCEPTED = 12,
53 // The RequestCoordinator did not start loading the request because 53 // The RequestCoordinator did not start loading the request because
54 // updating the status in the request queue failed. 54 // updating the status in the request queue failed.
55 QUEUE_UPDATE_FAILED = 13, 55 QUEUE_UPDATE_FAILED = 13,
56 // Scheduler canceled processing of requests. 56 // Scheduler canceled processing of requests.
57 BACKGROUND_SCHEDULER_CANCELED = 14, 57 BACKGROUND_SCHEDULER_CANCELED = 14,
58 // We saved a snapshot on the last retry, after timeout.
59 SAVED_ON_LAST_RETRY = 15,
58 // NOTE: insert new values above this line and update histogram enum too. 60 // NOTE: insert new values above this line and update histogram enum too.
59 STATUS_COUNT 61 STATUS_COUNT
60 }; 62 };
61 63
62 // Reports the load progress of a request. 64 // Reports the load progress of a request.
63 typedef base::Callback<void(const SavePageRequest&, int64_t received_bytes)> 65 typedef base::Callback<void(const SavePageRequest&, int64_t received_bytes)>
64 ProgressCallback; 66 ProgressCallback;
65 // Reports the completion status of a request. 67 // Reports the completion status of a request.
66 // TODO(dougarnett): consider passing back a request id instead of request. 68 // TODO(dougarnett): consider passing back a request id instead of request.
67 typedef base::Callback<void(const SavePageRequest&, RequestStatus)> 69 typedef base::Callback<void(const SavePageRequest&, RequestStatus)>
(...skipping 21 matching lines...) Expand all
89 // Handles timeout scenario. Returns true if lowbar is met and try to do a 91 // Handles timeout scenario. Returns true if lowbar is met and try to do a
90 // snapshot of the current webcontents. 92 // snapshot of the current webcontents.
91 virtual bool HandleTimeout(const SavePageRequest& request) = 0; 93 virtual bool HandleTimeout(const SavePageRequest& request) = 0;
92 94
93 // TODO(dougarnett): add policy support methods. 95 // TODO(dougarnett): add policy support methods.
94 }; 96 };
95 97
96 } // namespace offline_pages 98 } // namespace offline_pages
97 99
98 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_H_ 100 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698