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

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

Issue 1300693002: Early exit experiment in FrameLoader::finishedParsing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | Annotate | Revision Log
« 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) 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 } 464 }
465 465
466 if (m_provisionalItem && isBackForwardLoadType(m_loadType)) 466 if (m_provisionalItem && isBackForwardLoadType(m_loadType))
467 m_frame->document()->setStateForNewFormElements(m_provisionalItem->docum entState()); 467 m_frame->document()->setStateForNewFormElements(m_provisionalItem->docum entState());
468 468
469 client()->didCreateNewDocument(); 469 client()->didCreateNewDocument();
470 } 470 }
471 471
472 void FrameLoader::finishedParsing() 472 void FrameLoader::finishedParsing()
473 { 473 {
474 if (m_stateMachine.creatingInitialEmptyDocument()) 474 if (m_stateMachine.creatingInitialEmptyDocument() || !m_documentLoader)
475 return; 475 return;
476 476
477 // This can be called from the LocalFrame's destructor, in which case we sho uldn't protect ourselves 477 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame);
478 // because doing so will cause us to re-enter the destructor when protector goes out of scope.
479 // Null-checking the FrameView indicates whether or not we're in the destruc tor.
480 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame->view() ? m_frame.get() : nul lptr);
481
482 m_progressTracker->finishedParsing(); 478 m_progressTracker->finishedParsing();
483 479 client()->dispatchDidFinishDocumentLoad(m_documentLoader->isCommittedButEmpt y());
484 if (client())
485 client()->dispatchDidFinishDocumentLoad(m_documentLoader->isCommittedBut Empty());
486
487 checkCompleted(); 480 checkCompleted();
488 481
489 if (!m_frame->view()) 482 if (!m_documentLoader)
490 return; // We are being destroyed by something checkCompleted called. 483 return; // We are being destroyed by something checkCompleted called.
491 484
492 // Check if the scrollbars are really needed for the content. 485 // Check if the scrollbars are really needed for the content.
493 // If not, remove them, relayout, and repaint. 486 // If not, remove them, relayout, and repaint.
494 m_frame->view()->restoreScrollbar(); 487 m_frame->view()->restoreScrollbar();
495 processFragment(m_frame->document()->url(), NavigationToDifferentDocument); 488 processFragment(m_frame->document()->url(), NavigationToDifferentDocument);
496 } 489 }
497 490
498 static bool allDescendantsAreComplete(Frame* frame) 491 static bool allDescendantsAreComplete(Frame* frame)
499 { 492 {
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 // FIXME: We need a way to propagate insecure requests policy flags to 1507 // FIXME: We need a way to propagate insecure requests policy flags to
1515 // out-of-process frames. For now, we'll always use default behavior. 1508 // out-of-process frames. For now, we'll always use default behavior.
1516 if (!parentFrame->isLocalFrame()) 1509 if (!parentFrame->isLocalFrame())
1517 return nullptr; 1510 return nullptr;
1518 1511
1519 ASSERT(toLocalFrame(parentFrame)->document()); 1512 ASSERT(toLocalFrame(parentFrame)->document());
1520 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1513 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1521 } 1514 }
1522 1515
1523 } // namespace blink 1516 } // namespace blink
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