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

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleEngine.cpp

Issue 1658923004: PurgeMemory. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months 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
OLDNEW
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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 if (!enabled) { 717 if (!enabled) {
718 m_styleResolverStats = nullptr; 718 m_styleResolverStats = nullptr;
719 return; 719 return;
720 } 720 }
721 if (!m_styleResolverStats) 721 if (!m_styleResolverStats)
722 m_styleResolverStats = StyleResolverStats::create(); 722 m_styleResolverStats = StyleResolverStats::create();
723 else 723 else
724 m_styleResolverStats->reset(); 724 m_styleResolverStats->reset();
725 } 725 }
726 726
727 void StyleEngine::purgeMemory(DeviceKind deviceKind)
728 {
729 if (m_documentStyleSheetCollection)
730 m_documentStyleSheetCollection->purgeMemory();
731 for (ShadowTreeStyleSheetCollection* collection : m_styleSheetCollectionMap. values())
732 collection->purgeMemory();
733 clearFontCache();
734 clearResolver();
735 m_textToSheetCache.clear();
736 m_sheetToTextCache.clear();
737 }
738
727 DEFINE_TRACE(StyleEngine) 739 DEFINE_TRACE(StyleEngine)
728 { 740 {
729 #if ENABLE(OILPAN) 741 #if ENABLE(OILPAN)
730 visitor->trace(m_document); 742 visitor->trace(m_document);
731 visitor->trace(m_injectedAuthorStyleSheets); 743 visitor->trace(m_injectedAuthorStyleSheets);
732 visitor->trace(m_documentStyleSheetCollection); 744 visitor->trace(m_documentStyleSheetCollection);
733 visitor->trace(m_styleSheetCollectionMap); 745 visitor->trace(m_styleSheetCollectionMap);
734 visitor->trace(m_resolver); 746 visitor->trace(m_resolver);
735 visitor->trace(m_styleInvalidator); 747 visitor->trace(m_styleInvalidator);
736 visitor->trace(m_dirtyTreeScopes); 748 visitor->trace(m_dirtyTreeScopes);
737 visitor->trace(m_activeTreeScopes); 749 visitor->trace(m_activeTreeScopes);
738 visitor->trace(m_fontSelector); 750 visitor->trace(m_fontSelector);
739 visitor->trace(m_textToSheetCache); 751 visitor->trace(m_textToSheetCache);
740 visitor->trace(m_sheetToTextCache); 752 visitor->trace(m_sheetToTextCache);
741 #endif 753 #endif
742 CSSFontSelectorClient::trace(visitor); 754 CSSFontSelectorClient::trace(visitor);
743 } 755 }
744 756
745 } // namespace blink 757 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | third_party/WebKit/Source/core/dom/StyleSheetCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698