summaryrefslogtreecommitdiffstats
path: root/extensions/common/manifest_handlers
diff options
context:
space:
mode:
authorricea <ricea@chromium.org>2015-09-25 11:45:13 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-25 18:46:07 +0000
commitc700927282ae201df4e0938cfbaeefa4a96bfc80 (patch)
tree2eb3e9ad671e2b9c1aaa53de210c568ffe2301c8 /extensions/common/manifest_handlers
parent1c5d55a1edfc5da9f019e866ab426064ea292d40 (diff)
downloadchromium_src-c700927282ae201df4e0938cfbaeefa4a96bfc80.zip
chromium_src-c700927282ae201df4e0938cfbaeefa4a96bfc80.tar.gz
chromium_src-c700927282ae201df4e0938cfbaeefa4a96bfc80.tar.bz2
Use the appropriate variant of IntToString in //extensions
Using the wrong variant of IntToString() can lead to unexpected behaviour and bugs. Use the appropriate variant for the type being converted. No behaviour change intended. BUG=505479 TEST=compiled Review URL: https://codereview.chromium.org/1352893003 Cr-Commit-Position: refs/heads/master@{#350874}
Diffstat (limited to 'extensions/common/manifest_handlers')
-rw-r--r--extensions/common/manifest_handlers/app_isolation_info.cc3
-rw-r--r--extensions/common/manifest_handlers/background_info.cc2
-rw-r--r--extensions/common/manifest_handlers/file_handler_info.cc10
-rw-r--r--extensions/common/manifest_handlers/nacl_modules_handler.cc4
-rw-r--r--extensions/common/manifest_handlers/sandboxed_page_info.cc2
-rw-r--r--extensions/common/manifest_handlers/shared_module_info.cc10
-rw-r--r--extensions/common/manifest_handlers/web_accessible_resources_info.cc2
-rw-r--r--extensions/common/manifest_handlers/webview_info.cc6
8 files changed, 18 insertions, 21 deletions
diff --git a/extensions/common/manifest_handlers/app_isolation_info.cc b/extensions/common/manifest_handlers/app_isolation_info.cc
index 423976c..0c4a738 100644
--- a/extensions/common/manifest_handlers/app_isolation_info.cc
+++ b/extensions/common/manifest_handlers/app_isolation_info.cc
@@ -68,8 +68,7 @@ bool AppIsolationHandler::Parse(Extension* extension, base::string16* error) {
std::string isolation_string;
if (!isolation_list->GetString(i, &isolation_string)) {
*error = ErrorUtils::FormatErrorMessageUTF16(
- manifest_errors::kInvalidIsolationValue,
- base::UintToString(i));
+ manifest_errors::kInvalidIsolationValue, base::SizeTToString(i));
return false;
}
diff --git a/extensions/common/manifest_handlers/background_info.cc b/extensions/common/manifest_handlers/background_info.cc
index 3d57568..37da001 100644
--- a/extensions/common/manifest_handlers/background_info.cc
+++ b/extensions/common/manifest_handlers/background_info.cc
@@ -133,7 +133,7 @@ bool BackgroundInfo::LoadBackgroundScripts(const Extension* extension,
std::string script;
if (!background_scripts->GetString(i, &script)) {
*error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidBackgroundScript, base::IntToString(i));
+ errors::kInvalidBackgroundScript, base::SizeTToString(i));
return false;
}
background_scripts_.push_back(script);
diff --git a/extensions/common/manifest_handlers/file_handler_info.cc b/extensions/common/manifest_handlers/file_handler_info.cc
index 1323252..2ed0ce6 100644
--- a/extensions/common/manifest_handlers/file_handler_info.cc
+++ b/extensions/common/manifest_handlers/file_handler_info.cc
@@ -82,9 +82,8 @@ bool LoadFileHandler(const std::string& handler_id,
for (size_t i = 0; i < mime_types->GetSize(); ++i) {
if (!mime_types->GetString(i, &type)) {
*error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidFileHandlerTypeElement,
- handler_id,
- std::string(base::IntToString(i)));
+ errors::kInvalidFileHandlerTypeElement, handler_id,
+ base::SizeTToString(i));
return false;
}
handler.types.insert(type);
@@ -96,9 +95,8 @@ bool LoadFileHandler(const std::string& handler_id,
for (size_t i = 0; i < file_extensions->GetSize(); ++i) {
if (!file_extensions->GetString(i, &file_extension)) {
*error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidFileHandlerExtensionElement,
- handler_id,
- std::string(base::IntToString(i)));
+ errors::kInvalidFileHandlerExtensionElement, handler_id,
+ base::SizeTToString(i));
return false;
}
handler.extensions.insert(file_extension);
diff --git a/extensions/common/manifest_handlers/nacl_modules_handler.cc b/extensions/common/manifest_handlers/nacl_modules_handler.cc
index 6715b2e..4fd7a97 100644
--- a/extensions/common/manifest_handlers/nacl_modules_handler.cc
+++ b/extensions/common/manifest_handlers/nacl_modules_handler.cc
@@ -60,7 +60,7 @@ bool NaClModulesHandler::Parse(Extension* extension, base::string16* error) {
std::string path_str;
if (!module_value->GetString(keys::kNaClModulesPath, &path_str)) {
*error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidNaClModulesPath, base::IntToString(i));
+ errors::kInvalidNaClModulesPath, base::SizeTToString(i));
return false;
}
@@ -68,7 +68,7 @@ bool NaClModulesHandler::Parse(Extension* extension, base::string16* error) {
std::string mime_type;
if (!module_value->GetString(keys::kNaClModulesMIMEType, &mime_type)) {
*error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidNaClModulesMIMEType, base::IntToString(i));
+ errors::kInvalidNaClModulesMIMEType, base::SizeTToString(i));
return false;
}
diff --git a/extensions/common/manifest_handlers/sandboxed_page_info.cc b/extensions/common/manifest_handlers/sandboxed_page_info.cc
index 2471e93..7da5483 100644
--- a/extensions/common/manifest_handlers/sandboxed_page_info.cc
+++ b/extensions/common/manifest_handlers/sandboxed_page_info.cc
@@ -74,7 +74,7 @@ bool SandboxedPageHandler::Parse(Extension* extension, base::string16* error) {
std::string relative_path;
if (!list_value->GetString(i, &relative_path)) {
*error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidSandboxedPage, base::IntToString(i));
+ errors::kInvalidSandboxedPage, base::SizeTToString(i));
return false;
}
URLPattern pattern(URLPattern::SCHEME_EXTENSION);
diff --git a/extensions/common/manifest_handlers/shared_module_info.cc b/extensions/common/manifest_handlers/shared_module_info.cc
index 99efe88..8fd1ab9 100644
--- a/extensions/common/manifest_handlers/shared_module_info.cc
+++ b/extensions/common/manifest_handlers/shared_module_info.cc
@@ -146,7 +146,7 @@ bool SharedModuleInfo::Parse(const Extension* extension,
if (!whitelist->GetString(i, &extension_id) ||
!crx_file::id_util::IdIsValid(extension_id)) {
*error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidExportWhitelistString, base::IntToString(i));
+ errors::kInvalidExportWhitelistString, base::SizeTToString(i));
return false;
}
export_whitelist_.insert(extension_id);
@@ -170,8 +170,8 @@ bool SharedModuleInfo::Parse(const Extension* extension,
imports_.push_back(ImportInfo());
if (!import_entry->GetString(keys::kId, &extension_id) ||
!crx_file::id_util::IdIsValid(extension_id)) {
- *error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidImportId, base::IntToString(i));
+ *error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidImportId,
+ base::SizeTToString(i));
return false;
}
imports_.back().extension_id = extension_id;
@@ -179,14 +179,14 @@ bool SharedModuleInfo::Parse(const Extension* extension,
std::string min_version;
if (!import_entry->GetString(keys::kMinimumVersion, &min_version)) {
*error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidImportVersion, base::IntToString(i));
+ errors::kInvalidImportVersion, base::SizeTToString(i));
return false;
}
imports_.back().minimum_version = min_version;
Version v(min_version);
if (!v.IsValid()) {
*error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidImportVersion, base::IntToString(i));
+ errors::kInvalidImportVersion, base::SizeTToString(i));
return false;
}
}
diff --git a/extensions/common/manifest_handlers/web_accessible_resources_info.cc b/extensions/common/manifest_handlers/web_accessible_resources_info.cc
index 8da6bf5..ec188ae 100644
--- a/extensions/common/manifest_handlers/web_accessible_resources_info.cc
+++ b/extensions/common/manifest_handlers/web_accessible_resources_info.cc
@@ -74,7 +74,7 @@ bool WebAccessibleResourcesHandler::Parse(Extension* extension,
std::string relative_path;
if (!list_value->GetString(i, &relative_path)) {
*error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidWebAccessibleResource, base::IntToString(i));
+ errors::kInvalidWebAccessibleResource, base::SizeTToString(i));
return false;
}
URLPattern pattern(URLPattern::SCHEME_EXTENSION);
diff --git a/extensions/common/manifest_handlers/webview_info.cc b/extensions/common/manifest_handlers/webview_info.cc
index 3359c80..9adbcbe 100644
--- a/extensions/common/manifest_handlers/webview_info.cc
+++ b/extensions/common/manifest_handlers/webview_info.cc
@@ -118,14 +118,14 @@ bool WebviewHandler::Parse(Extension* extension, base::string16* error) {
const base::DictionaryValue* partition = NULL;
if (!partition_list->GetDictionary(i, &partition)) {
*error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidWebviewPartition, base::IntToString(i));
+ errors::kInvalidWebviewPartition, base::SizeTToString(i));
return false;
}
std::string partition_pattern;
if (!partition->GetString(keys::kWebviewName, &partition_pattern)) {
*error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidWebviewPartitionName, base::IntToString(i));
+ errors::kInvalidWebviewPartitionName, base::SizeTToString(i));
return false;
}
@@ -151,7 +151,7 @@ bool WebviewHandler::Parse(Extension* extension, base::string16* error) {
std::string relative_path;
if (!url_list->GetString(i, &relative_path)) {
*error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidWebviewAccessibleResource, base::IntToString(i));
+ errors::kInvalidWebviewAccessibleResource, base::SizeTToString(i));
return false;
}
URLPattern pattern(URLPattern::SCHEME_EXTENSION,