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

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

Issue 2605383002: Introduce IncrementLoadEventDelayCount::clearAndCheckLoadEvent() (Closed)
Patch Set: Rebase Created 3 years, 11 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 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 5801 matching lines...) Expand 10 before | Expand all | Expand 10 after
5812 } 5812 }
5813 5813
5814 void Document::decrementLoadEventDelayCount() { 5814 void Document::decrementLoadEventDelayCount() {
5815 DCHECK(m_loadEventDelayCount); 5815 DCHECK(m_loadEventDelayCount);
5816 --m_loadEventDelayCount; 5816 --m_loadEventDelayCount;
5817 5817
5818 if (!m_loadEventDelayCount) 5818 if (!m_loadEventDelayCount)
5819 checkLoadEventSoon(); 5819 checkLoadEventSoon();
5820 } 5820 }
5821 5821
5822 void Document::decrementLoadEventDelayCountAndCheckLoadEvent() {
5823 DCHECK(m_loadEventDelayCount);
5824 --m_loadEventDelayCount;
5825
5826 if (!m_loadEventDelayCount && frame())
5827 frame()->loader().checkCompleted();
5828 }
5829
5822 void Document::checkLoadEventSoon() { 5830 void Document::checkLoadEventSoon() {
5823 if (frame() && !m_loadEventDelayTimer.isActive()) 5831 if (frame() && !m_loadEventDelayTimer.isActive())
5824 m_loadEventDelayTimer.startOneShot(0, BLINK_FROM_HERE); 5832 m_loadEventDelayTimer.startOneShot(0, BLINK_FROM_HERE);
5825 } 5833 }
5826 5834
5827 bool Document::isDelayingLoadEvent() { 5835 bool Document::isDelayingLoadEvent() {
5828 // Always delay load events until after garbage collection. 5836 // Always delay load events until after garbage collection.
5829 // This way we don't have to explicitly delay load events via 5837 // This way we don't have to explicitly delay load events via
5830 // incrementLoadEventDelayCount and decrementLoadEventDelayCount in 5838 // incrementLoadEventDelayCount and decrementLoadEventDelayCount in
5831 // Node destructors. 5839 // Node destructors.
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
6530 } 6538 }
6531 6539
6532 void showLiveDocumentInstances() { 6540 void showLiveDocumentInstances() {
6533 WeakDocumentSet& set = liveDocumentSet(); 6541 WeakDocumentSet& set = liveDocumentSet();
6534 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6542 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6535 for (Document* document : set) 6543 for (Document* document : set)
6536 fprintf(stderr, "- Document %p URL: %s\n", document, 6544 fprintf(stderr, "- Document %p URL: %s\n", document,
6537 document->url().getString().utf8().data()); 6545 document->url().getString().utf8().data());
6538 } 6546 }
6539 #endif 6547 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/IncrementLoadEventDelayCount.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698