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

Unified Diff: chrome/browser/policy/configuration_policy_reader.cc

Issue 7941008: Cosmetic cleanups in chrome/browser/policy/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Upload was broken? Created 9 years, 3 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
« no previous file with comments | « chrome/browser/policy/configuration_policy_reader.h ('k') | chrome/browser/policy/delayed_work_scheduler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/configuration_policy_reader.cc
diff --git a/chrome/browser/policy/configuration_policy_reader.cc b/chrome/browser/policy/configuration_policy_reader.cc
index f9e39b882dfbc97e0d41d7538a49eecf28a69daf..9dd1d4ae8dde2f4e747648ead726cf6d9004ece3 100644
--- a/chrome/browser/policy/configuration_policy_reader.cc
+++ b/chrome/browser/policy/configuration_policy_reader.cc
@@ -7,7 +7,9 @@
#include <map>
#include <vector>
+#include "base/logging.h"
#include "base/stl_util.h"
+#include "base/string16.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/policy/browser_policy_connector.h"
@@ -77,10 +79,7 @@ void ConfigurationPolicyStatusKeeper::GetPoliciesFromProvider(
PolicyMap::const_iterator policy = policies->begin();
for ( ; policy != policies->end(); ++policy) {
string16 name = PolicyStatus::GetPolicyName(policy->first);
-
- if (name == string16()) {
- NOTREACHED();
- }
+ DCHECK(!name.empty());
// TODO(simo) actually determine whether the policy is a user or a device
// one and whether the policy could be enforced or not once this information
@@ -153,7 +152,7 @@ ConfigurationPolicyReader*
g_browser_process->browser_policy_connector();
return new ConfigurationPolicyReader(
connector->GetRecommendedPlatformProvider(),
- PolicyStatusInfo::RECOMMENDED);
+ PolicyStatusInfo::RECOMMENDED);
}
// static
@@ -180,10 +179,8 @@ void ConfigurationPolicyReader::Refresh() {
if (!provider_)
return;
- // Read policy state into a new keeper and swap out old keeper.
- scoped_ptr<ConfigurationPolicyStatusKeeper> new_keeper(
+ policy_keeper_.reset(
new ConfigurationPolicyStatusKeeper(provider_, policy_level_));
- policy_keeper_.reset(new_keeper.release());
FOR_EACH_OBSERVER(Observer, observers_, OnPolicyValuesChanged());
}
@@ -250,7 +247,7 @@ ListValue* PolicyStatus::GetPolicyStatusList(bool* any_policies_set) const {
string16 PolicyStatus::GetPolicyName(ConfigurationPolicyType policy_type) {
static std::map<ConfigurationPolicyType, string16> name_map;
static const ConfigurationPolicyProvider::PolicyDefinitionList*
- supported_policies;
+ supported_policies = NULL;
if (!supported_policies) {
supported_policies =
« no previous file with comments | « chrome/browser/policy/configuration_policy_reader.h ('k') | chrome/browser/policy/delayed_work_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698