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

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

Issue 189833009: Trace where timers were scheduled in Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | 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 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after
1873 } 1873 }
1874 1874
1875 void Document::setNeedsFocusedElementCheck() 1875 void Document::setNeedsFocusedElementCheck()
1876 { 1876 {
1877 setNeedsStyleRecalc(LocalStyleChange); 1877 setNeedsStyleRecalc(LocalStyleChange);
1878 } 1878 }
1879 1879
1880 void Document::clearFocusedElementSoon() 1880 void Document::clearFocusedElementSoon()
1881 { 1881 {
1882 if (!m_clearFocusedElementTimer.isActive()) 1882 if (!m_clearFocusedElementTimer.isActive())
1883 m_clearFocusedElementTimer.startOneShot(0); 1883 m_clearFocusedElementTimer.startOneShot(0, FROM_HERE);
1884 } 1884 }
1885 1885
1886 void Document::clearFocusedElementTimerFired(Timer<Document>*) 1886 void Document::clearFocusedElementTimerFired(Timer<Document>*)
1887 { 1887 {
1888 updateStyleIfNeeded(); 1888 updateStyleIfNeeded();
1889 m_clearFocusedElementTimer.stop(); 1889 m_clearFocusedElementTimer.stop();
1890 1890
1891 if (m_focusedElement && !m_focusedElement->isFocusable()) 1891 if (m_focusedElement && !m_focusedElement->isFocusable())
1892 setFocusedElement(nullptr); 1892 setFocusedElement(nullptr);
1893 } 1893 }
(...skipping 2561 matching lines...) Expand 10 before | Expand all | Expand 10 after
4455 4455
4456 f->loader().finishedParsing(); 4456 f->loader().finishedParsing();
4457 4457
4458 InspectorInstrumentation::domContentLoadedEventFired(f.get()); 4458 InspectorInstrumentation::domContentLoadedEventFired(f.get());
4459 } 4459 }
4460 4460
4461 // Schedule dropping of the ElementDataCache. We keep it alive for a while a fter parsing finishes 4461 // Schedule dropping of the ElementDataCache. We keep it alive for a while a fter parsing finishes
4462 // so that dynamically inserted content can also benefit from sharing optimi zations. 4462 // so that dynamically inserted content can also benefit from sharing optimi zations.
4463 // Note that we don't refresh the timer on cache access since that could lea d to huge caches being kept 4463 // Note that we don't refresh the timer on cache access since that could lea d to huge caches being kept
4464 // alive indefinitely by something innocuous like JS setting .innerHTML repe atedly on a timer. 4464 // alive indefinitely by something innocuous like JS setting .innerHTML repe atedly on a timer.
4465 m_elementDataCacheClearTimer.startOneShot(10); 4465 m_elementDataCacheClearTimer.startOneShot(10, FROM_HERE);
4466 4466
4467 // Parser should have picked up all preloads by now 4467 // Parser should have picked up all preloads by now
4468 m_fetcher->clearPreloads(); 4468 m_fetcher->clearPreloads();
4469 4469
4470 if (m_import) 4470 if (m_import)
4471 m_import->didFinishParsing(); 4471 m_import->didFinishParsing();
4472 } 4472 }
4473 4473
4474 void Document::elementDataCacheClearTimerFired(Timer<Document>*) 4474 void Document::elementDataCacheClearTimerFired(Timer<Document>*)
4475 { 4475 {
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
4687 4687
4688 bool Document::isContextThread() const 4688 bool Document::isContextThread() const
4689 { 4689 {
4690 return isMainThread(); 4690 return isMainThread();
4691 } 4691 }
4692 4692
4693 void Document::updateFocusAppearanceSoon(bool restorePreviousSelection) 4693 void Document::updateFocusAppearanceSoon(bool restorePreviousSelection)
4694 { 4694 {
4695 m_updateFocusAppearanceRestoresSelection = restorePreviousSelection; 4695 m_updateFocusAppearanceRestoresSelection = restorePreviousSelection;
4696 if (!m_updateFocusAppearanceTimer.isActive()) 4696 if (!m_updateFocusAppearanceTimer.isActive())
4697 m_updateFocusAppearanceTimer.startOneShot(0); 4697 m_updateFocusAppearanceTimer.startOneShot(0, FROM_HERE);
4698 } 4698 }
4699 4699
4700 void Document::cancelFocusAppearanceUpdate() 4700 void Document::cancelFocusAppearanceUpdate()
4701 { 4701 {
4702 m_updateFocusAppearanceTimer.stop(); 4702 m_updateFocusAppearanceTimer.stop();
4703 } 4703 }
4704 4704
4705 void Document::updateFocusAppearanceTimerFired(Timer<Document>*) 4705 void Document::updateFocusAppearanceTimerFired(Timer<Document>*)
4706 { 4706 {
4707 Element* element = focusedElement(); 4707 Element* element = focusedElement();
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
4922 } 4922 }
4923 return 0; 4923 return 0;
4924 } 4924 }
4925 4925
4926 void Document::decrementLoadEventDelayCount() 4926 void Document::decrementLoadEventDelayCount()
4927 { 4927 {
4928 ASSERT(m_loadEventDelayCount); 4928 ASSERT(m_loadEventDelayCount);
4929 --m_loadEventDelayCount; 4929 --m_loadEventDelayCount;
4930 4930
4931 if (frame() && !m_loadEventDelayCount && !m_loadEventDelayTimer.isActive()) 4931 if (frame() && !m_loadEventDelayCount && !m_loadEventDelayTimer.isActive())
4932 m_loadEventDelayTimer.startOneShot(0); 4932 m_loadEventDelayTimer.startOneShot(0, FROM_HERE);
4933 } 4933 }
4934 4934
4935 void Document::loadEventDelayTimerFired(Timer<Document>*) 4935 void Document::loadEventDelayTimerFired(Timer<Document>*)
4936 { 4936 {
4937 if (frame()) 4937 if (frame())
4938 frame()->loader().checkCompleted(); 4938 frame()->loader().checkCompleted();
4939 } 4939 }
4940 4940
4941 void Document::loadPluginsSoon() 4941 void Document::loadPluginsSoon()
4942 { 4942 {
4943 // FIXME: Remove this timer once we don't need to compute layout to load plu gins. 4943 // FIXME: Remove this timer once we don't need to compute layout to load plu gins.
4944 if (!m_pluginLoadingTimer.isActive()) 4944 if (!m_pluginLoadingTimer.isActive())
4945 m_pluginLoadingTimer.startOneShot(0); 4945 m_pluginLoadingTimer.startOneShot(0, FROM_HERE);
4946 } 4946 }
4947 4947
4948 void Document::pluginLoadingTimerFired(Timer<Document>*) 4948 void Document::pluginLoadingTimerFired(Timer<Document>*)
4949 { 4949 {
4950 updateLayout(); 4950 updateLayout();
4951 } 4951 }
4952 4952
4953 ScriptedAnimationController& Document::ensureScriptedAnimationController() 4953 ScriptedAnimationController& Document::ensureScriptedAnimationController()
4954 { 4954 {
4955 if (!m_scriptedAnimationController) { 4955 if (!m_scriptedAnimationController) {
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
5350 5350
5351 return *m_templateDocument.get(); 5351 return *m_templateDocument.get();
5352 } 5352 }
5353 5353
5354 void Document::didAssociateFormControl(Element* element) 5354 void Document::didAssociateFormControl(Element* element)
5355 { 5355 {
5356 if (!frame() || !frame()->page()) 5356 if (!frame() || !frame()->page())
5357 return; 5357 return;
5358 m_associatedFormControls.add(element); 5358 m_associatedFormControls.add(element);
5359 if (!m_didAssociateFormControlsTimer.isActive()) 5359 if (!m_didAssociateFormControlsTimer.isActive())
5360 m_didAssociateFormControlsTimer.startOneShot(0); 5360 m_didAssociateFormControlsTimer.startOneShot(0, FROM_HERE);
5361 } 5361 }
5362 5362
5363 void Document::didAssociateFormControlsTimerFired(Timer<Document>* timer) 5363 void Document::didAssociateFormControlsTimerFired(Timer<Document>* timer)
5364 { 5364 {
5365 ASSERT_UNUSED(timer, timer == &m_didAssociateFormControlsTimer); 5365 ASSERT_UNUSED(timer, timer == &m_didAssociateFormControlsTimer);
5366 if (!frame() || !frame()->page()) 5366 if (!frame() || !frame()->page())
5367 return; 5367 return;
5368 5368
5369 Vector<RefPtr<Element> > associatedFormControls; 5369 Vector<RefPtr<Element> > associatedFormControls;
5370 copyToVector(m_associatedFormControls, associatedFormControls); 5370 copyToVector(m_associatedFormControls, associatedFormControls);
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
5496 } 5496 }
5497 5497
5498 void Document::invalidateNodeListCaches(const QualifiedName* attrName) 5498 void Document::invalidateNodeListCaches(const QualifiedName* attrName)
5499 { 5499 {
5500 HashSet<LiveNodeListBase*>::iterator end = m_listsInvalidatedAtDocument.end( ); 5500 HashSet<LiveNodeListBase*>::iterator end = m_listsInvalidatedAtDocument.end( );
5501 for (HashSet<LiveNodeListBase*>::iterator it = m_listsInvalidatedAtDocument. begin(); it != end; ++it) 5501 for (HashSet<LiveNodeListBase*>::iterator it = m_listsInvalidatedAtDocument. begin(); it != end; ++it)
5502 (*it)->invalidateCache(attrName); 5502 (*it)->invalidateCache(attrName);
5503 } 5503 }
5504 5504
5505 } // namespace WebCore 5505 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698