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

Unified Diff: components/domain_reliability/monitor.h

Issue 691053003: Domain Reliability: Mark beacons from previous networks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/domain_reliability/monitor.h
diff --git a/components/domain_reliability/monitor.h b/components/domain_reliability/monitor.h
index 2caa474cadb35a0dd79bf2fd06d9425fc2d6a6ea..60f121abf614b1288b4ec38d1eaaaaf3c4cb0f43 100644
--- a/components/domain_reliability/monitor.h
+++ b/components/domain_reliability/monitor.h
@@ -22,6 +22,7 @@
#include "components/domain_reliability/uploader.h"
#include "components/domain_reliability/util.h"
#include "net/base/load_timing_info.h"
+#include "net/base/network_change_notifier.h"
#include "net/http/http_response_info.h"
#include "net/url_request/url_request_status.h"
@@ -40,7 +41,8 @@ namespace domain_reliability {
// The top-level object that measures requests and hands off the measurements
// to the proper |DomainReliabilityContext|.
-class DOMAIN_RELIABILITY_EXPORT DomainReliabilityMonitor {
+class DOMAIN_RELIABILITY_EXPORT DomainReliabilityMonitor
+ : public net::NetworkChangeNotifier::NetworkChangeObserver {
public:
// Creates a Monitor. |local_state_pref_service| must live on |pref_thread|
// (which should be the current thread); |network_thread| is the thread
@@ -59,7 +61,7 @@ class DOMAIN_RELIABILITY_EXPORT DomainReliabilityMonitor {
// Must be called from the pref thread if |MoveToNetworkThread| was not
// called, or from the network thread if it was called.
- ~DomainReliabilityMonitor();
+ virtual ~DomainReliabilityMonitor();
// Must be called before |InitURLRequestContext| on the same thread on which
// the Monitor was constructed. Moves (most of) the Monitor to the network
@@ -96,6 +98,10 @@ class DOMAIN_RELIABILITY_EXPORT DomainReliabilityMonitor {
// |SetDiscardUploads|.
void OnCompleted(net::URLRequest* request, bool started);
+ // net::NetworkChangeNotifier::NetworkChangeObserver implementation:
+ virtual void OnNetworkChanged(
+ net::NetworkChangeNotifier::ConnectionType type) override;
+
// Called to remove browsing data. With CLEAR_BEACONS, leaves contexts in
// place but clears beacons (which betray browsing history); with
// CLEAR_CONTEXTS, removes all contexts (which can behave as cookies).
@@ -152,6 +158,7 @@ class DOMAIN_RELIABILITY_EXPORT DomainReliabilityMonitor {
base::WeakPtr<DomainReliabilityMonitor> MakeWeakPtr();
scoped_ptr<MockableTime> time_;
+ base::TimeTicks last_network_change_time_;
const std::string upload_reporter_string_;
DomainReliabilityScheduler::Params scheduler_params_;
DomainReliabilityDispatcher dispatcher_;

Powered by Google App Engine
This is Rietveld 408576698