OLD | NEW |
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 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1800 | 1800 |
1801 // Entering here from inside layout or paint would be catastrophic since rec
alcStyle can | 1801 // Entering here from inside layout or paint would be catastrophic since rec
alcStyle can |
1802 // tear down the render tree or (unfortunately) run script. Kill the whole r
enderer if | 1802 // tear down the render tree or (unfortunately) run script. Kill the whole r
enderer if |
1803 // someone managed to get into here from inside layout or paint. | 1803 // someone managed to get into here from inside layout or paint. |
1804 RELEASE_ASSERT(!view()->isInPerformLayout()); | 1804 RELEASE_ASSERT(!view()->isInPerformLayout()); |
1805 RELEASE_ASSERT(!view()->isPainting()); | 1805 RELEASE_ASSERT(!view()->isPainting()); |
1806 | 1806 |
1807 // Script can run below in WidgetUpdates, so protect the LocalFrame. | 1807 // Script can run below in WidgetUpdates, so protect the LocalFrame. |
1808 // FIXME: Can this still happen? How does script run inside | 1808 // FIXME: Can this still happen? How does script run inside |
1809 // UpdateSuspendScope::performDeferredWidgetTreeOperations() ? | 1809 // UpdateSuspendScope::performDeferredWidgetTreeOperations() ? |
1810 RefPtr<LocalFrame> protect(m_frame); | 1810 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame); |
1811 | 1811 |
1812 TRACE_EVENT_BEGIN0("blink", "Document::updateRenderTree"); | 1812 TRACE_EVENT_BEGIN0("blink", "Document::updateRenderTree"); |
1813 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "UpdateRenderTree"); | 1813 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "UpdateRenderTree"); |
1814 | 1814 |
1815 // FIXME: Remove m_styleRecalcElementCounter, we should just use the accessC
ount() on the resolver. | 1815 // FIXME: Remove m_styleRecalcElementCounter, we should just use the accessC
ount() on the resolver. |
1816 m_styleRecalcElementCounter = 0; | 1816 m_styleRecalcElementCounter = 0; |
1817 TRACE_EVENT_BEGIN1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Recalcul
ateStyles", "frame", frame()); | 1817 TRACE_EVENT_BEGIN1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Recalcul
ateStyles", "frame", frame()); |
1818 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "
CallStack", "stack", InspectorCallStackEvent::currentCallStack()); | 1818 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "
CallStack", "stack", InspectorCallStackEvent::currentCallStack()); |
1819 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli
ne migrates to tracing. | 1819 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli
ne migrates to tracing. |
1820 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRecalc
ulateStyle(this); | 1820 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRecalc
ulateStyle(this); |
(...skipping 2829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4650 m_documentTiming.domContentLoadedEventStart = monotonicallyIncreasingTim
e(); | 4650 m_documentTiming.domContentLoadedEventStart = monotonicallyIncreasingTim
e(); |
4651 dispatchEvent(Event::createBubble(EventTypeNames::DOMContentLoaded)); | 4651 dispatchEvent(Event::createBubble(EventTypeNames::DOMContentLoaded)); |
4652 if (!m_documentTiming.domContentLoadedEventEnd) | 4652 if (!m_documentTiming.domContentLoadedEventEnd) |
4653 m_documentTiming.domContentLoadedEventEnd = monotonicallyIncreasingTime(
); | 4653 m_documentTiming.domContentLoadedEventEnd = monotonicallyIncreasingTime(
); |
4654 | 4654 |
4655 // The loader's finishedParsing() method may invoke script that causes this
object to | 4655 // The loader's finishedParsing() method may invoke script that causes this
object to |
4656 // be dereferenced (when this document is in an iframe and the onload causes
the iframe's src to change). | 4656 // be dereferenced (when this document is in an iframe and the onload causes
the iframe's src to change). |
4657 // Keep it alive until we are done. | 4657 // Keep it alive until we are done. |
4658 RefPtrWillBeRawPtr<Document> protect(this); | 4658 RefPtrWillBeRawPtr<Document> protect(this); |
4659 | 4659 |
4660 if (RefPtr<LocalFrame> f = frame()) { | 4660 if (RefPtrWillBeRawPtr<LocalFrame> frame = this->frame()) { |
4661 // Don't update the render tree if we haven't requested the main resourc
e yet to avoid | 4661 // Don't update the render tree if we haven't requested the main resourc
e yet to avoid |
4662 // adding extra latency. Note that the first render tree update can be e
xpensive since it | 4662 // adding extra latency. Note that the first render tree update can be e
xpensive since it |
4663 // triggers the parsing of the default stylesheets which are compiled-in
. | 4663 // triggers the parsing of the default stylesheets which are compiled-in
. |
4664 const bool mainResourceWasAlreadyRequested = | 4664 const bool mainResourceWasAlreadyRequested = frame->loader().stateMachin
e()->committedFirstRealDocumentLoad(); |
4665 m_frame->loader().stateMachine()->committedFirstRealDocumentLoad(); | |
4666 | 4665 |
4667 // FrameLoader::finishedParsing() might end up calling Document::implici
tClose() if all | 4666 // FrameLoader::finishedParsing() might end up calling Document::implici
tClose() if all |
4668 // resource loads are complete. HTMLObjectElements can start loading the
ir resources from | 4667 // resource loads are complete. HTMLObjectElements can start loading the
ir resources from |
4669 // post attach callbacks triggered by recalcStyle(). This means if we p
arse out an <object> | 4668 // post attach callbacks triggered by recalcStyle(). This means if we p
arse out an <object> |
4670 // tag and then reach the end of the document without updating styles, w
e might not have yet | 4669 // tag and then reach the end of the document without updating styles, w
e might not have yet |
4671 // started the resource load and might fire the window load event too ea
rly. To avoid this | 4670 // started the resource load and might fire the window load event too ea
rly. To avoid this |
4672 // we force the styles to be up to date before calling FrameLoader::fini
shedParsing(). | 4671 // we force the styles to be up to date before calling FrameLoader::fini
shedParsing(). |
4673 // See https://bugs.webkit.org/show_bug.cgi?id=36864 starting around com
ment 35. | 4672 // See https://bugs.webkit.org/show_bug.cgi?id=36864 starting around com
ment 35. |
4674 if (mainResourceWasAlreadyRequested) | 4673 if (mainResourceWasAlreadyRequested) |
4675 updateRenderTreeIfNeeded(); | 4674 updateRenderTreeIfNeeded(); |
4676 | 4675 |
4677 f->loader().finishedParsing(); | 4676 frame->loader().finishedParsing(); |
4678 | 4677 |
4679 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Ma
rkDOMContent", "data", InspectorMarkLoadEvent::data(f.get())); | 4678 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Ma
rkDOMContent", "data", InspectorMarkLoadEvent::data(frame.get())); |
4680 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Ti
meline migrates to tracing. | 4679 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Ti
meline migrates to tracing. |
4681 InspectorInstrumentation::domContentLoadedEventFired(f.get()); | 4680 InspectorInstrumentation::domContentLoadedEventFired(frame.get()); |
4682 } | 4681 } |
4683 | 4682 |
4684 // Schedule dropping of the ElementDataCache. We keep it alive for a while a
fter parsing finishes | 4683 // Schedule dropping of the ElementDataCache. We keep it alive for a while a
fter parsing finishes |
4685 // so that dynamically inserted content can also benefit from sharing optimi
zations. | 4684 // so that dynamically inserted content can also benefit from sharing optimi
zations. |
4686 // Note that we don't refresh the timer on cache access since that could lea
d to huge caches being kept | 4685 // Note that we don't refresh the timer on cache access since that could lea
d to huge caches being kept |
4687 // alive indefinitely by something innocuous like JS setting .innerHTML repe
atedly on a timer. | 4686 // alive indefinitely by something innocuous like JS setting .innerHTML repe
atedly on a timer. |
4688 m_elementDataCacheClearTimer.startOneShot(10, FROM_HERE); | 4687 m_elementDataCacheClearTimer.startOneShot(10, FROM_HERE); |
4689 | 4688 |
4690 // Parser should have picked up all preloads by now | 4689 // Parser should have picked up all preloads by now |
4691 m_fetcher->clearPreloads(); | 4690 m_fetcher->clearPreloads(); |
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5847 using namespace blink; | 5846 using namespace blink; |
5848 void showLiveDocumentInstances() | 5847 void showLiveDocumentInstances() |
5849 { | 5848 { |
5850 WeakDocumentSet& set = liveDocumentSet(); | 5849 WeakDocumentSet& set = liveDocumentSet(); |
5851 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5850 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5852 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it
) { | 5851 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it
) { |
5853 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut
f8().data()); | 5852 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut
f8().data()); |
5854 } | 5853 } |
5855 } | 5854 } |
5856 #endif | 5855 #endif |
OLD | NEW |