| OLD | NEW |
| 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 Loading... |
| 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 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2034 m_isNavigationHandledByClient = true; | 2047 m_isNavigationHandledByClient = true; |
| 2035 probe::frameScheduledClientNavigation(m_frame); | 2048 probe::frameScheduledClientNavigation(m_frame); |
| 2036 } | 2049 } |
| 2037 | 2050 |
| 2038 void FrameLoader::clearNavigationHandledByClient() { | 2051 void FrameLoader::clearNavigationHandledByClient() { |
| 2039 m_isNavigationHandledByClient = false; | 2052 m_isNavigationHandledByClient = false; |
| 2040 probe::frameClearedScheduledClientNavigation(m_frame); | 2053 probe::frameClearedScheduledClientNavigation(m_frame); |
| 2041 } | 2054 } |
| 2042 | 2055 |
| 2043 } // namespace blink | 2056 } // namespace blink |
| OLD | NEW |