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_LOADER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ |
6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ | 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void OnPrerenderDomContentLoaded() override; | 78 void OnPrerenderDomContentLoaded() override; |
79 void OnPrerenderStop() override; | 79 void OnPrerenderStop() override; |
80 void OnPrerenderNetworkBytesChanged(int64_t bytes) override; | 80 void OnPrerenderNetworkBytesChanged(int64_t bytes) override; |
81 | 81 |
82 // SnapshotController::Client implementation: | 82 // SnapshotController::Client implementation: |
83 void StartSnapshot() override; | 83 void StartSnapshot() override; |
84 | 84 |
85 // Returns true if the lowbar of snapshotting a page is met. | 85 // Returns true if the lowbar of snapshotting a page is met. |
86 virtual bool IsLowbarMet(); | 86 virtual bool IsLowbarMet(); |
87 | 87 |
| 88 void ObserveResourceTracking(const Offliner::ResourceDataType type, |
| 89 int64_t started_count, |
| 90 int64_t completed_count); |
| 91 |
88 // Returns a JSON dictionary value for analysis of loading progress. | 92 // Returns a JSON dictionary value for analysis of loading progress. |
89 const base::DictionaryValue& GetLoadingSignalData() { return signal_data_; } | 93 const base::DictionaryValue& GetLoadingSignalData() { return signal_data_; } |
90 | 94 |
91 private: | 95 private: |
92 // State of the loader (only one request may be active at a time). | 96 // State of the loader (only one request may be active at a time). |
93 enum class State { | 97 enum class State { |
94 IDLE, // No active load request. | 98 IDLE, // No active load request. |
95 PENDING, // Load request is pending the start of prerendering. | 99 PENDING, // Load request is pending the start of prerendering. |
96 LOADING, // Loading in progress. | 100 LOADING, // Loading in progress. |
97 LOADED, // Loaded and now waiting for requestor to StopLoading(). | 101 LOADED, // Loaded and now waiting for requestor to StopLoading(). |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 151 |
148 // Time in ticks of when we start loading the page. | 152 // Time in ticks of when we start loading the page. |
149 base::TimeTicks load_start_time_; | 153 base::TimeTicks load_start_time_; |
150 | 154 |
151 DISALLOW_COPY_AND_ASSIGN(PrerenderingLoader); | 155 DISALLOW_COPY_AND_ASSIGN(PrerenderingLoader); |
152 }; | 156 }; |
153 | 157 |
154 } // namespace offline_pages | 158 } // namespace offline_pages |
155 | 159 |
156 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ | 160 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ |
OLD | NEW |