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

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

Issue 2633253002: Split content script injections into multiple tasks (Closed)
Patch Set: rebase 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 (!m_frame->client())
haraken 2017/03/02 03:54:32 m_frame->client() => client()
Kunihiko Sakamoto 2017/03/06 09:11:06 Done.
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 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after
2036 m_isNavigationHandledByClient = true; 2049 m_isNavigationHandledByClient = true;
2037 InspectorInstrumentation::frameScheduledClientNavigation(m_frame); 2050 InspectorInstrumentation::frameScheduledClientNavigation(m_frame);
2038 } 2051 }
2039 2052
2040 void FrameLoader::clearNavigationHandledByClient() { 2053 void FrameLoader::clearNavigationHandledByClient() {
2041 m_isNavigationHandledByClient = false; 2054 m_isNavigationHandledByClient = false;
2042 InspectorInstrumentation::frameClearedScheduledClientNavigation(m_frame); 2055 InspectorInstrumentation::frameClearedScheduledClientNavigation(m_frame);
2043 } 2056 }
2044 2057
2045 } // namespace blink 2058 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698