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 "core/css/RemoteFontFaceSource.h" | 5 #include "core/css/RemoteFontFaceSource.h" |
6 | 6 |
7 #include "core/css/CSSCustomFontData.h" | 7 #include "core/css/CSSCustomFontData.h" |
8 #include "core/css/CSSFontFace.h" | 8 #include "core/css/CSSFontFace.h" |
9 #include "core/css/CSSFontSelector.h" | 9 #include "core/css/CSSFontSelector.h" |
10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 bool RemoteFontFaceSource::isLoaded() const | 72 bool RemoteFontFaceSource::isLoaded() const |
73 { | 73 { |
74 return m_font->isLoaded(); | 74 return m_font->isLoaded(); |
75 } | 75 } |
76 | 76 |
77 bool RemoteFontFaceSource::isValid() const | 77 bool RemoteFontFaceSource::isValid() const |
78 { | 78 { |
79 return !m_font->errorOccurred(); | 79 return !m_font->errorOccurred(); |
80 } | 80 } |
81 | 81 |
82 void RemoteFontFaceSource::fontLoaded(FontResource*) | 82 void RemoteFontFaceSource::notifyFinished(Resource*) |
83 { | 83 { |
84 m_histograms.recordRemoteFont(m_font.get()); | 84 m_histograms.recordRemoteFont(m_font.get()); |
85 m_histograms.fontLoaded(m_isInterventionTriggered); | 85 m_histograms.fontLoaded(m_isInterventionTriggered); |
86 | 86 |
87 m_font->ensureCustomFontData(); | 87 m_font->ensureCustomFontData(); |
88 // FIXME: Provide more useful message such as OTS rejection reason. | 88 // FIXME: Provide more useful message such as OTS rejection reason. |
89 // See crbug.com/97467 | 89 // See crbug.com/97467 |
90 if (m_font->getStatus() == Resource::DecodeError && m_fontSelector->document
()) { | 90 if (m_font->getStatus() == Resource::DecodeError && m_fontSelector->document
()) { |
91 m_fontSelector->document()->addConsoleMessage(ConsoleMessage::create(Oth
erMessageSource, WarningMessageLevel, "Failed to decode downloaded font: " + m_f
ont->url().elidedString())); | 91 m_fontSelector->document()->addConsoleMessage(ConsoleMessage::create(Oth
erMessageSource, WarningMessageLevel, "Failed to decode downloaded font: " + m_f
ont->url().elidedString())); |
92 if (m_font->otsParsingMessage().length() > 1) | 92 if (m_font->otsParsingMessage().length() > 1) |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 interventionResult |= 1 << 0; | 288 interventionResult |= 1 << 0; |
289 if (triggered) | 289 if (triggered) |
290 interventionResult |= 1 << 1; | 290 interventionResult |= 1 << 1; |
291 const int boundary = 1 << 2; | 291 const int boundary = 1 << 2; |
292 | 292 |
293 DEFINE_STATIC_LOCAL(EnumerationHistogram, interventionHistogram, ("WebFont.I
nterventionResult", boundary)); | 293 DEFINE_STATIC_LOCAL(EnumerationHistogram, interventionHistogram, ("WebFont.I
nterventionResult", boundary)); |
294 interventionHistogram.count(interventionResult); | 294 interventionHistogram.count(interventionResult); |
295 } | 295 } |
296 | 296 |
297 } // namespace blink | 297 } // namespace blink |
OLD | NEW |