Commit 291667f0 authored by Sam Maier's avatar Sam Maier Committed by Commit Bot

resource_bundle: Made all DecompressData functions const

Bug: 1003433
Change-Id: Ia9269aa8c8bcf2aad69c57fa5746d9e26c21cc65
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1802391Reviewed-by: default avatarDan Beam <dbeam@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Auto-Submit: Sam Maier <smaier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697390}
parent a2f194a9
......@@ -632,19 +632,20 @@ base::StringPiece ResourceBundle::GetRawDataResourceForScale(
return base::StringPiece();
}
std::string ResourceBundle::DecompressDataResource(int resource_id) {
std::string ResourceBundle::DecompressDataResource(int resource_id) const {
return DecompressDataResourceScaled(resource_id, ui::SCALE_FACTOR_NONE);
}
std::string ResourceBundle::DecompressDataResourceScaled(
int resource_id,
ScaleFactor scaling_factor) {
ScaleFactor scaling_factor) const {
std::string output;
Decompress(GetRawDataResourceForScale(resource_id, scaling_factor), &output);
return output;
}
std::string ResourceBundle::DecompressLocalizedDataResource(int resource_id) {
std::string ResourceBundle::DecompressLocalizedDataResource(
int resource_id) const {
base::AutoLock lock_scope(*locale_resources_data_lock_);
base::StringPiece data;
if (!(locale_resources_data_.get() &&
......
......@@ -254,16 +254,16 @@ class UI_BASE_EXPORT ResourceBundle {
// into a newly allocated string given the resource id. Todo: Look into
// introducing an Async version of this function in the future.
// Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=973417
std::string DecompressDataResource(int resource_id);
std::string DecompressDataResource(int resource_id) const;
// Return the contents of a scale dependent resource, decompressed into
// a newly allocated string given the resource id.
std::string DecompressDataResourceScaled(int resource_id,
ScaleFactor scaling_factor);
ScaleFactor scaling_factor) const;
// Return the contents of a localized resource, decompressed into a
// newly allocated string given the resource id.
std::string DecompressLocalizedDataResource(int resource_id);
std::string DecompressLocalizedDataResource(int resource_id) const;
// Get a localized string given a message id. Returns an empty string if the
// resource_id is not found.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment