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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2393133005: Call LocalDOMWindow::clearDocument when a frame gets detached
Patch Set: temp Created 4 years 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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 4490 matching lines...) Expand 10 before | Expand all | Expand 10 after
4501 view->updateViewportIntersectionsForSubtree(targetState); 4501 view->updateViewportIntersectionsForSubtree(targetState);
4502 } 4502 }
4503 } 4503 }
4504 4504
4505 void FrameView::updateRenderThrottlingStatusForTesting() { 4505 void FrameView::updateRenderThrottlingStatusForTesting() {
4506 m_visibilityObserver->deliverObservationsForTesting(); 4506 m_visibilityObserver->deliverObservationsForTesting();
4507 } 4507 }
4508 4508
4509 void FrameView::updateRenderThrottlingStatus(bool hidden, 4509 void FrameView::updateRenderThrottlingStatus(bool hidden,
4510 bool subtreeThrottled) { 4510 bool subtreeThrottled) {
4511 if (!m_frame->document())
4512 return;
4513
4511 TRACE_EVENT0("blink", "FrameView::updateRenderThrottlingStatus"); 4514 TRACE_EVENT0("blink", "FrameView::updateRenderThrottlingStatus");
4512 DCHECK(!isInPerformLayout()); 4515 DCHECK(!isInPerformLayout());
4513 DCHECK(!m_frame->document() || !m_frame->document()->inStyleRecalc()); 4516 DCHECK(!m_frame->document()->inStyleRecalc());
4514 bool wasThrottled = canThrottleRendering(); 4517 bool wasThrottled = canThrottleRendering();
4515 4518
4516 // Note that we disallow throttling of 0x0 frames because some sites use 4519 // Note that we disallow throttling of 0x0 frames because some sites use
4517 // them to drive UI logic. 4520 // them to drive UI logic.
4518 m_hiddenForThrottling = hidden && !frameRect().isEmpty(); 4521 m_hiddenForThrottling = hidden && !frameRect().isEmpty();
4519 m_subtreeThrottled = subtreeThrottled; 4522 m_subtreeThrottled = subtreeThrottled;
4520 4523
4521 bool isThrottled = canThrottleRendering(); 4524 bool isThrottled = canThrottleRendering();
4522 bool becameUnthrottled = wasThrottled && !isThrottled; 4525 bool becameUnthrottled = wasThrottled && !isThrottled;
4523 4526
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
4567 DCHECK(canThrottleRendering() || !parent->canThrottleRendering()); 4570 DCHECK(canThrottleRendering() || !parent->canThrottleRendering());
4568 parent = parent->parentFrameView(); 4571 parent = parent->parentFrameView();
4569 } 4572 }
4570 #endif 4573 #endif
4571 } 4574 }
4572 4575
4573 // TODO(esprehn): Rename this and the method on Document to 4576 // TODO(esprehn): Rename this and the method on Document to
4574 // recordDeferredLoadReason(). 4577 // recordDeferredLoadReason().
4575 void FrameView::maybeRecordLoadReason() { 4578 void FrameView::maybeRecordLoadReason() {
4576 FrameView* parent = parentFrameView(); 4579 FrameView* parent = parentFrameView();
4577 if (frame().document()->frame()) { 4580 if (frame().document() && frame().document()->frame()) {
4578 if (!parent) { 4581 if (!parent) {
4579 HTMLFrameOwnerElement* element = frame().deprecatedLocalOwner(); 4582 HTMLFrameOwnerElement* element = frame().deprecatedLocalOwner();
4580 if (!element) 4583 if (!element)
4581 frame().document()->maybeRecordLoadReason(WouldLoadOutOfProcess); 4584 frame().document()->maybeRecordLoadReason(WouldLoadOutOfProcess);
4582 // Having no layout object means the frame is not drawn. 4585 // Having no layout object means the frame is not drawn.
4583 else if (!element->layoutObject()) 4586 else if (!element->layoutObject())
4584 frame().document()->maybeRecordLoadReason(WouldLoadDisplayNone); 4587 frame().document()->maybeRecordLoadReason(WouldLoadDisplayNone);
4585 } else { 4588 } else {
4586 // Assume the main frame has always loaded since we don't track its 4589 // Assume the main frame has always loaded since we don't track its
4587 // visibility. 4590 // visibility.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
4652 DCHECK(m_frame->isMainFrame()); 4655 DCHECK(m_frame->isMainFrame());
4653 return m_initialViewportSize.width(); 4656 return m_initialViewportSize.width();
4654 } 4657 }
4655 4658
4656 int FrameView::initialViewportHeight() const { 4659 int FrameView::initialViewportHeight() const {
4657 DCHECK(m_frame->isMainFrame()); 4660 DCHECK(m_frame->isMainFrame());
4658 return m_initialViewportSize.height(); 4661 return m_initialViewportSize.height();
4659 } 4662 }
4660 4663
4661 } // namespace blink 4664 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp ('k') | third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698