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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2633253002: Split content script injections into multiple tasks (Closed)
Patch Set: comments addressed Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
6 * (http://www.torchmobile.com/) 6 * (http://www.torchmobile.com/)
7 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 7 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
8 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
10 * Copyright (C) 2011 Google Inc. All rights reserved. 10 * Copyright (C) 2011 Google Inc. All rights reserved.
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 // Only send didStopLoading() if there are no navigations in progress at all, 711 // Only send didStopLoading() if there are no navigations in progress at all,
712 // whether committed, provisional, or pending. 712 // whether committed, provisional, or pending.
713 return frame->loader().documentLoader()->sentDidFinishLoad() && 713 return frame->loader().documentLoader()->sentDidFinishLoad() &&
714 !frame->loader().hasProvisionalNavigation(); 714 !frame->loader().hasProvisionalNavigation();
715 } 715 }
716 716
717 void FrameLoader::checkCompleted() { 717 void FrameLoader::checkCompleted() {
718 if (!shouldComplete(m_frame->document())) 718 if (!shouldComplete(m_frame->document()))
719 return; 719 return;
720 720
721 if (client()) {
722 client()->runScriptsAtDocumentIdle();
723
724 // Injected scripts may have disconnected this frame.
725 if (!client())
726 return;
727
728 // Check again, because runScriptsAtDocumentIdle() may have delayed the load
729 // event.
730 if (!shouldComplete(m_frame->document()))
731 return;
732 }
733
721 // OK, completed. 734 // OK, completed.
722 m_frame->document()->setReadyState(Document::Complete); 735 m_frame->document()->setReadyState(Document::Complete);
723 if (m_frame->document()->loadEventStillNeeded()) 736 if (m_frame->document()->loadEventStillNeeded())
724 m_frame->document()->implicitClose(); 737 m_frame->document()->implicitClose();
725 738
726 m_frame->navigationScheduler().startTimer(); 739 m_frame->navigationScheduler().startTimer();
727 740
728 if (m_frame->view()) 741 if (m_frame->view())
729 m_frame->view()->handleLoadCompleted(); 742 m_frame->view()->handleLoadCompleted();
730 743
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1981 frameLoadRequest.clientRedirect()); 1994 frameLoadRequest.clientRedirect());
1982 1995
1983 loader->setLoadType(loadType); 1996 loader->setLoadType(loadType);
1984 loader->setNavigationType(navigationType); 1997 loader->setNavigationType(navigationType);
1985 loader->setReplacesCurrentHistoryItem(loadType == 1998 loader->setReplacesCurrentHistoryItem(loadType ==
1986 FrameLoadTypeReplaceCurrentItem); 1999 FrameLoadTypeReplaceCurrentItem);
1987 return loader; 2000 return loader;
1988 } 2001 }
1989 2002
1990 } // namespace blink 2003 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/EmptyClients.h ('k') | third_party/WebKit/Source/web/LocalFrameClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698