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

Unified Diff: components/json_schema/json_schema_validator.cc

Issue 22807004: Moved chrome/common/json_schema to components/json_schema. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed android isolates Created 7 years, 4 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/json_schema/json_schema_validator.cc
diff --git a/chrome/common/json_schema/json_schema_validator.cc b/components/json_schema/json_schema_validator.cc
similarity index 98%
rename from chrome/common/json_schema/json_schema_validator.cc
rename to components/json_schema/json_schema_validator.cc
index 576923b6b48addd3a42558b25342feca776a596f..ec5f0f8459e467f9981627acd6299001db3f7662 100644
--- a/chrome/common/json_schema/json_schema_validator.cc
+++ b/components/json_schema/json_schema_validator.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/json_schema/json_schema_validator.h"
+#include "components/json_schema/json_schema_validator.h"
#include <algorithm>
#include <cfloat>
@@ -13,7 +13,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
-#include "chrome/common/json_schema/json_schema_constants.h"
+#include "components/json_schema/json_schema_constants.h"
#include "ui/base/l10n/l10n_util.h"
namespace schema = json_schema_constants;
@@ -579,7 +579,7 @@ void JSONSchemaValidator::ValidateArray(const base::ListValue* instance,
for (size_t i = 0; i < instance_size; ++i) {
const base::Value* item = NULL;
CHECK(instance->Get(i, &item));
- std::string i_str = base::UintToString(i);
+ std::string i_str = base::Uint64ToString(i);
std::string item_path = path.empty() ? i_str : (path + "." + i_str);
Validate(item, single_type, item_path);
}
@@ -600,7 +600,7 @@ void JSONSchemaValidator::ValidateTuple(const base::ListValue* instance,
size_t tuple_size = tuple_type ? tuple_type->GetSize() : 0;
if (tuple_type) {
for (size_t i = 0; i < tuple_size; ++i) {
- std::string i_str = base::UintToString(i);
+ std::string i_str = base::Uint64ToString(i);
std::string item_path = path.empty() ? i_str : (path + "." + i_str);
const base::DictionaryValue* item_schema = NULL;
CHECK(tuple_type->GetDictionary(i, &item_schema));
@@ -628,7 +628,7 @@ void JSONSchemaValidator::ValidateTuple(const base::ListValue* instance,
// Any additional properties must validate against the additionalProperties
// schema.
for (size_t i = tuple_size; i < instance_size; ++i) {
- std::string i_str = base::UintToString(i);
+ std::string i_str = base::Uint64ToString(i);
std::string item_path = path.empty() ? i_str : (path + "." + i_str);
const base::Value* item_value = NULL;
CHECK(instance->Get(i, &item_value));
@@ -636,7 +636,7 @@ void JSONSchemaValidator::ValidateTuple(const base::ListValue* instance,
}
} else if (instance_size > tuple_size) {
errors_.push_back(Error(path, FormatErrorMessage(
- kArrayMaxItems, base::UintToString(tuple_size))));
+ kArrayMaxItems, base::Uint64ToString(tuple_size))));
}
}
« no previous file with comments | « components/json_schema/json_schema_validator.h ('k') | components/json_schema/json_schema_validator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698