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

Side by Side Diff: Source/core/css/FontLoader.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 unified diff | Download patch
« no previous file with comments | « Source/core/css/FontFace.cpp ('k') | Source/core/fetch/FontResource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/css/FontLoader.h" 6 #include "core/css/FontLoader.h"
7 7
8 #include "core/css/CSSFontSelector.h" 8 #include "core/css/CSSFontSelector.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/dom/IncrementLoadEventDelayCount.h" 10 #include "core/dom/IncrementLoadEventDelayCount.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 if (m_fontSelector) 91 if (m_fontSelector)
92 m_fontSelector->fontFaceInvalidated(); 92 m_fontSelector->fontFaceInvalidated();
93 } 93 }
94 94
95 void FontLoader::didFailToDecode(FontResource* fontResource) 95 void FontLoader::didFailToDecode(FontResource* fontResource)
96 { 96 {
97 // FIXME: Provide more useful message such as OTS rejection reason. 97 // FIXME: Provide more useful message such as OTS rejection reason.
98 // See crbug.com/97467 98 // See crbug.com/97467
99 if (m_fontSelector && m_fontSelector->document()) 99 if (m_fontSelector && m_fontSelector->document())
100 m_fontSelector->document()->addConsoleMessage(ConsoleMessage::create(Oth erMessageSource, WarningMessageLevel, "Failed to decode downloaded font: " + fon tResource->url().elidedString())); 100 m_fontSelector->document()->addConsoleMessage(ConsoleMessage::create(Oth erMessageSource, WarningMessageLevel, "Failed to decode downloaded font: " + fon tResource->url().elidedString()));
101 if (fontResource->otsParsingMessage().length() > 1)
102 m_fontSelector->document()->addConsoleMessage(ConsoleMessage::create (OtherMessageSource, WarningMessageLevel, "OTS parsing error: " + fontResource-> otsParsingMessage()));
101 } 103 }
102 104
103 #if !ENABLE(OILPAN) 105 #if !ENABLE(OILPAN)
104 void FontLoader::clearDocumentAndFontSelector() 106 void FontLoader::clearDocumentAndFontSelector()
105 { 107 {
106 if (!m_document) { 108 if (!m_document) {
107 ASSERT(m_fontsToBeginLoading.isEmpty()); 109 ASSERT(m_fontsToBeginLoading.isEmpty());
108 return; 110 return;
109 } 111 }
110 112
(...skipping 11 matching lines...) Expand all
122 m_fontsToBeginLoading.clear(); 124 m_fontsToBeginLoading.clear();
123 } 125 }
124 126
125 DEFINE_TRACE(FontLoader) 127 DEFINE_TRACE(FontLoader)
126 { 128 {
127 visitor->trace(m_document); 129 visitor->trace(m_document);
128 visitor->trace(m_fontSelector); 130 visitor->trace(m_fontSelector);
129 } 131 }
130 132
131 } // namespace blink 133 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/FontFace.cpp ('k') | Source/core/fetch/FontResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698