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

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

Issue 2527143002: Suspend frame schedulers on a page suspension (Closed)
Patch Set: mod a comment 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 5747 matching lines...) Expand 10 before | Expand all | Expand 10 after
5758 if (m_parser) 5758 if (m_parser)
5759 m_parser->resumeScheduledTasks(); 5759 m_parser->resumeScheduledTasks();
5760 if (m_scriptedAnimationController) 5760 if (m_scriptedAnimationController)
5761 m_scriptedAnimationController->resume(); 5761 m_scriptedAnimationController->resume();
5762 5762
5763 MutationObserver::resumeSuspendedObservers(); 5763 MutationObserver::resumeSuspendedObservers();
5764 if (m_domWindow) 5764 if (m_domWindow)
5765 DOMWindowPerformance::performance(*m_domWindow)->resumeSuspendedObservers(); 5765 DOMWindowPerformance::performance(*m_domWindow)->resumeSuspendedObservers();
5766 } 5766 }
5767 5767
5768 // FIXME: suspendScheduledTasks(), resumeScheduledTasks(), tasksNeedSuspension()
5769 // should be moved to LocalDOMWindow once it inherits ExecutionContext
5770 void Document::suspendScheduledTasks() {
5771 ExecutionContext::suspendScheduledTasks();
5772 m_taskRunner->suspend();
5773 }
5774
5775 void Document::resumeScheduledTasks() {
5776 ExecutionContext::resumeScheduledTasks();
5777 m_taskRunner->resume();
5778 }
5779
5780 bool Document::tasksNeedSuspension() { 5768 bool Document::tasksNeedSuspension() {
5781 Page* page = this->page(); 5769 Page* page = this->page();
5782 return page && page->suspended(); 5770 return page && page->suspended();
5783 } 5771 }
5784 5772
5785 void Document::addToTopLayer(Element* element, const Element* before) { 5773 void Document::addToTopLayer(Element* element, const Element* before) {
5786 if (element->isInTopLayer()) 5774 if (element->isInTopLayer())
5787 return; 5775 return;
5788 5776
5789 DCHECK(!m_topLayerElements.contains(element)); 5777 DCHECK(!m_topLayerElements.contains(element));
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
6556 } 6544 }
6557 6545
6558 void showLiveDocumentInstances() { 6546 void showLiveDocumentInstances() {
6559 WeakDocumentSet& set = liveDocumentSet(); 6547 WeakDocumentSet& set = liveDocumentSet();
6560 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6548 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6561 for (Document* document : set) 6549 for (Document* document : set)
6562 fprintf(stderr, "- Document %p URL: %s\n", document, 6550 fprintf(stderr, "- Document %p URL: %s\n", document,
6563 document->url().getString().utf8().data()); 6551 document->url().getString().utf8().data());
6564 } 6552 }
6565 #endif 6553 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/ExecutionContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698