Chromium Code Reviews

Side by Side Diff: Source/core/dom/Document.cpp

Issue 1252683003: Oilpan: Schedule a precise GC when a page navigates (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: WIP Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
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 583 matching lines...)
594 if (svgExtensions()) 594 if (svgExtensions())
595 accessSVGExtensions().pauseAnimations(); 595 accessSVGExtensions().pauseAnimations();
596 596
597 m_lifecycle.advanceTo(DocumentLifecycle::Disposed); 597 m_lifecycle.advanceTo(DocumentLifecycle::Disposed);
598 DocumentLifecycleNotifier::notifyDocumentWasDisposed(); 598 DocumentLifecycleNotifier::notifyDocumentWasDisposed();
599 599
600 m_canvasFontCache.clear(); 600 m_canvasFontCache.clear();
601 } 601 }
602 #endif 602 #endif
603 603
604 unsigned Document::nodeCount() const
605 {
606 unsigned count = 0;
607 for (Node& node : NodeTraversal::inclusiveDescendantsOf(*this)) {
608 ASSERT_UNUSED(node, &node);
609 count++;
610 }
611 return count;
612 }
613
604 SelectorQueryCache& Document::selectorQueryCache() 614 SelectorQueryCache& Document::selectorQueryCache()
605 { 615 {
606 if (!m_selectorQueryCache) 616 if (!m_selectorQueryCache)
607 m_selectorQueryCache = adoptPtr(new SelectorQueryCache()); 617 m_selectorQueryCache = adoptPtr(new SelectorQueryCache());
608 return *m_selectorQueryCache; 618 return *m_selectorQueryCache;
609 } 619 }
610 620
611 MediaQueryMatcher& Document::mediaQueryMatcher() 621 MediaQueryMatcher& Document::mediaQueryMatcher()
612 { 622 {
613 if (!m_mediaQueryMatcher) 623 if (!m_mediaQueryMatcher)
(...skipping 5195 matching lines...)
5809 #ifndef NDEBUG 5819 #ifndef NDEBUG
5810 using namespace blink; 5820 using namespace blink;
5811 void showLiveDocumentInstances() 5821 void showLiveDocumentInstances()
5812 { 5822 {
5813 WeakDocumentSet& set = liveDocumentSet(); 5823 WeakDocumentSet& set = liveDocumentSet();
5814 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5824 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5815 for (Document* document : set) 5825 for (Document* document : set)
5816 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5826 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5817 } 5827 }
5818 #endif 5828 #endif
OLDNEW

Powered by Google App Engine