| 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 CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ | 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/android/application_status_listener.h" | 10 #include "base/android/application_status_listener.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 protected: | 65 protected: |
| 66 // Called to reset the loader. | 66 // Called to reset the loader. |
| 67 virtual void ResetLoader(); | 67 virtual void ResetLoader(); |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 friend class TestBackgroundLoaderOffliner; | 70 friend class TestBackgroundLoaderOffliner; |
| 71 | 71 |
| 72 enum SaveState { NONE, SAVING, DELETE_AFTER_SAVE }; | 72 enum SaveState { NONE, SAVING, DELETE_AFTER_SAVE }; |
| 73 enum PageLoadState { SUCCESS, RETRIABLE, NONRETRIABLE, DELAY_RETRY }; | 73 enum PageLoadState { SUCCESS, RETRIABLE, NONRETRIABLE, DELAY_RETRY }; |
| 74 | 74 |
| 75 void ResetState(); |
| 76 |
| 75 // Called when the page has been saved. | 77 // Called when the page has been saved. |
| 76 void OnPageSaved(SavePageResult save_result, int64_t offline_id); | 78 void OnPageSaved(SavePageResult save_result, int64_t offline_id); |
| 77 | 79 |
| 78 // Called to reset internal loader and observer state. | 80 // Called to reset internal loader and observer state. |
| 79 void ResetState(); | 81 void ResetState(); |
| 80 | 82 |
| 81 // Called to attach 'this' as the observer to the loader. | 83 // Called to attach 'this' as the observer to the loader. |
| 82 void AttachObservers(); | 84 void AttachObservers(); |
| 83 | 85 |
| 84 // Called when application state has changed. | 86 // Called when application state has changed. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 136 |
| 135 // Callback for cancel. | 137 // Callback for cancel. |
| 136 CancelCallback cancel_callback_; | 138 CancelCallback cancel_callback_; |
| 137 | 139 |
| 138 base::WeakPtrFactory<BackgroundLoaderOffliner> weak_ptr_factory_; | 140 base::WeakPtrFactory<BackgroundLoaderOffliner> weak_ptr_factory_; |
| 139 DISALLOW_COPY_AND_ASSIGN(BackgroundLoaderOffliner); | 141 DISALLOW_COPY_AND_ASSIGN(BackgroundLoaderOffliner); |
| 140 }; | 142 }; |
| 141 | 143 |
| 142 } // namespace offline_pages | 144 } // namespace offline_pages |
| 143 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ | 145 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ |
| OLD | NEW |