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

Unified Diff: Source/platform/fonts/opentype/OpenTypeSanitizer.cpp

Issue 983973004: Provide user friendly messages for OTS parsing of fonts (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code update for test expectation Created 5 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: Source/platform/fonts/opentype/OpenTypeSanitizer.cpp
diff --git a/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp b/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp
index c5e71ae45976e36add0d0c78f017cdfcaa0c23f9..77a62f5057cf8aa6d9120be8d34abed8bc5f54a8 100644
--- a/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp
+++ b/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp
@@ -77,9 +77,14 @@ PassRefPtr<SharedBuffer> OpenTypeSanitizer::sanitize()
double start = currentTime();
BlinkOTSContext otsContext;
- if (!otsContext.Process(&output, reinterpret_cast<const uint8_t*>(m_buffer->data()), m_buffer->size()))
+ if (!otsContext.Process(&output, reinterpret_cast<const uint8_t*>(m_buffer->data()), m_buffer->size())) {
+ setParsingError(true);
+ setErrorString(otsContext.getErrorString());
return nullptr;
+ }
+ setParsingError(false);
+ setErrorString(otsContext.getErrorString());
const size_t transcodeLen = output.Tell();
recordDecodeSpeedHistogram(m_buffer, currentTime() - start, transcodeLen);
return SharedBuffer::create(static_cast<unsigned char*>(output.get()), transcodeLen);

Powered by Google App Engine
This is Rietveld 408576698