Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(765)

Unified Diff: components/offline_pages/core/background/offliner.h

Issue 2857063002: Add a way to send the resource percentage signal to the RC. (Closed)
Patch Set: CR Feedback per Dimich, BMcQuade, and CSHarrison Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/core/background/offliner.h
diff --git a/components/offline_pages/core/background/offliner.h b/components/offline_pages/core/background/offliner.h
index c24aa46300745edaca26dcec929a82796cc605e7..6c861620acab132320977f4f409cca578cf602cc 100644
--- a/components/offline_pages/core/background/offliner.h
+++ b/components/offline_pages/core/background/offliner.h
@@ -70,6 +70,23 @@ class Offliner {
STATUS_COUNT
};
+ enum ResourceDataType {
+ APPLICATION,
+ MEDIA,
+ EXAMPLE,
+ IMAGE,
+ MESSAGE,
+ MODEL,
+ MULTIPART,
+ TEXT_CSS,
+ TEXT_HTML,
+ TEXT_PLAIN,
+ TEXT_SCRIPT,
+ XHR,
+ OTHER,
+ RESOURCE_DATA_TYPE_COUNT,
+ };
+
// Reports the load progress of a request.
typedef base::Callback<void(const SavePageRequest&, int64_t received_bytes)>
ProgressCallback;
@@ -102,6 +119,12 @@ class Offliner {
// offlining will be provided by |completion_callback|.
virtual bool HandleTimeout(int64_t request_id) = 0;
+ // We are notified of a resource load starting or ending, we can use this
+ // for tracking loading signals.
+ virtual void ObserveResourceTracking(const ResourceDataType type,
+ int64_t started_count,
+ int64_t completed_count) = 0;
+
// TODO(dougarnett): add policy support methods.
};

Powered by Google App Engine
This is Rietveld 408576698