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

Side by Side Diff: Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp

Issue 10391159: Merge 116556 - [chromium] Check whether an active document loader exists before accessing it (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698