diff options
author | ckocagil <ckocagil@chromium.org> | 2014-09-22 16:23:45 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-22 23:24:01 +0000 |
commit | 37c3a135b7b14bc10127c3c43dd1f77995dad760 (patch) | |
tree | 0f6783b6321b3386aa4020798f92056feb6c4616 /ui/gfx/render_text_harfbuzz.cc | |
parent | 4ca5434de578a41cb86535cfd78cf2ce6659cd24 (diff) | |
download | chromium_src-37c3a135b7b14bc10127c3c43dd1f77995dad760.zip chromium_src-37c3a135b7b14bc10127c3c43dd1f77995dad760.tar.gz chromium_src-37c3a135b7b14bc10127c3c43dd1f77995dad760.tar.bz2 |
RTHB: Limit text to 10k code units
BUG=244679
R=msw
Review URL: https://codereview.chromium.org/594683002
Cr-Commit-Position: refs/heads/master@{#296088}
Diffstat (limited to 'ui/gfx/render_text_harfbuzz.cc')
-rw-r--r-- | ui/gfx/render_text_harfbuzz.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc index 7994a80..442199a 100644 --- a/ui/gfx/render_text_harfbuzz.cc +++ b/ui/gfx/render_text_harfbuzz.cc @@ -28,6 +28,9 @@ namespace gfx { namespace { +// Text length limit. Longer strings are slow and not fully tested. +const size_t kMaxTextLength = 10000; + // The maximum number of scripts a Unicode character can belong to. This value // is arbitrarily chosen to be a good limit because it is unlikely for a single // character to belong to more scripts. @@ -572,7 +575,9 @@ Range TextRunHarfBuzz::GetGraphemeBounds( RenderTextHarfBuzz::RenderTextHarfBuzz() : RenderText(), - needs_layout_(false) {} + needs_layout_(false) { + set_truncate_length(kMaxTextLength); +} RenderTextHarfBuzz::~RenderTextHarfBuzz() {} |