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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_bidi_paragraph.cc

Issue 2527183002: Add ICUError to handle ICU failures (Closed)
Patch Set: eae review, add invalid argument error Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ng/ng_bidi_paragraph.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_bidi_paragraph.cc b/third_party/WebKit/Source/core/layout/ng/ng_bidi_paragraph.cc
index 58337c5237454fa4b8c10b1667ef9119b3145e1b..48b234fadf809732a01dda1a10ee65b3e560ecd2 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_bidi_paragraph.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_bidi_paragraph.cc
@@ -5,6 +5,7 @@
#include "core/layout/ng/ng_bidi_paragraph.h"
#include "core/style/ComputedStyle.h"
+#include "platform/text/ICUError.h"
namespace blink {
@@ -16,13 +17,19 @@ bool NGBidiParagraph::SetParagraph(const String& text,
const ComputedStyle* block_style) {
DCHECK(!ubidi_);
ubidi_ = ubidi_open();
- UErrorCode error = U_ZERO_ERROR;
+ ICUError error;
ubidi_setPara(ubidi_, text.characters16(), text.length(),
block_style->unicodeBidi() == Plaintext
? UBIDI_DEFAULT_LTR
: (block_style->direction() == RTL ? UBIDI_RTL : UBIDI_LTR),
nullptr, &error);
- return U_SUCCESS(error);
+ if (U_FAILURE(error)) {
+ NOTREACHED();
+ ubidi_close(ubidi_);
+ ubidi_ = nullptr;
+ return false;
+ }
+ return true;
}
unsigned NGBidiParagraph::GetLogicalRun(unsigned start,
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698