| 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_PRERENDERING_OFFLINER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_H_ | 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_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 21 matching lines...) Expand all Loading... |
| 32 const OfflinerPolicy* policy, | 32 const OfflinerPolicy* policy, |
| 33 OfflinePageModel* offline_page_model); | 33 OfflinePageModel* offline_page_model); |
| 34 ~PrerenderingOffliner() override; | 34 ~PrerenderingOffliner() override; |
| 35 | 35 |
| 36 // Offliner implementation. | 36 // Offliner implementation. |
| 37 bool LoadAndSave(const SavePageRequest& request, | 37 bool LoadAndSave(const SavePageRequest& request, |
| 38 const CompletionCallback& completion_callback, | 38 const CompletionCallback& completion_callback, |
| 39 const ProgressCallback& progress_callback) override; | 39 const ProgressCallback& progress_callback) override; |
| 40 bool Cancel(const CancelCallback& callback) override; | 40 bool Cancel(const CancelCallback& callback) override; |
| 41 bool HandleTimeout(int64_t request_id) override; | 41 bool HandleTimeout(int64_t request_id) override; |
| 42 void ObserveResourceTracking(const ResourceDataType type, |
| 43 int64_t started_count, |
| 44 int64_t completed_count) override; |
| 42 | 45 |
| 43 // Allows a loader to be injected for testing. This may only be done once | 46 // Allows a loader to be injected for testing. This may only be done once |
| 44 // and must be called before any of the Offliner interface methods are called. | 47 // and must be called before any of the Offliner interface methods are called. |
| 45 void SetLoaderForTesting(std::unique_ptr<PrerenderingLoader> loader); | 48 void SetLoaderForTesting(std::unique_ptr<PrerenderingLoader> loader); |
| 46 | 49 |
| 47 void SetLowEndDeviceForTesting(bool is_low_end_device); | 50 void SetLowEndDeviceForTesting(bool is_low_end_device); |
| 48 | 51 |
| 49 void SetApplicationStateForTesting( | 52 void SetApplicationStateForTesting( |
| 50 base::android::ApplicationState application_state); | 53 base::android::ApplicationState application_state); |
| 51 | 54 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // ApplicationStatusListener to monitor if the Chrome moves to the foreground. | 104 // ApplicationStatusListener to monitor if the Chrome moves to the foreground. |
| 102 std::unique_ptr<base::android::ApplicationStatusListener> app_listener_; | 105 std::unique_ptr<base::android::ApplicationStatusListener> app_listener_; |
| 103 base::WeakPtrFactory<PrerenderingOffliner> weak_ptr_factory_; | 106 base::WeakPtrFactory<PrerenderingOffliner> weak_ptr_factory_; |
| 104 | 107 |
| 105 DISALLOW_COPY_AND_ASSIGN(PrerenderingOffliner); | 108 DISALLOW_COPY_AND_ASSIGN(PrerenderingOffliner); |
| 106 }; | 109 }; |
| 107 | 110 |
| 108 } // namespace offline_pages | 111 } // namespace offline_pages |
| 109 | 112 |
| 110 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_H_ | 113 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_H_ |
| OLD | NEW |