| 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_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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // Processes |request| to load and save an offline page. | 68 // Processes |request| to load and save an offline page. |
| 69 // Returns whether the request was accepted or not. |callback| is guaranteed | 69 // Returns whether the request was accepted or not. |callback| is guaranteed |
| 70 // to be called if the request was accepted and |Cancel()| is not called. | 70 // to be called if the request was accepted and |Cancel()| is not called. |
| 71 virtual bool LoadAndSave(const SavePageRequest& request, | 71 virtual bool LoadAndSave(const SavePageRequest& request, |
| 72 const CompletionCallback& callback) = 0; | 72 const CompletionCallback& callback) = 0; |
| 73 | 73 |
| 74 // Clears the currently processing request, if any, and skips running its | 74 // Clears the currently processing request, if any, and skips running its |
| 75 // CompletionCallback. | 75 // CompletionCallback. |
| 76 virtual void Cancel() = 0; | 76 virtual void Cancel() = 0; |
| 77 | 77 |
| 78 // Handles timeout scenario. Returns true if lowbar is met and try to do a |
| 79 // snapshot of the current webcontents. |
| 80 virtual bool HandleTimeout(const SavePageRequest& request) = 0; |
| 81 |
| 78 // TODO(dougarnett): add policy support methods. | 82 // TODO(dougarnett): add policy support methods. |
| 79 }; | 83 }; |
| 80 | 84 |
| 81 } // namespace offline_pages | 85 } // namespace offline_pages |
| 82 | 86 |
| 83 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_H_ | 87 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_H_ |
| OLD | NEW |