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

Side by Side Diff: Source/core/css/CSSSegmentedFontFaceCache.h

Issue 103273002: CSSSegmentedFontFaceCache should not know about Document. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSFontSelector.cpp ('k') | Source/core/css/CSSSegmentedFontFaceCache.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 27 matching lines...) Expand all
38 class CSSSegmentedFontFace; 38 class CSSSegmentedFontFace;
39 class FontDescription; 39 class FontDescription;
40 class StyleRuleFontFace; 40 class StyleRuleFontFace;
41 41
42 class CSSSegmentedFontFaceCache { 42 class CSSSegmentedFontFaceCache {
43 public: 43 public:
44 CSSSegmentedFontFaceCache(); 44 CSSSegmentedFontFaceCache();
45 45
46 // FIXME: Remove CSSFontSelector as argument. Passing CSSFontSelector here i s 46 // FIXME: Remove CSSFontSelector as argument. Passing CSSFontSelector here i s
47 // a result of egregious spaghettification in CSSFontFace/FontFaceSet. 47 // a result of egregious spaghettification in CSSFontFace/FontFaceSet.
48 void addFontFaceRule(CSSFontSelector*, const StyleRuleFontFace*); 48 void add(CSSFontSelector*, const StyleRuleFontFace*, PassRefPtr<CSSFontFace> );
49 void removeFontFaceRule(const StyleRuleFontFace*); 49 void remove(const StyleRuleFontFace*);
50 CSSSegmentedFontFace* getFontFace(const FontDescription&, const AtomicString & family); 50 // FIXME: It's sort of weird that add/remove uses StyleRuleFontFace* as key,
51 // but this function uses FontDescription/family pair.
52 CSSSegmentedFontFace* get(const FontDescription&, const AtomicString& family );
51 53
52 unsigned version() const { return m_version; } 54 unsigned version() const { return m_version; }
53 55
54 private: 56 private:
55 typedef HashMap<unsigned, RefPtr<CSSSegmentedFontFace> > TraitsMap; 57 typedef HashMap<unsigned, RefPtr<CSSSegmentedFontFace> > TraitsMap;
56 typedef HashMap<String, OwnPtr<TraitsMap>, CaseFoldingHash> FamilyToTraitsMa p; 58 typedef HashMap<String, OwnPtr<TraitsMap>, CaseFoldingHash> FamilyToTraitsMa p;
57 typedef HashMap<const StyleRuleFontFace*, RefPtr<CSSFontFace> > StyleRuleToF ontFace; 59 typedef HashMap<const StyleRuleFontFace*, RefPtr<CSSFontFace> > StyleRuleToF ontFace;
58 FamilyToTraitsMap m_fontFaces; 60 FamilyToTraitsMap m_fontFaces;
59 FamilyToTraitsMap m_fonts; 61 FamilyToTraitsMap m_fonts;
60 StyleRuleToFontFace m_styleRuleToFontFace; 62 StyleRuleToFontFace m_styleRuleToFontFace;
61 63
62 // FIXME: See if this could be ditched 64 // FIXME: See if this could be ditched
63 // Used to compare Font instances, and the usage seems suspect. 65 // Used to compare Font instances, and the usage seems suspect.
64 unsigned m_version; 66 unsigned m_version;
65 }; 67 };
66 68
67 } 69 }
68 70
69 #endif 71 #endif
OLDNEW
« no previous file with comments | « Source/core/css/CSSFontSelector.cpp ('k') | Source/core/css/CSSSegmentedFontFaceCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698