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

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

Issue 1933033002: Don't run PerformCheckpoint on Document::finishedParsing while running JS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-promise-run-after-script-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4754 matching lines...) Expand 10 before | Expand all | Expand 10 after
4765 if (!m_documentTiming.domContentLoadedEventStart()) 4765 if (!m_documentTiming.domContentLoadedEventStart())
4766 m_documentTiming.markDomContentLoadedEventStart(); 4766 m_documentTiming.markDomContentLoadedEventStart();
4767 dispatchEvent(Event::createBubble(EventTypeNames::DOMContentLoaded)); 4767 dispatchEvent(Event::createBubble(EventTypeNames::DOMContentLoaded));
4768 if (!m_documentTiming.domContentLoadedEventEnd()) 4768 if (!m_documentTiming.domContentLoadedEventEnd())
4769 m_documentTiming.markDomContentLoadedEventEnd(); 4769 m_documentTiming.markDomContentLoadedEventEnd();
4770 setParsingState(FinishedParsing); 4770 setParsingState(FinishedParsing);
4771 4771
4772 // Ensure Custom Element callbacks are drained before DOMContentLoaded. 4772 // Ensure Custom Element callbacks are drained before DOMContentLoaded.
4773 // FIXME: Remove this ad-hoc checkpoint when DOMContentLoaded is dispatched in a 4773 // FIXME: Remove this ad-hoc checkpoint when DOMContentLoaded is dispatched in a
4774 // queued task, which will do a checkpoint anyway. https://crbug.com/425790 4774 // queued task, which will do a checkpoint anyway. https://crbug.com/425790
4775 Microtask::performCheckpoint(V8PerIsolateData::mainThreadIsolate()); 4775 if (!V8PerIsolateData::mainThreadIsolate()->InContext())
4776 Microtask::performCheckpoint(V8PerIsolateData::mainThreadIsolate());
4776 4777
4777 if (LocalFrame* frame = this->frame()) { 4778 if (LocalFrame* frame = this->frame()) {
4778 // Don't update the layout tree if we haven't requested the main resourc e yet to avoid 4779 // Don't update the layout tree if we haven't requested the main resourc e yet to avoid
4779 // adding extra latency. Note that the first layout tree update can be e xpensive since it 4780 // adding extra latency. Note that the first layout tree update can be e xpensive since it
4780 // triggers the parsing of the default stylesheets which are compiled-in . 4781 // triggers the parsing of the default stylesheets which are compiled-in .
4781 const bool mainResourceWasAlreadyRequested = frame->loader().stateMachin e()->committedFirstRealDocumentLoad(); 4782 const bool mainResourceWasAlreadyRequested = frame->loader().stateMachin e()->committedFirstRealDocumentLoad();
4782 4783
4783 // FrameLoader::finishedParsing() might end up calling Document::implici tClose() if all 4784 // FrameLoader::finishedParsing() might end up calling Document::implici tClose() if all
4784 // resource loads are complete. HTMLObjectElements can start loading the ir resources from 4785 // resource loads are complete. HTMLObjectElements can start loading the ir resources from
4785 // post attach callbacks triggered by recalcStyle(). This means if we p arse out an <object> 4786 // post attach callbacks triggered by recalcStyle(). This means if we p arse out an <object>
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
5974 #ifndef NDEBUG 5975 #ifndef NDEBUG
5975 using namespace blink; 5976 using namespace blink;
5976 void showLiveDocumentInstances() 5977 void showLiveDocumentInstances()
5977 { 5978 {
5978 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 5979 Document::WeakDocumentSet& set = Document::liveDocumentSet();
5979 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5980 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5980 for (Document* document : set) 5981 for (Document* document : set)
5981 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 5982 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
5982 } 5983 }
5983 #endif 5984 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-promise-run-after-script-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698