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

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

Issue 2857063002: Add a way to send the resource percentage signal to the RC. (Closed)
Patch Set: Turn off other metrics which might require tab helpers when background loading 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/request_coordinator.h
diff --git a/components/offline_pages/core/background/request_coordinator.h b/components/offline_pages/core/background/request_coordinator.h
index 05a1bace1c5af8f0c0ee124544b0c09af0519813..fbb65bf3330a0697596a07bc1a13bc87863fc89d 100644
--- a/components/offline_pages/core/background/request_coordinator.h
+++ b/components/offline_pages/core/background/request_coordinator.h
@@ -23,6 +23,8 @@
#include "components/offline_pages/core/background/request_coordinator_event_logger.h"
#include "components/offline_pages/core/background/request_notifier.h"
#include "components/offline_pages/core/background/request_queue.h"
+#include "components/offline_pages/core/background/resource_data_type.h"
+#include "components/offline_pages/core/background/resource_tracker_observer.h"
#include "components/offline_pages/core/background/scheduler.h"
#include "net/nqe/network_quality_estimator.h"
#include "url/gurl.h"
@@ -38,7 +40,8 @@ class ClientPolicyController;
// Coordinates queueing and processing save page later requests.
class RequestCoordinator : public KeyedService,
public RequestNotifier,
- public base::SupportsUserData {
+ public base::SupportsUserData,
+ public ResourceTrackerObserver {
public:
// Nested observer class. To make sure that no events are missed, the client
// code should first register for notifications, then |GetAllRequests|, and
@@ -181,6 +184,13 @@ class RequestCoordinator : public KeyedService,
void StartImmediatelyForTest() { StartImmediatelyIfConnected(); }
+ // Implementation of ResourceTrackerObserver interface
+ // 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;
+
// Observers implementing the RequestCoordinator::Observer interface can
// register here to get notifications of changes to request state. This
// pointer is not owned, and it is the callers responsibility to remove the

Powered by Google App Engine
This is Rietveld 408576698