| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 m_cssConnectedFontFaces.clear(); | 126 m_cssConnectedFontFaces.clear(); |
| 127 incrementVersion(); | 127 incrementVersion(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void FontFaceCache::incrementVersion() { | 130 void FontFaceCache::incrementVersion() { |
| 131 m_version = ++s_version; | 131 m_version = ++s_version; |
| 132 } | 132 } |
| 133 | 133 |
| 134 CSSSegmentedFontFace* FontFaceCache::get(const FontDescription& fontDescription, | 134 CSSSegmentedFontFace* FontFaceCache::get(const FontDescription& fontDescription, |
| 135 const AtomicString& family) { | 135 const AtomicString& family) { |
| 136 TraitsMap* familyFontFaces = m_fontFaces.get(family); | 136 TraitsMap* familyFontFaces = m_fontFaces.at(family); |
| 137 if (!familyFontFaces || familyFontFaces->isEmpty()) | 137 if (!familyFontFaces || familyFontFaces->isEmpty()) |
| 138 return nullptr; | 138 return nullptr; |
| 139 | 139 |
| 140 FamilyToTraitsMap::AddResult traitsResult = m_fonts.insert(family, nullptr); | 140 FamilyToTraitsMap::AddResult traitsResult = m_fonts.insert(family, nullptr); |
| 141 if (!traitsResult.storedValue->value) | 141 if (!traitsResult.storedValue->value) |
| 142 traitsResult.storedValue->value = new TraitsMap; | 142 traitsResult.storedValue->value = new TraitsMap; |
| 143 | 143 |
| 144 FontTraits traits = fontDescription.traits(); | 144 FontTraits traits = fontDescription.traits(); |
| 145 TraitsMap::AddResult faceResult = | 145 TraitsMap::AddResult faceResult = |
| 146 traitsResult.storedValue->value->insert(traits.bitfield(), nullptr); | 146 traitsResult.storedValue->value->insert(traits.bitfield(), nullptr); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 158 } | 158 } |
| 159 | 159 |
| 160 DEFINE_TRACE(FontFaceCache) { | 160 DEFINE_TRACE(FontFaceCache) { |
| 161 visitor->trace(m_fontFaces); | 161 visitor->trace(m_fontFaces); |
| 162 visitor->trace(m_fonts); | 162 visitor->trace(m_fonts); |
| 163 visitor->trace(m_styleRuleToFontFace); | 163 visitor->trace(m_styleRuleToFontFace); |
| 164 visitor->trace(m_cssConnectedFontFaces); | 164 visitor->trace(m_cssConnectedFontFaces); |
| 165 } | 165 } |
| 166 | 166 |
| 167 } // namespace blink | 167 } // namespace blink |
| OLD | NEW |