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

Side by Side Diff: third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp

Issue 1894953002: WebFonts: merge fontLoaded() to notifyFinished() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 "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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698