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

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

Issue 317493002: Change FrameTree to return Frames instead of LocalFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: dcheng's comment addressed Created 6 years, 6 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
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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 } 304 }
305 305
306 void FrameLoader::receivedFirstData() 306 void FrameLoader::receivedFirstData()
307 { 307 {
308 if (m_stateMachine.creatingInitialEmptyDocument()) 308 if (m_stateMachine.creatingInitialEmptyDocument())
309 return; 309 return;
310 310
311 HistoryCommitType historyCommitType = loadTypeToCommitType(m_loadType); 311 HistoryCommitType historyCommitType = loadTypeToCommitType(m_loadType);
312 if (historyCommitType == StandardCommit && (m_documentLoader->urlForHistory( ).isEmpty() || (opener() && !m_currentItem && m_documentLoader->originalRequest( ).url().isEmpty()))) 312 if (historyCommitType == StandardCommit && (m_documentLoader->urlForHistory( ).isEmpty() || (opener() && !m_currentItem && m_documentLoader->originalRequest( ).url().isEmpty())))
313 historyCommitType = HistoryInertCommit; 313 historyCommitType = HistoryInertCommit;
314 else if (historyCommitType == InitialCommitInChildFrame && (!m_frame->tree() .top()->isLocalFrame() || MixedContentChecker::isMixedContent(m_frame->tree().to p()->document()->securityOrigin(), m_documentLoader->url()))) 314 else if (historyCommitType == InitialCommitInChildFrame && (!m_frame->tree() .top()->isLocalFrame() || MixedContentChecker::isMixedContent(toLocalFrame(m_fra me->tree().top())->document()->securityOrigin(), m_documentLoader->url())))
315 historyCommitType = HistoryInertCommit; 315 historyCommitType = HistoryInertCommit;
316 setHistoryItemStateForCommit(historyCommitType); 316 setHistoryItemStateForCommit(historyCommitType);
317 317
318 if (!m_stateMachine.committedMultipleRealLoads() && m_loadType == FrameLoadT ypeStandard) 318 if (!m_stateMachine.committedMultipleRealLoads() && m_loadType == FrameLoadT ypeStandard)
319 m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedMultipleRealL oads); 319 m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedMultipleRealL oads);
320 320
321 client()->dispatchDidCommitLoad(m_frame, m_currentItem.get(), historyCommitT ype); 321 client()->dispatchDidCommitLoad(m_frame, m_currentItem.get(), historyCommitT ype);
322 322
323 InspectorInstrumentation::didCommitLoad(m_frame, m_documentLoader.get()); 323 InspectorInstrumentation::didCommitLoad(m_frame, m_documentLoader.get());
324 m_frame->page()->didCommitLoad(m_frame); 324 m_frame->page()->didCommitLoad(m_frame);
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 m_isComplete = false; 591 m_isComplete = false;
592 checkCompleted(); 592 checkCompleted();
593 593
594 m_frame->domWindow()->statePopped(stateObject ? stateObject : SerializedScri ptValue::nullValue()); 594 m_frame->domWindow()->statePopped(stateObject ? stateObject : SerializedScri ptValue::nullValue());
595 } 595 }
596 596
597 void FrameLoader::completed() 597 void FrameLoader::completed()
598 { 598 {
599 RefPtr<LocalFrame> protect(m_frame); 599 RefPtr<LocalFrame> protect(m_frame);
600 600
601 for (LocalFrame* descendant = m_frame->tree().traverseNext(m_frame); descend ant; descendant = descendant->tree().traverseNext(m_frame)) 601 for (Frame* descendant = m_frame->tree().traverseNext(m_frame); descendant; descendant = descendant->tree().traverseNext(m_frame)) {
602 descendant->navigationScheduler().startTimer(); 602 if (descendant->isLocalFrame())
603 toLocalFrame(descendant)->navigationScheduler().startTimer();
604 }
603 605
604 if (LocalFrame* parent = m_frame->tree().parent()) 606 Frame* parent = m_frame->tree().parent();
605 parent->loader().checkCompleted(); 607 if (parent && parent->isLocalFrame())
608 toLocalFrame(parent)->loader().checkCompleted();
606 609
607 if (m_frame->view()) 610 if (m_frame->view())
608 m_frame->view()->maintainScrollPositionAtAnchor(0); 611 m_frame->view()->maintainScrollPositionAtAnchor(0);
609 } 612 }
610 613
611 void FrameLoader::started() 614 void FrameLoader::started()
612 { 615 {
613 for (Frame* frame = m_frame; frame; frame = frame->tree().parent()) { 616 for (Frame* frame = m_frame; frame; frame = frame->tree().parent()) {
614 if (frame->isLocalFrame()) 617 if (frame->isLocalFrame())
615 toLocalFrame(frame)->loader().m_isComplete = false; 618 toLocalFrame(frame)->loader().m_isComplete = false;
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 // FIXME: We need a way to propagate sandbox flags to out-of-process frames. 1472 // FIXME: We need a way to propagate sandbox flags to out-of-process frames.
1470 Frame* parentFrame = m_frame->tree().parent(); 1473 Frame* parentFrame = m_frame->tree().parent();
1471 if (parentFrame && parentFrame->isLocalFrame()) 1474 if (parentFrame && parentFrame->isLocalFrame())
1472 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags(); 1475 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags();
1473 if (FrameOwner* frameOwner = m_frame->owner()) 1476 if (FrameOwner* frameOwner = m_frame->owner())
1474 flags |= frameOwner->sandboxFlags(); 1477 flags |= frameOwner->sandboxFlags();
1475 return flags; 1478 return flags;
1476 } 1479 }
1477 1480
1478 } // namespace WebCore 1481 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/loader/FrameFetchContext.cpp ('k') | Source/core/loader/TextResourceDecoderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698