OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 void FrameLoaderClientImpl::dispatchDidNavigateWithinPage() | 627 void FrameLoaderClientImpl::dispatchDidNavigateWithinPage() |
628 { | 628 { |
629 // Anchor fragment navigations are not normal loads, so we need to synthesiz
e | 629 // Anchor fragment navigations are not normal loads, so we need to synthesiz
e |
630 // some events for our delegate. | 630 // some events for our delegate. |
631 WebViewImpl* webView = m_webFrame->viewImpl(); | 631 WebViewImpl* webView = m_webFrame->viewImpl(); |
632 | 632 |
633 // Flag of whether frame loader is completed. Generate didStartLoading and | 633 // Flag of whether frame loader is completed. Generate didStartLoading and |
634 // didStopLoading only when loader is completed so that we don't fire | 634 // didStopLoading only when loader is completed so that we don't fire |
635 // them for fragment redirection that happens in window.onload handler. | 635 // them for fragment redirection that happens in window.onload handler. |
636 // See https://bugs.webkit.org/show_bug.cgi?id=31838 | 636 // See https://bugs.webkit.org/show_bug.cgi?id=31838 |
637 bool loaderCompleted = | 637 // |
638 !webView->page()->mainFrame()->loader()->activeDocumentLoader()->isLoadi
ngInAPISense(); | 638 // FIXME: Although FrameLoader::loadInSameDocument which invokes this |
| 639 // method does not have a provisional document loader, we're seeing crashes |
| 640 // where the FrameLoader is in provisional state, and thus |
| 641 // activeDocumentLoader returns 0. Lacking any understanding of how this |
| 642 // can happen, we do this check here to avoid crashing. |
| 643 FrameLoader* loader = webView->page()->mainFrame()->loader(); |
| 644 bool loaderCompleted = !(loader->activeDocumentLoader() && loader->activeDoc
umentLoader()->isLoadingInAPISense()); |
639 | 645 |
640 // Generate didStartLoading if loader is completed. | 646 // Generate didStartLoading if loader is completed. |
641 if (webView->client() && loaderCompleted) | 647 if (webView->client() && loaderCompleted) |
642 webView->client()->didStartLoading(); | 648 webView->client()->didStartLoading(); |
643 | 649 |
644 // We need to classify some hash changes as client redirects. | 650 // We need to classify some hash changes as client redirects. |
645 // FIXME: It seems wrong that the currentItem can sometimes be null. | 651 // FIXME: It seems wrong that the currentItem can sometimes be null. |
646 HistoryItem* currentItem = m_webFrame->frame()->loader()->history()->current
Item(); | 652 HistoryItem* currentItem = m_webFrame->frame()->loader()->history()->current
Item(); |
647 bool isHashChange = !currentItem || !currentItem->stateObject(); | 653 bool isHashChange = !currentItem || !currentItem->stateObject(); |
648 | 654 |
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1601 m_webFrame->client()->dispatchIntent(webFrame(), intentRequest); | 1607 m_webFrame->client()->dispatchIntent(webFrame(), intentRequest); |
1602 } | 1608 } |
1603 #endif | 1609 #endif |
1604 | 1610 |
1605 void FrameLoaderClientImpl::dispatchWillOpenSocketStream(SocketStreamHandle* han
dle) | 1611 void FrameLoaderClientImpl::dispatchWillOpenSocketStream(SocketStreamHandle* han
dle) |
1606 { | 1612 { |
1607 m_webFrame->client()->willOpenSocketStream(SocketStreamHandleInternal::toWeb
SocketStreamHandle(handle)); | 1613 m_webFrame->client()->willOpenSocketStream(SocketStreamHandleInternal::toWeb
SocketStreamHandle(handle)); |
1608 } | 1614 } |
1609 | 1615 |
1610 } // namespace WebKit | 1616 } // namespace WebKit |
OLD | NEW |