| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_OFFLINE_PAGES_RESOURCE_LOADING_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_OFFLINE_PAGES_RESOURCE_LOADING_OBSERVER_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 namespace offline_pages { |
| 11 |
| 12 // This interface is used by clients who want to be notified when a resource is |
| 13 // requested or completes loading, and to report the size of the resource. |
| 14 class ResourceLoadingObserver { |
| 15 public: |
| 16 enum ResourceDataType { |
| 17 IMAGE, |
| 18 TEXT_CSS, |
| 19 OTHER, |
| 20 RESOURCE_DATA_TYPE_COUNT, |
| 21 }; |
| 22 |
| 23 // Report when a resource starts or completes loading. |
| 24 virtual void ObserveResourceLoading(ResourceDataType type, bool started) = 0; |
| 25 |
| 26 // Report how many bytes were received for a resource. |
| 27 virtual void OnNetworkBytesChanged(int64_t received_bytes) = 0; |
| 28 }; |
| 29 |
| 30 } // namespace offline_pages |
| 31 |
| 32 #endif // CHROME_BROWSER_OFFLINE_PAGES_RESOURCE_LOADING_OBSERVER_H_ |
| OLD | NEW |