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

Unified Diff: net/base/network_change_notifier_win.h

Issue 2893943002: [NetworkChangeNotifier] Run Windows connection type computation on other thread (Closed)
Patch Set: Nits 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
« no previous file with comments | « no previous file | net/base/network_change_notifier_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_change_notifier_win.h
diff --git a/net/base/network_change_notifier_win.h b/net/base/network_change_notifier_win.h
index 94bab7f8d100213744e72863ebb4a2b0aa6b51b8..687149945d162637e77e5f53c48c119e024d2e18 100644
--- a/net/base/network_change_notifier_win.h
+++ b/net/base/network_change_notifier_win.h
@@ -9,6 +9,7 @@
#include <memory>
+#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
@@ -62,15 +63,21 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierWin
// It is not thread safe, see crbug.com/324913.
virtual ConnectionType RecomputeCurrentConnectionType() const;
+ // Calls RecomputeCurrentConnectionTypeImpl on the DNS thread and runs
+ // |reply_callback| with the type on the calling thread.
+ virtual void RecomputeCurrentConnectionTypeOnDnsThread(
+ base::Callback<void(ConnectionType)> reply_callback) const;
pauljensen 2017/05/26 18:29:40 Instead of having every caller assemble the Callba
jkarlin 2017/05/26 19:03:58 Passing callbacks is more general however. I'd rat
+
void SetCurrentConnectionType(ConnectionType connection_type);
// Notifies IP address change observers of a change immediately, and notifies
// network state change observers on a delay. Must only be called on the
// thread |this| was created on.
- void NotifyObservers();
+ void NotifyObservers(ConnectionType connection_type);
// Forwards connection type notifications to parent class.
void NotifyParentOfConnectionTypeChange();
+ void NotifyParentOfConnectionTypeChangeImpl(ConnectionType connection_type);
// Tries to start listening for a single subsequent address change. Returns
// false on failure. The caller is responsible for updating |is_watching_|.
« no previous file with comments | « no previous file | net/base/network_change_notifier_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698