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

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: Fix chromeos_unittests 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 db733487c17cf43782c65bb820bf20b9d188989c..053a932e46bfbd417f134c4830a2b4407ebedce4 100644
--- a/chromeos/network/network_state_handler.cc
+++ b/chromeos/network/network_state_handler.cc
@@ -71,8 +71,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() {
}
@@ -87,29 +85,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) {
« no previous file with comments | « chromeos/network/network_state_handler.h ('k') | content/browser/geolocation/wifi_data_provider_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698