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

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

Issue 2898393002: Split Android-specific dependency from BackgroundLoaderOffliner. Create a subfolder of c/b/offline_… (Closed)
Patch Set: more build fixes Created 3 years, 7 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // number of bytes received from the network (for UI purposes). 90 // number of bytes received from the network (for UI purposes).
91 virtual bool LoadAndSave(const SavePageRequest& request, 91 virtual bool LoadAndSave(const SavePageRequest& request,
92 const CompletionCallback& completion_callback, 92 const CompletionCallback& completion_callback,
93 const ProgressCallback& progress_callback) = 0; 93 const ProgressCallback& progress_callback) = 0;
94 94
95 // Clears the currently processing request, if any, and skips running its 95 // Clears the currently processing request, if any, and skips running its
96 // CompletionCallback. Returns false if there is nothing to cancel, otherwise 96 // CompletionCallback. Returns false if there is nothing to cancel, otherwise
97 // returns true and canceled request will be delivered using callback. 97 // returns true and canceled request will be delivered using callback.
98 virtual bool Cancel(const CancelCallback& callback) = 0; 98 virtual bool Cancel(const CancelCallback& callback) = 0;
99 99
100 // On some external condition changes (RAM pressure, browser backgrounded on
101 // low-level devices, etc) it is needed to terminate a load if there is one
102 // in progress. It is no-op if there is no active request loading.
103 virtual void TerminateLoadIfInProgress() = 0;
104
100 // Handles timeout scenario. Returns true if lowbar is met and try to do a 105 // Handles timeout scenario. Returns true if lowbar is met and try to do a
101 // snapshot of the current webcontents. If that is the case, the result of 106 // snapshot of the current webcontents. If that is the case, the result of
102 // offlining will be provided by |completion_callback|. 107 // offlining will be provided by |completion_callback|.
103 virtual bool HandleTimeout(int64_t request_id) = 0; 108 virtual bool HandleTimeout(int64_t request_id) = 0;
104 109
105 // TODO(dougarnett): add policy support methods. 110 // TODO(dougarnett): add policy support methods.
106 }; 111 };
107 112
108 } // namespace offline_pages 113 } // namespace offline_pages
109 114
110 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_H_ 115 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698