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

Unified Diff: chromeos/network/network_state_handler.cc

Issue 14729017: Add NetworkHandler to own network handlers in src/chromeos/network (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + Add NetworkConnectionHandler to NetworkHandler Created 7 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
Index: chromeos/network/network_state_handler.cc
diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc
index a1909a4f485fa7273aa77bafae0e973ea2af98d8..6d504877a2de3ab926a0d20ec17fc40f33bc5361 100644
--- a/chromeos/network/network_state_handler.cc
+++ b/chromeos/network/network_state_handler.cc
@@ -87,8 +87,6 @@ const char NetworkStateHandler::kMatchTypeWireless[] = "wireless";
const char NetworkStateHandler::kMatchTypeMobile[] = "mobile";
const char NetworkStateHandler::kMatchTypeNonVirtual[] = "non-virtual";
-static NetworkStateHandler* g_network_state_handler = NULL;
-
NetworkStateHandler::NetworkStateHandler() {
}
@@ -103,29 +101,10 @@ void NetworkStateHandler::InitShillPropertyHandler() {
}
// static
-void NetworkStateHandler::Initialize() {
- CHECK(!g_network_state_handler);
- g_network_state_handler = new NetworkStateHandler();
- g_network_state_handler->InitShillPropertyHandler();
-}
-
-// static
-bool NetworkStateHandler::IsInitialized() {
- return g_network_state_handler != NULL;
-}
-
-// static
-void NetworkStateHandler::Shutdown() {
- CHECK(g_network_state_handler);
- delete g_network_state_handler;
- g_network_state_handler = NULL;
-}
-
-// static
-NetworkStateHandler* NetworkStateHandler::Get() {
- CHECK(g_network_state_handler)
- << "NetworkStateHandler::Get() called before Initialize()";
- return g_network_state_handler;
+NetworkStateHandler* NetworkStateHandler::InitializeForTest() {
+ NetworkStateHandler* handler = new NetworkStateHandler();
+ handler->InitShillPropertyHandler();
+ return handler;
}
void NetworkStateHandler::AddObserver(NetworkStateHandlerObserver* observer) {

Powered by Google App Engine
This is Rietveld 408576698