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

Unified Diff: chrome/browser/android/vr_shell/textures/url_bar_texture.cc

Issue 2902393002: [vr] Bail on unhandled code points. (Closed)
Patch Set: . Created 3 years, 7 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: chrome/browser/android/vr_shell/textures/url_bar_texture.cc
diff --git a/chrome/browser/android/vr_shell/textures/url_bar_texture.cc b/chrome/browser/android/vr_shell/textures/url_bar_texture.cc
index 23cfaf7af0658d4483275f17607fef0c94c84e5e..966d87728cf8e76482b4187a9fd056ac32947cae 100644
--- a/chrome/browser/android/vr_shell/textures/url_bar_texture.cc
+++ b/chrome/browser/android/vr_shell/textures/url_bar_texture.cc
@@ -102,7 +102,10 @@ gfx::PointF percentToMeters(const gfx::PointF& percent) {
} // namespace
-UrlBarTexture::UrlBarTexture() : security_level_(SecurityLevel::DANGEROUS) {}
+UrlBarTexture::UrlBarTexture(
+ const base::Callback<void(UiUnsupportedMode)>& failure_callback)
+ : security_level_(SecurityLevel::DANGEROUS),
+ failure_callback_(failure_callback) {}
UrlBarTexture::~UrlBarTexture() = default;
@@ -242,7 +245,10 @@ void UrlBarTexture::RenderUrl(const gfx::Size& texture_size,
&parsed, nullptr, nullptr);
int pixel_font_height = texture_size.height() * kFontHeight / kHeight;
- auto font_list = GetFontList(pixel_font_height, text);
+
+ gfx::FontList font_list;
+ if (!GetFontList(pixel_font_height, text, &font_list))
+ failure_callback_.Run(UiUnsupportedMode::kUnhandledCodePoint);
std::unique_ptr<gfx::RenderText> render_text(
gfx::RenderText::CreateInstance());

Powered by Google App Engine
This is Rietveld 408576698