| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |