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

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

Issue 2527143002: Suspend frame schedulers on a page suspension (Closed)
Patch Set: fix Created 4 years 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 5744 matching lines...) Expand 10 before | Expand all | Expand 10 after
5755 if (m_parser) 5755 if (m_parser)
5756 m_parser->resumeScheduledTasks(); 5756 m_parser->resumeScheduledTasks();
5757 if (m_scriptedAnimationController) 5757 if (m_scriptedAnimationController)
5758 m_scriptedAnimationController->resume(); 5758 m_scriptedAnimationController->resume();
5759 5759
5760 MutationObserver::resumeSuspendedObservers(); 5760 MutationObserver::resumeSuspendedObservers();
5761 if (m_domWindow) 5761 if (m_domWindow)
5762 DOMWindowPerformance::performance(*m_domWindow)->resumeSuspendedObservers(); 5762 DOMWindowPerformance::performance(*m_domWindow)->resumeSuspendedObservers();
5763 } 5763 }
5764 5764
5765 // FIXME: suspendScheduledTasks(), resumeScheduledTasks(), tasksNeedSuspension()
5766 // should be moved to LocalDOMWindow once it inherits ExecutionContext
5767 void Document::suspendScheduledTasks() {
5768 ExecutionContext::suspendScheduledTasks();
5769 m_taskRunner->suspend();
5770 }
5771
5772 void Document::resumeScheduledTasks() {
5773 ExecutionContext::resumeScheduledTasks();
5774 m_taskRunner->resume();
5775 }
5776
5777 bool Document::tasksNeedSuspension() { 5765 bool Document::tasksNeedSuspension() {
5778 Page* page = this->page(); 5766 Page* page = this->page();
5779 return page && page->suspended(); 5767 return page && page->suspended();
5780 } 5768 }
5781 5769
5782 void Document::addToTopLayer(Element* element, const Element* before) { 5770 void Document::addToTopLayer(Element* element, const Element* before) {
5783 if (element->isInTopLayer()) 5771 if (element->isInTopLayer())
5784 return; 5772 return;
5785 5773
5786 DCHECK(!m_topLayerElements.contains(element)); 5774 DCHECK(!m_topLayerElements.contains(element));
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
6585 } 6573 }
6586 6574
6587 void showLiveDocumentInstances() { 6575 void showLiveDocumentInstances() {
6588 WeakDocumentSet& set = liveDocumentSet(); 6576 WeakDocumentSet& set = liveDocumentSet();
6589 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6577 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6590 for (Document* document : set) 6578 for (Document* document : set)
6591 fprintf(stderr, "- Document %p URL: %s\n", document, 6579 fprintf(stderr, "- Document %p URL: %s\n", document,
6592 document->url().getString().utf8().data()); 6580 document->url().getString().utf8().data());
6593 } 6581 }
6594 #endif 6582 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698