PolicyManager: Mark protected members as private.
The Google C++ style guide requires members to be private having
a getter and setter with fixed names. This patch moves the protected
members to the private section on the base class for each provider
and adds a protected setter to allow the sub-classes to set these
members on Init().
Also, this patch uniforms the variable names prefixing them with
var_.
BUG=None
TEST=Unit tests still passes.
Change-Id: I4cbf7b7031b430991c12a5c7d9729bafaf359095
Reviewed-on: https://chromium-review.googlesource.com/187979
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/policy_manager/shill_provider.h b/policy_manager/shill_provider.h
index 4b56583..12f15a2 100644
--- a/policy_manager/shill_provider.h
+++ b/policy_manager/shill_provider.h
@@ -47,11 +47,23 @@
protected:
ShillProvider() {}
- scoped_ptr<Variable<bool> > var_is_connected_;
- scoped_ptr<Variable<ShillConnType> > var_conn_type_;
- scoped_ptr<Variable<base::Time> > var_conn_last_changed_;
+ void set_var_is_connected(Variable<bool>* var_is_connected) {
+ var_is_connected_.reset(var_is_connected);
+ }
+
+ void set_var_conn_type(Variable<ShillConnType>* var_conn_type) {
+ var_conn_type_.reset(var_conn_type);
+ }
+
+ void set_var_conn_last_changed(Variable<base::Time>* var_conn_last_changed) {
+ var_conn_last_changed_.reset(var_conn_last_changed);
+ }
private:
+ scoped_ptr<Variable<bool>> var_is_connected_;
+ scoped_ptr<Variable<ShillConnType>> var_conn_type_;
+ scoped_ptr<Variable<base::Time>> var_conn_last_changed_;
+
DISALLOW_COPY_AND_ASSIGN(ShillProvider);
};