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

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

Issue 2556613003: [OfflinePages] Restarts immediate processing if stopped due to no net (Closed)
Patch Set: 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 e98c630b83734f3d62c4efde03fe57df33aa077b..a71fe1102a6ff9238126746e6da6975bc1c2f534 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"
@@ -256,6 +257,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();
@@ -405,6 +415,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