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

Unified Diff: webrtc/base/networkmonitor.cc

Issue 1556743002: Bind a socket to a network if the network handle is set. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix a compiling issue for Windows Created 4 years, 11 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: webrtc/base/networkmonitor.cc
diff --git a/webrtc/base/networkmonitor.cc b/webrtc/base/networkmonitor.cc
index 92bf0592b5fa3932b243968c93b3759c1e93365d..63e92f51227486875a795680ed09af72a4411afa 100644
--- a/webrtc/base/networkmonitor.cc
+++ b/webrtc/base/networkmonitor.cc
@@ -26,11 +26,17 @@ NetworkMonitorInterface::NetworkMonitorInterface() {}
NetworkMonitorInterface::~NetworkMonitorInterface() {}
-NetworkMonitorBase::NetworkMonitorBase() : thread_(Thread::Current()) {}
+NetworkMonitorBase::NetworkMonitorBase() : thread_(nullptr) {}
NetworkMonitorBase::~NetworkMonitorBase() {}
+void NetworkMonitorBase::Start() {
pthatcher1 2016/01/14 20:07:24 Should we check to make sure Start() isn't called
honghaiz3 2016/01/15 01:00:38 Removed this change.
+ if (thread_ == nullptr) {
+ thread_ = Thread::Current();
+ }
+}
void NetworkMonitorBase::OnNetworksChanged() {
LOG(LS_VERBOSE) << "Network change is received at the network monitor";
+ ASSERT(thread_ != nullptr);
thread_->Post(this, UPDATE_NETWORKS_MESSAGE);
}

Powered by Google App Engine
This is Rietveld 408576698