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

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

Issue 984983002: Do not fire didStartLoading and didStopLoading events twice. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Change new method name Created 5 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
« no previous file with comments | « Source/core/dom/Document.h ('k') | 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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 555
556 void FrameLoader::updateForSameDocumentNavigation(const KURL& newURL, SameDocume ntNavigationSource sameDocumentNavigationSource, PassRefPtr<SerializedScriptValu e> data, FrameLoadType type) 556 void FrameLoader::updateForSameDocumentNavigation(const KURL& newURL, SameDocume ntNavigationSource sameDocumentNavigationSource, PassRefPtr<SerializedScriptValu e> data, FrameLoadType type)
557 { 557 {
558 // Update the data source's request with the new URL to fake the URL change 558 // Update the data source's request with the new URL to fake the URL change
559 m_frame->document()->setURL(newURL); 559 m_frame->document()->setURL(newURL);
560 documentLoader()->setReplacesCurrentHistoryItem(type != FrameLoadTypeStandar d); 560 documentLoader()->setReplacesCurrentHistoryItem(type != FrameLoadTypeStandar d);
561 documentLoader()->updateForSameDocumentNavigation(newURL, sameDocumentNaviga tionSource); 561 documentLoader()->updateForSameDocumentNavigation(newURL, sameDocumentNaviga tionSource);
562 562
563 // Generate start and stop notifications only when loader is completed so th at we 563 // Generate start and stop notifications only when loader is completed so th at we
564 // don't fire them for fragment redirection that happens in window.onload ha ndler. 564 // don't fire them for fragment redirection that happens in window.onload ha ndler.
565 // See https://bugs.webkit.org/show_bug.cgi?id=31838 565 // See https://bugs.webkit.org/show_bug.cgi?id=31838 and crbug.com/464675
566 if (m_frame->document()->loadEventFinished()) 566 if (m_frame->document()->isLoadEventCompleted())
567 client()->didStartLoading(NavigationWithinSameDocument); 567 client()->didStartLoading(NavigationWithinSameDocument);
568 568
569 HistoryCommitType historyCommitType = loadTypeToCommitType(type); 569 HistoryCommitType historyCommitType = loadTypeToCommitType(type);
570 if (!m_currentItem) 570 if (!m_currentItem)
571 historyCommitType = HistoryInertCommit; 571 historyCommitType = HistoryInertCommit;
572 572
573 setHistoryItemStateForCommit(historyCommitType, sameDocumentNavigationSource == SameDocumentNavigationHistoryApi, data); 573 setHistoryItemStateForCommit(historyCommitType, sameDocumentNavigationSource == SameDocumentNavigationHistoryApi, data);
574 client()->dispatchDidNavigateWithinPage(m_currentItem.get(), historyCommitTy pe); 574 client()->dispatchDidNavigateWithinPage(m_currentItem.get(), historyCommitTy pe);
575 client()->dispatchDidReceiveTitle(m_frame->document()->title()); 575 client()->dispatchDidReceiveTitle(m_frame->document()->title());
576 if (m_frame->document()->loadEventFinished()) 576 if (m_frame->document()->isLoadEventCompleted())
577 client()->didStopLoading(); 577 client()->didStopLoading();
578 } 578 }
579 579
580 void FrameLoader::loadInSameDocument(const KURL& url, PassRefPtr<SerializedScrip tValue> stateObject, FrameLoadType type, ClientRedirectPolicy clientRedirect) 580 void FrameLoader::loadInSameDocument(const KURL& url, PassRefPtr<SerializedScrip tValue> stateObject, FrameLoadType type, ClientRedirectPolicy clientRedirect)
581 { 581 {
582 // If we have a state object, we cannot also be a new navigation. 582 // If we have a state object, we cannot also be a new navigation.
583 ASSERT(!stateObject || type == FrameLoadTypeBackForward); 583 ASSERT(!stateObject || type == FrameLoadTypeBackForward);
584 584
585 // If we have a provisional request for a different document, a fragment scr oll should cancel it. 585 // If we have a provisional request for a different document, a fragment scr oll should cancel it.
586 if (m_provisionalDocumentLoader) { 586 if (m_provisionalDocumentLoader) {
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 1423
1424 // FIXME: We need a way to propagate insecure requests policy flags to 1424 // FIXME: We need a way to propagate insecure requests policy flags to
1425 // out-of-process frames. For now, we'll always use default behavior. 1425 // out-of-process frames. For now, we'll always use default behavior.
1426 if (!parentFrame->isLocalFrame()) 1426 if (!parentFrame->isLocalFrame())
1427 return nullptr; 1427 return nullptr;
1428 1428
1429 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1429 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1430 } 1430 }
1431 1431
1432 } // namespace blink 1432 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698