From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/css/CSSSegmentedFontFace.h | 64 +++++++++++-------------------- 1 file changed, 22 insertions(+), 42 deletions(-) (limited to 'Source/WebCore/css/CSSSegmentedFontFace.h') diff --git a/Source/WebCore/css/CSSSegmentedFontFace.h b/Source/WebCore/css/CSSSegmentedFontFace.h index fb2b4a730..f66e73393 100644 --- a/Source/WebCore/css/CSSSegmentedFontFace.h +++ b/Source/WebCore/css/CSSSegmentedFontFace.h @@ -10,10 +10,10 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR @@ -23,65 +23,45 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef CSSSegmentedFontFace_h -#define CSSSegmentedFontFace_h +#pragma once +#include "CSSFontFace.h" +#include "FontCache.h" #include -#include #include #include -#include namespace WebCore { -class CSSFontFace; class CSSFontSelector; -class FontData; class FontDescription; -class SegmentedFontData; +class FontRanges; -class CSSSegmentedFontFace : public RefCounted { +class CSSSegmentedFontFace final : public RefCounted, public CSSFontFace::Client { + WTF_MAKE_FAST_ALLOCATED; public: - static PassRefPtr create(CSSFontSelector* selector) { return adoptRef(new CSSSegmentedFontFace(selector)); } + static Ref create() + { + return adoptRef(*new CSSSegmentedFontFace()); + } ~CSSSegmentedFontFace(); - CSSFontSelector* fontSelector() const { return m_fontSelector; } + void appendFontFace(Ref&&); - void fontLoaded(CSSFontFace*); + FontRanges fontRanges(const FontDescription&); - void appendFontFace(PassRefPtr); + Vector, 1>& constituentFaces() { return m_fontFaces; } - PassRefPtr getFontData(const FontDescription&); - -#if ENABLE(FONT_LOAD_EVENTS) - class LoadFontCallback : public RefCounted { - public: - virtual ~LoadFontCallback() { } - virtual void notifyLoaded() = 0; - virtual void notifyError() = 0; - }; - - bool checkFont() const; - void loadFont(const FontDescription&, PassRefPtr loadCallback); -#endif + // CSSFontFace::Client needs to be able to be held in a RefPtr. + void ref() final { RefCounted::ref(); } + void deref() final { RefCounted::deref(); } private: - CSSSegmentedFontFace(CSSFontSelector*); + CSSSegmentedFontFace(); + void fontLoaded(CSSFontFace&) final; - void pruneTable(); - bool isValid() const; -#if ENABLE(FONT_LOAD_EVENTS) - bool isLoading() const; -#endif - - CSSFontSelector* m_fontSelector; - HashMap> m_fontDataTable; - Vector, 1> m_fontFaces; -#if ENABLE(FONT_LOAD_EVENTS) - Vector> m_callbacks; -#endif + HashMap> m_cache; + Vector, 1> m_fontFaces; }; } // namespace WebCore - -#endif // CSSSegmentedFontFace_h -- cgit v1.2.1