| OLD | NEW |
| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
| 31 #include "wtf/Forward.h" | 31 #include "wtf/Forward.h" |
| 32 #include "wtf/HashMap.h" | 32 #include "wtf/HashMap.h" |
| 33 #include "wtf/ListHashSet.h" | 33 #include "wtf/ListHashSet.h" |
| 34 #include "wtf/text/StringHash.h" | 34 #include "wtf/text/StringHash.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class FontFace; | 38 class FontFace; |
| 39 class CSSFontSelector; | |
| 40 class CSSSegmentedFontFace; | 39 class CSSSegmentedFontFace; |
| 41 class FontDescription; | 40 class FontDescription; |
| 42 class StyleRuleFontFace; | 41 class StyleRuleFontFace; |
| 43 | 42 |
| 44 class FontFaceCache final { | 43 class FontFaceCache final { |
| 45 DISALLOW_NEW(); | 44 DISALLOW_NEW(); |
| 46 | 45 |
| 47 public: | 46 public: |
| 48 FontFaceCache(); | 47 FontFaceCache(); |
| 49 | 48 |
| 50 // FIXME: Remove CSSFontSelector as argument. Passing CSSFontSelector here is | 49 void add(const StyleRuleFontFace*, FontFace*); |
| 51 // a result of egregious spaghettification in FontFace/FontFaceSet. | |
| 52 void add(CSSFontSelector*, const StyleRuleFontFace*, FontFace*); | |
| 53 void remove(const StyleRuleFontFace*); | 50 void remove(const StyleRuleFontFace*); |
| 54 void clearCSSConnected(); | 51 void clearCSSConnected(); |
| 55 void clearAll(); | 52 void clearAll(); |
| 56 void addFontFace(CSSFontSelector*, FontFace*, bool cssConnected); | 53 void addFontFace(FontFace*, bool cssConnected); |
| 57 void removeFontFace(FontFace*, bool cssConnected); | 54 void removeFontFace(FontFace*, bool cssConnected); |
| 58 | 55 |
| 59 // FIXME: It's sort of weird that add/remove uses StyleRuleFontFace* as key, | 56 // FIXME: It's sort of weird that add/remove uses StyleRuleFontFace* as key, |
| 60 // but this function uses FontDescription/family pair. | 57 // but this function uses FontDescription/family pair. |
| 61 CSSSegmentedFontFace* get(const FontDescription&, const AtomicString& family); | 58 CSSSegmentedFontFace* get(const FontDescription&, const AtomicString& family); |
| 62 | 59 |
| 63 const HeapListHashSet<Member<FontFace>>& cssConnectedFontFaces() const { | 60 const HeapListHashSet<Member<FontFace>>& cssConnectedFontFaces() const { |
| 64 return m_cssConnectedFontFaces; | 61 return m_cssConnectedFontFaces; |
| 65 } | 62 } |
| 66 | 63 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 81 HeapListHashSet<Member<FontFace>> m_cssConnectedFontFaces; | 78 HeapListHashSet<Member<FontFace>> m_cssConnectedFontFaces; |
| 82 | 79 |
| 83 // FIXME: See if this could be ditched | 80 // FIXME: See if this could be ditched |
| 84 // Used to compare Font instances, and the usage seems suspect. | 81 // Used to compare Font instances, and the usage seems suspect. |
| 85 unsigned m_version; | 82 unsigned m_version; |
| 86 }; | 83 }; |
| 87 | 84 |
| 88 } // namespace blink | 85 } // namespace blink |
| 89 | 86 |
| 90 #endif | 87 #endif |
| OLD | NEW |