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

Unified Diff: Source/platform/fonts/FontCustomPlatformData.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: Rebase patch Created 5 years, 6 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
« no previous file with comments | « Source/platform/fonts/FontCustomPlatformData.h ('k') | Source/platform/fonts/opentype/OpenTypeSanitizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/FontCustomPlatformData.cpp
diff --git a/Source/platform/fonts/FontCustomPlatformData.cpp b/Source/platform/fonts/FontCustomPlatformData.cpp
index 1cae8696dde0622b8f6c7993a978996dd3b131e5..fe7dd97331c08ef3e0daa559a8d6b21df8a7711b 100644
--- a/Source/platform/fonts/FontCustomPlatformData.cpp
+++ b/Source/platform/fonts/FontCustomPlatformData.cpp
@@ -85,14 +85,17 @@ FontPlatformData FontCustomPlatformData::fontPlatformData(float size, bool bold,
return FontPlatformData(m_typeface.get(), "", size, bold && !m_typeface->isBold(), italic && !m_typeface->isItalic(), orientation);
}
-PassOwnPtr<FontCustomPlatformData> FontCustomPlatformData::create(SharedBuffer* buffer)
+PassOwnPtr<FontCustomPlatformData> FontCustomPlatformData::create(SharedBuffer* buffer, String& otsParseMessage)
{
ASSERT_ARG(buffer, buffer);
OpenTypeSanitizer sanitizer(buffer);
RefPtr<SharedBuffer> transcodeBuffer = sanitizer.sanitize();
- if (!transcodeBuffer)
+
+ if (!transcodeBuffer) {
+ otsParseMessage = sanitizer.getErrorString();
return nullptr; // validation failed.
+ }
buffer = transcodeBuffer.get();
SkMemoryStream* stream = new SkMemoryStream(buffer->getAsSkData().get());
« no previous file with comments | « Source/platform/fonts/FontCustomPlatformData.h ('k') | Source/platform/fonts/opentype/OpenTypeSanitizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698