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

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

Issue 2546433004: [OfflinePages] Restarts immediate processing if stopped due to no net (Closed)
Patch Set: New test method: CallConnectionTypeObserver() Created 4 years 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/background/request_coordinator.h
diff --git a/components/offline_pages/background/request_coordinator.h b/components/offline_pages/background/request_coordinator.h
index c2d26b77d5fa1249cfcf5d72c3c8fd641b00e66c..8b07e33a3efd9017698225b30fcfa31586c755b2 100644
--- a/components/offline_pages/background/request_coordinator.h
+++ b/components/offline_pages/background/request_coordinator.h
@@ -18,6 +18,7 @@
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "components/keyed_service/core/keyed_service.h"
+#include "components/offline_pages/background/connection_notifier.h"
#include "components/offline_pages/background/device_conditions.h"
#include "components/offline_pages/background/offliner.h"
#include "components/offline_pages/background/request_coordinator_event_logger.h"
@@ -255,6 +256,15 @@ class RequestCoordinator : public KeyedService,
OfflinerImmediateStartStatus TryImmediateStart();
+ // Requests a callback upon the next network connection to start processing.
+ void RequestConnectedEventForStarting();
+
+ // Clears the request for connected event if it was set.
+ void ClearConnectedEventRequest();
+
+ // Handles receiving a connection event. Will start immediate processing.
+ void HandleConnectedEventForStarting();
+
// Check the request queue, and schedule a task corresponding
// to the least restrictive type of request in the queue.
void ScheduleAsNeeded();
@@ -404,6 +414,8 @@ class RequestCoordinator : public KeyedService,
base::OneShotTimer watchdog_timer_;
// Callback invoked when an immediate request is done (default empty).
base::Callback<void(bool)> immediate_schedule_callback_;
+ // Used for potential immediate processing when we get network connection.
+ std::unique_ptr<ConnectionNotifier> connection_notifier_;
// Allows us to pass a weak pointer to callbacks.
base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_;
« no previous file with comments | « components/offline_pages/background/connection_notifier.cc ('k') | components/offline_pages/background/request_coordinator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698