PolicyManager: Include what you use.

This patch fixes the includes of scoped_ptr. They are now included
from the files that need it, with the sole exception of the .cc files
where it is already included on the corresponding .h file.

Other minor fixes included here.

BUG=None
TEST=Build and unit test passing.
TEST='grep scoped_ptr *' shows that it is included where it is used.

Change-Id: Ic429f2835ae1c867eeb07280c289bca1fe88d4dd
Reviewed-on: https://chromium-review.googlesource.com/196972
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/policy_manager/config_provider.h b/policy_manager/config_provider.h
index 4741b33..b113f2a 100644
--- a/policy_manager/config_provider.h
+++ b/policy_manager/config_provider.h
@@ -5,8 +5,6 @@
 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_CONFIG_PROVIDER_H_
 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_CONFIG_PROVIDER_H_
 
-#include <base/memory/scoped_ptr.h>
-
 #include "update_engine/policy_manager/provider.h"
 #include "update_engine/policy_manager/variable.h"
 
diff --git a/policy_manager/evaluation_context.h b/policy_manager/evaluation_context.h
index b08e296..f894a46 100644
--- a/policy_manager/evaluation_context.h
+++ b/policy_manager/evaluation_context.h
@@ -9,6 +9,7 @@
 
 #include <base/callback.h>
 #include <base/memory/ref_counted.h>
+#include <base/memory/scoped_ptr.h>
 #include <base/memory/weak_ptr.h>
 #include <base/time/time.h>
 
diff --git a/policy_manager/evaluation_context_unittest.cc b/policy_manager/evaluation_context_unittest.cc
index 1ddec84..0af0251 100644
--- a/policy_manager/evaluation_context_unittest.cc
+++ b/policy_manager/evaluation_context_unittest.cc
@@ -5,7 +5,6 @@
 #include <string>
 
 #include <base/bind.h>
-#include <base/memory/scoped_ptr.h>
 #include <gtest/gtest.h>
 
 #include "update_engine/fake_clock.h"
diff --git a/policy_manager/pmtest_utils.h b/policy_manager/pmtest_utils.h
index b41eda8..d9f98ce 100644
--- a/policy_manager/pmtest_utils.h
+++ b/policy_manager/pmtest_utils.h
@@ -5,6 +5,7 @@
 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_PMTEST_UTILS_H_
 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_PMTEST_UTILS_H_
 
+#include <base/memory/scoped_ptr.h>
 #include <base/time/time.h>
 #include <gtest/gtest.h>
 
diff --git a/policy_manager/policy_manager_unittest.cc b/policy_manager/policy_manager_unittest.cc
index d3a847e..9b14a00 100644
--- a/policy_manager/policy_manager_unittest.cc
+++ b/policy_manager/policy_manager_unittest.cc
@@ -8,9 +8,8 @@
 #include <vector>
 
 #include <base/bind.h>
-#include <base/memory/scoped_ptr.h>
-#include <gtest/gtest.h>
 #include <gmock/gmock.h>
+#include <gtest/gtest.h>
 
 #include "update_engine/fake_clock.h"
 #include "update_engine/policy_manager/default_policy.h"
diff --git a/policy_manager/provider.h b/policy_manager/provider.h
index a4e9c54..020a8bc 100644
--- a/policy_manager/provider.h
+++ b/policy_manager/provider.h
@@ -5,6 +5,8 @@
 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_PROVIDER_H_
 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_PROVIDER_H_
 
+#include <base/basictypes.h>
+
 namespace chromeos_policy_manager {
 
 // Abstract base class for a policy provider.
diff --git a/policy_manager/random_provider.h b/policy_manager/random_provider.h
index a5d76f1..1a63b2d 100644
--- a/policy_manager/random_provider.h
+++ b/policy_manager/random_provider.h
@@ -5,8 +5,6 @@
 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_RANDOM_PROVIDER_H_
 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_RANDOM_PROVIDER_H_
 
-#include <base/memory/scoped_ptr.h>
-
 #include "update_engine/policy_manager/provider.h"
 #include "update_engine/policy_manager/variable.h"
 
diff --git a/policy_manager/real_random_provider.h b/policy_manager/real_random_provider.h
index cc27c07..07b6e47 100644
--- a/policy_manager/real_random_provider.h
+++ b/policy_manager/real_random_provider.h
@@ -5,6 +5,8 @@
 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_REAL_RANDOM_PROVIDER_H_
 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_REAL_RANDOM_PROVIDER_H_
 
+#include <base/memory/scoped_ptr.h>
+
 #include "update_engine/policy_manager/random_provider.h"
 
 namespace chromeos_policy_manager {
diff --git a/policy_manager/real_system_provider.h b/policy_manager/real_system_provider.h
index 324a360..01491ac 100644
--- a/policy_manager/real_system_provider.h
+++ b/policy_manager/real_system_provider.h
@@ -5,6 +5,8 @@
 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_REAL_SYSTEM_PROVIDER_H_
 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_REAL_SYSTEM_PROVIDER_H_
 
+#include <base/memory/scoped_ptr.h>
+
 #include <string>
 
 #include "update_engine/policy_manager/system_provider.h"
diff --git a/policy_manager/real_system_provider_unittest.cc b/policy_manager/real_system_provider_unittest.cc
index 51406c3..3082e8f 100644
--- a/policy_manager/real_system_provider_unittest.cc
+++ b/policy_manager/real_system_provider_unittest.cc
@@ -4,6 +4,7 @@
 
 #include "update_engine/policy_manager/real_system_provider.h"
 
+#include <base/memory/scoped_ptr.h>
 #include <gtest/gtest.h>
 
 #include "update_engine/policy_manager/pmtest_utils.h"
diff --git a/policy_manager/real_time_provider.h b/policy_manager/real_time_provider.h
index 84cbf1d..d6d1177 100644
--- a/policy_manager/real_time_provider.h
+++ b/policy_manager/real_time_provider.h
@@ -5,6 +5,7 @@
 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_REAL_TIME_PROVIDER_H_
 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_REAL_TIME_PROVIDER_H_
 
+#include <base/memory/scoped_ptr.h>
 #include <base/time/time.h>
 
 #include "update_engine/clock_interface.h"
@@ -15,7 +16,7 @@
 // TimeProvider concrete implementation.
 class RealTimeProvider : public TimeProvider {
  public:
-  RealTimeProvider(chromeos_update_engine::ClockInterface* clock)
+  explicit RealTimeProvider(chromeos_update_engine::ClockInterface* clock)
       : clock_(clock) {}
 
   // Initializes the provider and returns whether it succeeded.
diff --git a/policy_manager/real_updater_provider.h b/policy_manager/real_updater_provider.h
index adba799..e4b308e 100644
--- a/policy_manager/real_updater_provider.h
+++ b/policy_manager/real_updater_provider.h
@@ -5,8 +5,9 @@
 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_REAL_UPDATER_PROVIDER_H_
 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_REAL_UPDATER_PROVIDER_H_
 
-#include "update_engine/policy_manager/updater_provider.h"
+#include <base/memory/scoped_ptr.h>
 
+#include "update_engine/policy_manager/updater_provider.h"
 #include "update_engine/system_state.h"
 
 namespace chromeos_policy_manager {
diff --git a/policy_manager/shill_provider.h b/policy_manager/shill_provider.h
index 967faae..cd9743b 100644
--- a/policy_manager/shill_provider.h
+++ b/policy_manager/shill_provider.h
@@ -5,7 +5,6 @@
 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_SHILL_PROVIDER_H_
 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_SHILL_PROVIDER_H_
 
-#include <base/memory/scoped_ptr.h>
 #include <base/time/time.h>
 
 #include "update_engine/policy_manager/provider.h"
diff --git a/policy_manager/state_factory.cc b/policy_manager/state_factory.cc
index f9054de..c692522 100644
--- a/policy_manager/state_factory.cc
+++ b/policy_manager/state_factory.cc
@@ -5,10 +5,11 @@
 #include "update_engine/policy_manager/state_factory.h"
 
 #include <base/logging.h>
+#include <base/memory/scoped_ptr.h>
 
 #include "update_engine/clock_interface.h"
-#include "update_engine/policy_manager/real_device_policy_provider.h"
 #include "update_engine/policy_manager/real_config_provider.h"
+#include "update_engine/policy_manager/real_device_policy_provider.h"
 #include "update_engine/policy_manager/real_random_provider.h"
 #include "update_engine/policy_manager/real_shill_provider.h"
 #include "update_engine/policy_manager/real_state.h"
diff --git a/policy_manager/system_provider.h b/policy_manager/system_provider.h
index d319b8c..d18955b 100644
--- a/policy_manager/system_provider.h
+++ b/policy_manager/system_provider.h
@@ -5,8 +5,6 @@
 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_SYSTEM_PROVIDER_H_
 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_SYSTEM_PROVIDER_H_
 
-#include <base/memory/scoped_ptr.h>
-
 #include "update_engine/policy_manager/provider.h"
 #include "update_engine/policy_manager/variable.h"
 
diff --git a/policy_manager/time_provider.h b/policy_manager/time_provider.h
index 8349c01..5baa140 100644
--- a/policy_manager/time_provider.h
+++ b/policy_manager/time_provider.h
@@ -5,7 +5,6 @@
 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_TIME_PROVIDER_H_
 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_TIME_PROVIDER_H_
 
-#include <base/memory/scoped_ptr.h>
 #include <base/time/time.h>
 
 #include "update_engine/policy_manager/provider.h"
@@ -25,9 +24,6 @@
   // consistent with base::Time.
   virtual Variable<int>* var_curr_hour() = 0;
 
-  // TODO(garnold) Implement a method/variable for querying whether a given
-  // point in time was reached.
-
  protected:
   TimeProvider() {}
 
diff --git a/policy_manager/updater_provider.h b/policy_manager/updater_provider.h
index 75f1fb8..85074f6 100644
--- a/policy_manager/updater_provider.h
+++ b/policy_manager/updater_provider.h
@@ -7,7 +7,6 @@
 
 #include <string>
 
-#include <base/memory/scoped_ptr.h>
 #include <base/time/time.h>
 
 #include "update_engine/policy_manager/provider.h"