Index: components/offline_pages/core/background/resource_tracker_observer_stub.h |
diff --git a/components/offline_pages/core/background/resource_tracker_observer_stub.h b/components/offline_pages/core/background/resource_tracker_observer_stub.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..270b9064dad051919dd8918f80c0ace5518b7826 |
--- /dev/null |
+++ b/components/offline_pages/core/background/resource_tracker_observer_stub.h |
@@ -0,0 +1,37 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_RESOURCE_TRACKER_OBSERVER_STUB_H_ |
+#define COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_RESOURCE_TRACKER_OBSERVER_STUB_H_ |
+ |
+#include "components/offline_pages/core/background/resource_data_type.h" |
+#include "components/offline_pages/core/background/resource_tracker_observer.h" |
+ |
+namespace offline_pages { |
+ |
+class ResourceTrackerObserverStub : public ResourceTrackerObserver { |
+ public: |
+ ResourceTrackerObserverStub(); |
+ |
+ ~ResourceTrackerObserverStub(); |
+ |
+ // When we are notified of a resource load starting or ending, pass the |
+ // information along to the offliner. |
+ void ObserveResourceTracking(const ResourceDataType type, |
+ int64_t started_count, |
+ int64_t completed_count) override; |
+ |
+ // Returns the most recently seen counts for a specific resource type. |
+ void GetResourcePercentageCounts(const ResourceDataType type, |
+ int64_t* started, |
+ int64_t* completed); |
+ |
+ private: |
+ int64_t images_started_; |
+ int64_t images_completed_; |
+}; |
+ |
+} // namespace offline_pages |
+ |
+#endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_RESOURCE_TRACKER_OBSERVER_STUBH_ |