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

Unified Diff: components/policy/core/browser/policy_error_map.h

Issue 144363008: Add support for schema validate error to PolicyErrorMap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@expand-policy-schema-3.5
Patch Set: fix indention Created 6 years, 10 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 | « build/ios/grit_whitelist.txt ('k') | components/policy/core/browser/policy_error_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/browser/policy_error_map.h
diff --git a/components/policy/core/browser/policy_error_map.h b/components/policy/core/browser/policy_error_map.h
index d3cc7479bcc3589266ff8742b0ddfe872d7fca7a..cb9d2ed7bdd998c1969c1351d458786ed90a5945 100644
--- a/components/policy/core/browser/policy_error_map.h
+++ b/components/policy/core/browser/policy_error_map.h
@@ -10,6 +10,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/memory/scoped_vector.h"
#include "base/strings/string16.h"
#include "components/policy/policy_export.h"
@@ -21,6 +22,8 @@ class POLICY_EXPORT PolicyErrorMap {
typedef std::multimap<std::string, base::string16> PolicyMapType;
typedef PolicyMapType::const_iterator const_iterator;
+ class PendingError;
+
PolicyErrorMap();
virtual ~PolicyErrorMap();
@@ -68,6 +71,12 @@ class POLICY_EXPORT PolicyErrorMap {
int message_id,
const std::string& replacement_string);
+ // Adds an entry with key |policy|, the schema validation error location
+ // |error_path|, and detailed error |message|.
+ void AddError(const std::string& policy,
+ const std::string& error_path,
+ const std::string& message);
+
// Returns all the error messages stored for |policy|, separated by a white
// space. Returns an empty string if there are no errors for |policy|.
base::string16 GetErrors(const std::string& policy);
@@ -81,18 +90,16 @@ class POLICY_EXPORT PolicyErrorMap {
void Clear();
private:
- struct PendingError;
-
// Maps the error when ready, otherwise adds it to the pending errors list.
- void AddError(const PendingError& error);
+ void AddError(PendingError* error);
// Converts a PendingError into a |map_| entry.
- void Convert(const PendingError& error);
+ void Convert(PendingError* error);
// Converts all pending errors to |map_| entries.
void CheckReadyAndConvert();
- std::vector<PendingError> pending_;
+ ScopedVector<PendingError> pending_;
PolicyMapType map_;
DISALLOW_COPY_AND_ASSIGN(PolicyErrorMap);
« no previous file with comments | « build/ios/grit_whitelist.txt ('k') | components/policy/core/browser/policy_error_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698