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

Side by Side Diff: components/offline_pages/background_offliner.h

Issue 1922533003: Defines initial inner circle of interfaces for background offlining. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback updates (does not yet rename Coordinator though). Created 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_OFFLINER_H_
6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_OFFLINER_H_
7
8 #include "base/callback.h"
9
10 namespace offline_pages {
11
12 class SavePageRequest;
13
14 // Interface of a class responsible for constructing an offline page given
15 // a request with a URL.
16 class BackgroundOffliner {
17 public:
18 // Completion status of processing an offline page request.
19 enum CompletionStatus {
20 SAVED = 0,
21 CANCELED = 1,
22 FAILED_CONSIDER_RETRY = 2,
23 FAILED_DO_NOT_RETRY = 3,
24 };
25
26 typedef base::Callback<void(CompletionStatus)> CompletionCallback;
27
28 virtual ~BackgroundOffliner() {}
29
30 // Processes |request| to load and save an offline page.
31 // Returns whether the request was accepted or not.
32 virtual bool LoadAndSave(
33 const SavePageRequest& request,
34 const CompletionCallback& callback) = 0;
35
36 // Clears the currently processing request, if any.
37 virtual void Cancel() = 0;
38
39 // TODO(dougarnett): add policy support methods.
40 };
41
42 } // namespace offline_pages
43
44 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_OFFLINER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698