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

Unified Diff: components/policy/core/browser/configuration_policy_handler.cc

Issue 1391893003: NOT FOR REVIEW: Aura on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
Index: components/policy/core/browser/configuration_policy_handler.cc
diff --git a/components/policy/core/browser/configuration_policy_handler.cc b/components/policy/core/browser/configuration_policy_handler.cc
index a2215292cdbb32cb389c5524abb4b6296d83567d..5802ee4d3704b10753e9d71bd29491757b1ee860 100644
--- a/components/policy/core/browser/configuration_policy_handler.cc
+++ b/components/policy/core/browser/configuration_policy_handler.cc
@@ -323,7 +323,8 @@ SchemaValidatingPolicyHandler::SchemaValidatingPolicyHandler(
Schema schema,
SchemaOnErrorStrategy strategy)
: policy_name_(policy_name), schema_(schema), strategy_(strategy) {
- DCHECK(schema_.valid());
+ // TODO(mfomitchev): fix this
+// DCHECK(schema_.valid());
}
SchemaValidatingPolicyHandler::~SchemaValidatingPolicyHandler() {
@@ -336,6 +337,10 @@ const char* SchemaValidatingPolicyHandler::policy_name() const {
bool SchemaValidatingPolicyHandler::CheckPolicySettings(
const PolicyMap& policies,
PolicyErrorMap* errors) {
+ if (!schema_.valid()) {
+ LOG(ERROR) << "auraclank: Invalid policy " << policy_name_;
+ return true;
+ }
const base::Value* value = policies.GetValue(policy_name());
if (!value)
return true;
@@ -357,6 +362,10 @@ bool SchemaValidatingPolicyHandler::CheckAndGetValue(
const PolicyMap& policies,
PolicyErrorMap* errors,
scoped_ptr<base::Value>* output) {
+ if (!schema_.valid()) {
+ LOG(ERROR) << "auraclank: Invalid policy " << policy_name_;
+ return true;
+ }
const base::Value* value = policies.GetValue(policy_name());
if (!value)
return true;

Powered by Google App Engine
This is Rietveld 408576698