| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 TraitsMap::AddResult segmentedFontFaceResult = | 63 TraitsMap::AddResult segmentedFontFaceResult = |
| 64 traitsResult.storedValue->value->insert(fontFace->traits().bitfield(), | 64 traitsResult.storedValue->value->insert(fontFace->traits().bitfield(), |
| 65 nullptr); | 65 nullptr); |
| 66 if (!segmentedFontFaceResult.storedValue->value) | 66 if (!segmentedFontFaceResult.storedValue->value) |
| 67 segmentedFontFaceResult.storedValue->value = | 67 segmentedFontFaceResult.storedValue->value = |
| 68 CSSSegmentedFontFace::create(cssFontSelector, fontFace->traits()); | 68 CSSSegmentedFontFace::create(cssFontSelector, fontFace->traits()); |
| 69 | 69 |
| 70 segmentedFontFaceResult.storedValue->value->addFontFace(fontFace, | 70 segmentedFontFaceResult.storedValue->value->addFontFace(fontFace, |
| 71 cssConnected); | 71 cssConnected); |
| 72 if (cssConnected) | 72 if (cssConnected) |
| 73 m_cssConnectedFontFaces.add(fontFace); | 73 m_cssConnectedFontFaces.insert(fontFace); |
| 74 | 74 |
| 75 m_fonts.erase(fontFace->family()); | 75 m_fonts.erase(fontFace->family()); |
| 76 incrementVersion(); | 76 incrementVersion(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void FontFaceCache::remove(const StyleRuleFontFace* fontFaceRule) { | 79 void FontFaceCache::remove(const StyleRuleFontFace* fontFaceRule) { |
| 80 StyleRuleToFontFace::iterator it = m_styleRuleToFontFace.find(fontFaceRule); | 80 StyleRuleToFontFace::iterator it = m_styleRuleToFontFace.find(fontFaceRule); |
| 81 if (it != m_styleRuleToFontFace.end()) { | 81 if (it != m_styleRuleToFontFace.end()) { |
| 82 removeFontFace(it->value.get(), true); | 82 removeFontFace(it->value.get(), true); |
| 83 m_styleRuleToFontFace.remove(it); | 83 m_styleRuleToFontFace.remove(it); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |