Commit 3309aea0 authored by sergeyu@chromium.org's avatar sergeyu@chromium.org

Destroy NetworkChangeNotifier on the thread on which it is created

Previously NetworkChangeNotifier was created on UI thread, but could be 
destroyed on some other random thread, which could cause the crash in the 
linked bug.

Moved creation and destruction of the NetworkChangeNotifier to the 
network thread.

BUG=179476


Review URL: https://chromiumcodereview.appspot.com/12703020

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190549 0039d316-1c4b-4281-b951-d872f2087c98
parent b14f3a57
......@@ -331,9 +331,6 @@ HostProcess::HostProcess(scoped_ptr<ChromotingHostContext> context,
#endif // defined(REMOTING_MULTI_PROCESS)
ALLOW_THIS_IN_INITIALIZER_LIST(self_(this)),
exit_code_out_(exit_code_out) {
// Create a NetworkChangeNotifier for use by the signalling connector.
network_change_notifier_.reset(net::NetworkChangeNotifier::Create());
// Create the platform-specific curtain-mode implementation.
// TODO(wez): Create this on the network thread?
curtain_ = CurtainMode::Create(
......@@ -913,6 +910,9 @@ void HostProcess::StartHost() {
new DnsBlackholeChecker(context_->url_request_context_getter(),
talkgadget_prefix_));
// Create a NetworkChangeNotifier for use by the signaling connector.
network_change_notifier_.reset(net::NetworkChangeNotifier::Create());
signaling_connector_.reset(new SignalingConnector(
signal_strategy_.get(),
context_->url_request_context_getter(),
......@@ -1072,6 +1072,7 @@ void HostProcess::ShutdownOnNetworkThread() {
host_change_notification_listener_.reset();
signaling_connector_.reset();
signal_strategy_.reset();
network_change_notifier_.reset();
if (state_ == HOST_STOPPING_TO_RESTART) {
StartHost();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment