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

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

Issue 2697493002: [Offline pages] Implementation of OfflineBackgroundTask using background_task_scheduler (Closed)
Patch Set: Addressing more feedback Created 3 years, 9 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 LOADING_FAILED_NO_RETRY = 10, 46 LOADING_FAILED_NO_RETRY = 10,
47 // Loader failed with some error that suggests we should not continue 47 // Loader failed with some error that suggests we should not continue
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.
57 BACKGROUND_SCHEDULER_CANCELED = 14,
56 // NOTE: insert new values above this line and update histogram enum too. 58 // NOTE: insert new values above this line and update histogram enum too.
57 STATUS_COUNT 59 STATUS_COUNT
58 }; 60 };
59 61
60 // Reports the completion status of a request. 62 // Reports the completion status of a request.
61 // TODO(dougarnett): consider passing back a request id instead of request. 63 // TODO(dougarnett): consider passing back a request id instead of request.
62 typedef base::Callback<void(const SavePageRequest&, RequestStatus)> 64 typedef base::Callback<void(const SavePageRequest&, RequestStatus)>
63 CompletionCallback; 65 CompletionCallback;
64 66
65 Offliner() {} 67 Offliner() {}
(...skipping 12 matching lines...) Expand all
78 // Handles timeout scenario. Returns true if lowbar is met and try to do a 80 // Handles timeout scenario. Returns true if lowbar is met and try to do a
79 // snapshot of the current webcontents. 81 // snapshot of the current webcontents.
80 virtual bool HandleTimeout(const SavePageRequest& request) = 0; 82 virtual bool HandleTimeout(const SavePageRequest& request) = 0;
81 83
82 // TODO(dougarnett): add policy support methods. 84 // TODO(dougarnett): add policy support methods.
83 }; 85 };
84 86
85 } // namespace offline_pages 87 } // namespace offline_pages
86 88
87 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_H_ 89 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698