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

Unified Diff: chrome/service/service_process.cc

Issue 2802015: Massively simplify the NetworkChangeNotifier infrastructure:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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: chrome/service/service_process.cc
===================================================================
--- chrome/service/service_process.cc (revision 50775)
+++ chrome/service/service_process.cc (working copy)
@@ -6,7 +6,7 @@
#include "base/stl_util-inl.h"
#include "chrome/service/cloud_print/cloud_print_proxy.h"
-#include "chrome/service/net/service_network_change_notifier_thread.h"
+#include "net/base/network_change_notifier.h"
ServiceProcess* g_service_process = NULL;
@@ -16,6 +16,7 @@
}
bool ServiceProcess::Initialize() {
+ network_change_notifier_.reset(net::NetworkChangeNotifier::Create());
base::Thread::Options options;
options.message_loop_type = MessageLoop::TYPE_IO;
io_thread_.reset(new base::Thread("ServiceProcess_IO"));
@@ -26,17 +27,16 @@
Teardown();
return false;
}
- network_change_notifier_thread_ =
- new ServiceNetworkChangeNotifierThread(io_thread_->message_loop());
- network_change_notifier_thread_->Initialize();
return true;
}
bool ServiceProcess::Teardown() {
- network_change_notifier_thread_ = NULL;
io_thread_.reset();
file_thread_.reset();
STLDeleteElements(&cloud_print_proxy_list_);
+ // The NetworkChangeNotifier must be destroyed after all other threads that
+ // might use it have been shut down.
+ network_change_notifier_.reset();
return true;
}

Powered by Google App Engine
This is Rietveld 408576698