[shill] Use ref-counted pointers more, break unneeded header deps
1) Replace more bare pointers with ref-counted pointers.
2) Move declarations of *RefPtr into a header file with fwd-declared classes
3) Make class headers include that, move inclusion of real headers to .cc files.
BUG=None
TEST=unit tests
Change-Id: I8208c82377c6dbefe6903561a503b8db63f063d6
Reviewed-on: http://gerrit.chromium.org/gerrit/3177
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/cellular_service.h b/cellular_service.h
index d98be3f..f748377 100644
--- a/cellular_service.h
+++ b/cellular_service.h
@@ -11,19 +11,17 @@
#include <base/basictypes.h>
#include "shill/cellular.h"
-#include "shill/device.h"
+#include "shill/refptr_types.h"
#include "shill/shill_event.h"
#include "shill/service.h"
namespace shill {
-class Cellular;
-
class CellularService : public Service {
public:
CellularService(ControlInterface *control_interface,
EventDispatcher *dispatcher,
- Cellular *device,
+ const CellularRefPtr &device,
const std::string& name);
~CellularService();
void Connect();
@@ -45,7 +43,7 @@
std::map<std::string, std::string> last_good_apn_info_;
private:
- Cellular *cellular_;
+ CellularRefPtr cellular_;
const std::string type_;
DISALLOW_COPY_AND_ASSIGN(CellularService);
};