Skip to content
Permalink
Browse files
FontGenericFamilies should not be ref-counted.
<https://webkit.org/b/122835>

Reviewed by Anders Carlsson.

FontGenericFamilies is singly-owned by Settings.


Canonical link: https://commits.webkit.org/140924@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Andreas Kling committed Oct 15, 2013
1 parent 18e1ecc commit 968ce27861326451b36740374bc626db1bb43e9e
Showing with 13 additions and 7 deletions.
  1. +9 −0 Source/WebCore/ChangeLog
  2. +1 −1 Source/WebCore/page/Settings.cpp
  3. +1 −1 Source/WebCore/page/Settings.h
  4. +2 −5 Source/WebCore/platform/graphics/FontGenericFamilies.h
@@ -1,3 +1,12 @@
2013-10-15 Andreas Kling <akling@apple.com>

FontGenericFamilies should not be ref-counted.
<https://webkit.org/b/122835>

Reviewed by Anders Carlsson.

FontGenericFamilies is singly-owned by Settings.

2013-10-15 Zoltan Horvath <zoltan@webkit.org>

[CSS Shapes] Move RenderBlock::layoutShapeInsideInfo into RenderBlock.cpp
@@ -136,7 +136,7 @@ static const bool defaultSelectTrailingWhitespaceEnabled = false;
Settings::Settings(Page* page)
: m_page(0)
, m_mediaTypeOverride("screen")
, m_fontGenericFamilies(FontGenericFamilies::create())
, m_fontGenericFamilies(std::make_unique<FontGenericFamilies>())
, m_storageBlockingPolicy(SecurityOrigin::AllowAllStorage)
#if ENABLE(TEXT_AUTOSIZING)
, m_textAutosizingFontScaleFactor(1)
@@ -277,7 +277,7 @@ class Settings : public RefCounted<Settings> {

String m_mediaTypeOverride;
URL m_userStyleSheetLocation;
RefPtr<FontGenericFamilies> m_fontGenericFamilies;
const std::unique_ptr<FontGenericFamilies> m_fontGenericFamilies;
SecurityOrigin::StorageBlockingPolicy m_storageBlockingPolicy;
#if ENABLE(TEXT_AUTOSIZING)
float m_textAutosizingFontScaleFactor;
@@ -27,7 +27,6 @@
#define FontGenericFamilies_h

#include <wtf/HashMap.h>
#include <wtf/RefCounted.h>
#include <wtf/text/AtomicString.h>

namespace WebCore {
@@ -43,9 +42,9 @@ struct UScriptCodeHashTraits : WTF::GenericHashTraits<int> {

typedef HashMap<int, AtomicString, DefaultHash<int>::Hash, UScriptCodeHashTraits> ScriptFontFamilyMap;

class FontGenericFamilies : public RefCounted<FontGenericFamilies> {
class FontGenericFamilies {
public:
static PassRefPtr<FontGenericFamilies> create() { return adoptRef(new FontGenericFamilies); }
FontGenericFamilies();

const AtomicString& standardFontFamily(UScriptCode = USCRIPT_COMMON) const;
const AtomicString& fixedFontFamily(UScriptCode = USCRIPT_COMMON) const;
@@ -64,8 +63,6 @@ class FontGenericFamilies : public RefCounted<FontGenericFamilies> {
bool setPictographFontFamily(const AtomicString&, UScriptCode);

private:
FontGenericFamilies();

ScriptFontFamilyMap m_standardFontFamilyMap;
ScriptFontFamilyMap m_serifFontFamilyMap;
ScriptFontFamilyMap m_fixedFontFamilyMap;

0 comments on commit 968ce27

Please sign in to comment.