Commit d95b4e63 authored by dpapad's avatar dpapad Committed by Commit Bot

Replace usages of GetRawDataResource in c/renderer/plugins/.

GetRawDataResource assumes that underlying files are not compressed,
whereas LoadDataResourceString automatically decompresses if necessary.

This is one of many CLs, in preparation of compressing all HTML, JS,
CSS, SVG files by default (meaning without requiring compress="gzip"
to be specified).

Bug: 1068407
Change-Id: Icb1dc7f1911d6b3bce54fa8132d66fb0acf71be5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2145819
Commit-Queue: dpapad <dpapad@chromium.org>
Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758356}
parent ccec3fd0
......@@ -89,9 +89,9 @@ ChromePluginPlaceholder::BindPluginRenderer() {
ChromePluginPlaceholder* ChromePluginPlaceholder::CreateLoadableMissingPlugin(
content::RenderFrame* render_frame,
const blink::WebPluginParams& params) {
const base::StringPiece template_html(
ui::ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_BLOCKED_PLUGIN_HTML));
std::string template_html =
ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(
IDR_BLOCKED_PLUGIN_HTML);
base::DictionaryValue values;
values.SetString("name", "");
......@@ -148,8 +148,9 @@ ChromePluginPlaceholder* ChromePluginPlaceholder::CreateBlockedPlugin(
}
}
const base::StringPiece template_html(
ui::ResourceBundle::GetSharedInstance().GetRawDataResource(template_id));
std::string template_html =
ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(
template_id);
DCHECK(!template_html.empty()) << "unable to load template. ID: "
<< template_id;
......
......@@ -22,9 +22,9 @@ plugins::PluginPlaceholder*
NonLoadablePluginPlaceholder::CreateNotSupportedPlugin(
content::RenderFrame* render_frame,
const blink::WebPluginParams& params) {
const base::StringPiece template_html(
ui::ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_BLOCKED_PLUGIN_HTML));
std::string template_html =
ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(
IDR_BLOCKED_PLUGIN_HTML);
base::DictionaryValue values;
values.SetString("name", "");
......@@ -46,9 +46,9 @@ plugins::PluginPlaceholder* NonLoadablePluginPlaceholder::CreateErrorPlugin(
values.SetString("message",
l10n_util::GetStringUTF8(IDS_PLUGIN_INITIALIZATION_ERROR));
const base::StringPiece template_html(
ui::ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_BLOCKED_PLUGIN_HTML));
std::string template_html =
ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(
IDR_BLOCKED_PLUGIN_HTML);
std::string html_data = webui::GetI18nTemplateHtml(template_html, &values);
blink::WebPluginParams params;
......
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