Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) |
| 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 804 { | 804 { |
| 805 if (m_hasUnresolvedKeyframesRule) { | 805 if (m_hasUnresolvedKeyframesRule) { |
| 806 m_hasUnresolvedKeyframesRule = false; | 806 m_hasUnresolvedKeyframesRule = false; |
| 807 document().setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForT racing::create(StyleChangeReason::StyleSheetChange)); | 807 document().setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForT racing::create(StyleChangeReason::StyleSheetChange)); |
| 808 return; | 808 return; |
| 809 } | 809 } |
| 810 | 810 |
| 811 document().timeline().invalidateKeyframeEffects(); | 811 document().timeline().invalidateKeyframeEffects(); |
| 812 } | 812 } |
| 813 | 813 |
| 814 void StyleEngine::purgeMemory() | |
| 815 { | |
| 816 clearFontCache(); | |
| 817 clearResolver(); | |
|
esprehn
2016/08/05 23:00:58
I think this has some scary side effects, you shou
tasak
2016/08/08 04:47:36
Acknowledged.
I would like to ask one thing. Are
| |
| 818 m_textToSheetCache.clear(); | |
| 819 m_sheetToTextCache.clear(); | |
|
esprehn
2016/08/05 23:00:58
This code doesn't really make sense, you're leavin
tasak
2016/08/08 04:47:36
Acknowledged.
I agree that basically these caches'
| |
| 820 } | |
| 821 | |
| 814 DEFINE_TRACE(StyleEngine) | 822 DEFINE_TRACE(StyleEngine) |
| 815 { | 823 { |
| 816 visitor->trace(m_document); | 824 visitor->trace(m_document); |
| 817 visitor->trace(m_injectedAuthorStyleSheets); | 825 visitor->trace(m_injectedAuthorStyleSheets); |
| 818 visitor->trace(m_documentStyleSheetCollection); | 826 visitor->trace(m_documentStyleSheetCollection); |
| 819 visitor->trace(m_styleSheetCollectionMap); | 827 visitor->trace(m_styleSheetCollectionMap); |
| 820 visitor->trace(m_resolver); | 828 visitor->trace(m_resolver); |
| 821 visitor->trace(m_styleInvalidator); | 829 visitor->trace(m_styleInvalidator); |
| 822 visitor->trace(m_dirtyTreeScopes); | 830 visitor->trace(m_dirtyTreeScopes); |
| 823 visitor->trace(m_activeTreeScopes); | 831 visitor->trace(m_activeTreeScopes); |
| 824 visitor->trace(m_fontSelector); | 832 visitor->trace(m_fontSelector); |
| 825 visitor->trace(m_textToSheetCache); | 833 visitor->trace(m_textToSheetCache); |
| 826 visitor->trace(m_sheetToTextCache); | 834 visitor->trace(m_sheetToTextCache); |
| 827 CSSFontSelectorClient::trace(visitor); | 835 CSSFontSelectorClient::trace(visitor); |
| 828 } | 836 } |
| 829 | 837 |
| 830 DEFINE_TRACE_WRAPPERS(StyleEngine) | 838 DEFINE_TRACE_WRAPPERS(StyleEngine) |
| 831 { | 839 { |
| 832 for (auto sheet : m_injectedAuthorStyleSheets) { | 840 for (auto sheet : m_injectedAuthorStyleSheets) { |
| 833 visitor->traceWrappers(sheet); | 841 visitor->traceWrappers(sheet); |
| 834 } | 842 } |
| 835 visitor->traceWrappers(m_documentStyleSheetCollection); | 843 visitor->traceWrappers(m_documentStyleSheetCollection); |
| 836 } | 844 } |
| 837 | 845 |
| 838 } // namespace blink | 846 } // namespace blink |
| OLD | NEW |