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

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

Issue 1475863005: [Async][WIP] Call FrameLoader::checkCompleted() asynchronously to avoid sync body.onload() Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 10 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
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 2616 matching lines...) Expand 10 before | Expand all | Expand 10 after
2627 parser->finish(); 2627 parser->finish();
2628 2628
2629 if (!m_frame) { 2629 if (!m_frame) {
2630 // Because we have no frame, we don't know if all loading has completed, 2630 // Because we have no frame, we don't know if all loading has completed,
2631 // so we just call implicitClose() immediately. FIXME: This might fire 2631 // so we just call implicitClose() immediately. FIXME: This might fire
2632 // the load event prematurely <http://bugs.webkit.org/show_bug.cgi?id=14 568>. 2632 // the load event prematurely <http://bugs.webkit.org/show_bug.cgi?id=14 568>.
2633 implicitClose(); 2633 implicitClose();
2634 return; 2634 return;
2635 } 2635 }
2636 2636
2637 m_frame->loader().checkCompleted(); 2637 m_frame->loader().checkCompleted(7);
2638 } 2638 }
2639 2639
2640 void Document::implicitClose() 2640 void Document::implicitClose()
2641 { 2641 {
2642 ASSERT(!inStyleRecalc()); 2642 ASSERT(!inStyleRecalc());
2643 if (processingLoadEvent() || !m_parser) 2643 if (processingLoadEvent() || !m_parser)
2644 return; 2644 return;
2645 if (frame() && frame()->navigationScheduler().locationChangePending()) { 2645 if (frame() && frame()->navigationScheduler().locationChangePending()) {
2646 suppressLoadEvent(); 2646 suppressLoadEvent();
2647 return; 2647 return;
(...skipping 2652 matching lines...) Expand 10 before | Expand all | Expand 10 after
5300 return true; 5300 return true;
5301 } 5301 }
5302 #endif 5302 #endif
5303 return m_loadEventDelayCount; 5303 return m_loadEventDelayCount;
5304 } 5304 }
5305 5305
5306 5306
5307 void Document::loadEventDelayTimerFired(Timer<Document>*) 5307 void Document::loadEventDelayTimerFired(Timer<Document>*)
5308 { 5308 {
5309 if (frame()) 5309 if (frame())
5310 frame()->loader().checkCompleted(); 5310 frame()->loader().checkCompleted(8);
5311 } 5311 }
5312 5312
5313 void Document::loadPluginsSoon() 5313 void Document::loadPluginsSoon()
5314 { 5314 {
5315 // FIXME: Remove this timer once we don't need to compute layout to load plu gins. 5315 // FIXME: Remove this timer once we don't need to compute layout to load plu gins.
5316 if (!m_pluginLoadingTimer.isActive()) 5316 if (!m_pluginLoadingTimer.isActive())
5317 m_pluginLoadingTimer.startOneShot(0, BLINK_FROM_HERE); 5317 m_pluginLoadingTimer.startOneShot(0, BLINK_FROM_HERE);
5318 } 5318 }
5319 5319
5320 void Document::pluginLoadingTimerFired(Timer<Document>*) 5320 void Document::pluginLoadingTimerFired(Timer<Document>*)
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
5951 #ifndef NDEBUG 5951 #ifndef NDEBUG
5952 using namespace blink; 5952 using namespace blink;
5953 void showLiveDocumentInstances() 5953 void showLiveDocumentInstances()
5954 { 5954 {
5955 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 5955 Document::WeakDocumentSet& set = Document::liveDocumentSet();
5956 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5956 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5957 for (Document* document : set) 5957 for (Document* document : set)
5958 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5958 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5959 } 5959 }
5960 #endif 5960 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698