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 23 matching lines...) Expand all Loading... |
34 OfflinePageModel* offline_page_model); | 34 OfflinePageModel* offline_page_model); |
35 ~BackgroundLoaderOffliner() override; | 35 ~BackgroundLoaderOffliner() override; |
36 | 36 |
37 // Offliner implementation. | 37 // Offliner implementation. |
38 bool LoadAndSave(const SavePageRequest& request, | 38 bool LoadAndSave(const SavePageRequest& request, |
39 const CompletionCallback& callback) override; | 39 const CompletionCallback& callback) override; |
40 void Cancel() override; | 40 void Cancel() override; |
41 | 41 |
42 // WebContentsObserver implementation. | 42 // WebContentsObserver implementation. |
43 void DidStopLoading() override; | 43 void DidStopLoading() override; |
| 44 void RenderProcessGone(base::TerminationStatus status) override; |
| 45 void WebContentsDestroyed() override; |
44 | 46 |
45 protected: | 47 protected: |
46 // Called to reset internal loader and observer state. | 48 // Called to reset internal loader and observer state. |
47 virtual void ResetState(); | 49 virtual void ResetState(); |
48 | 50 |
49 private: | 51 private: |
50 friend class TestBackgroundLoaderOffliner; | 52 friend class TestBackgroundLoaderOffliner; |
51 | 53 |
52 enum SaveState { NONE, SAVING, DELETE_AFTER_SAVE }; | 54 enum SaveState { NONE, SAVING, DELETE_AFTER_SAVE }; |
53 | 55 |
(...skipping 19 matching lines...) Expand all Loading... |
73 bool is_low_end_device_; | 75 bool is_low_end_device_; |
74 // Save state. | 76 // Save state. |
75 SaveState save_state_; | 77 SaveState save_state_; |
76 | 78 |
77 base::WeakPtrFactory<BackgroundLoaderOffliner> weak_ptr_factory_; | 79 base::WeakPtrFactory<BackgroundLoaderOffliner> weak_ptr_factory_; |
78 DISALLOW_COPY_AND_ASSIGN(BackgroundLoaderOffliner); | 80 DISALLOW_COPY_AND_ASSIGN(BackgroundLoaderOffliner); |
79 }; | 81 }; |
80 | 82 |
81 } // namespace offline_pages | 83 } // namespace offline_pages |
82 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ | 84 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ |
OLD | NEW |