shill: Convert ProxyFactory singleton to LazyInstance.
This makes it consistent with the rest of shill's singletons (DHCPProvider,
Resolver, RoutingTable, RTNLHandler) and improves static object's memory
management.
BUG=chromium-os:19178
TEST=unit tests, tested in a VM
Change-Id: Ib403d31473360b46dd25d12508c799cbc73368fd
Reviewed-on: http://gerrit.chromium.org/gerrit/8861
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
diff --git a/cellular.h b/cellular.h
index c633bea..07bdfe9 100644
--- a/cellular.h
+++ b/cellular.h
@@ -24,6 +24,7 @@
class Error;
class ModemSimpleProxyInterface;
+class ProxyFactory;
class Cellular : public Device,
public ModemCDMAProxyListener,
@@ -151,6 +152,7 @@
Error *error);
private:
+ friend class CellularTest;
FRIEND_TEST(CellularTest, Activate);
FRIEND_TEST(CellularTest, ActivateError);
FRIEND_TEST(CellularTest, CreateService);
@@ -314,6 +316,9 @@
uint32 new_state,
uint32 reason);
+ // Store cached copies of singletons for speed/ease of testing.
+ ProxyFactory *proxy_factory_;
+
Type type_;
State state_;
ModemState modem_state_;