OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
7 * rights reserved. | 7 * rights reserved. |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
(...skipping 2386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2397 FrameNavigationDisabler navigationDisabler(*m_frame); | 2397 FrameNavigationDisabler navigationDisabler(*m_frame); |
2398 // Defer widget updates to avoid plugins trying to run script inside | 2398 // Defer widget updates to avoid plugins trying to run script inside |
2399 // ScriptForbiddenScope, which will crash the renderer after | 2399 // ScriptForbiddenScope, which will crash the renderer after |
2400 // https://crrev.com/200984 | 2400 // https://crrev.com/200984 |
2401 HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates; | 2401 HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates; |
2402 // Don't allow script to run in the middle of detachLayoutTree() because a | 2402 // Don't allow script to run in the middle of detachLayoutTree() because a |
2403 // detaching Document is not in a consistent state. | 2403 // detaching Document is not in a consistent state. |
2404 ScriptForbiddenScope forbidScript; | 2404 ScriptForbiddenScope forbidScript; |
2405 | 2405 |
2406 view()->dispose(); | 2406 view()->dispose(); |
| 2407 |
| 2408 // If the widget of the document's frame owner doesn't match view() then |
| 2409 // FrameView::dispose() didn't clear the owner's widget. If we don't clear it |
| 2410 // here, it may be clobbered later in LocalFrame::createView(). See also |
| 2411 // https://crbug.com/673170 and the comment in FrameView::dispose(). |
| 2412 HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner(); |
| 2413 if (ownerElement) |
| 2414 ownerElement->setWidget(nullptr); |
| 2415 |
2407 m_markers->prepareForDestruction(); | 2416 m_markers->prepareForDestruction(); |
2408 | 2417 |
2409 m_lifecycle.advanceTo(DocumentLifecycle::Stopping); | 2418 m_lifecycle.advanceTo(DocumentLifecycle::Stopping); |
2410 | 2419 |
2411 if (page()) | 2420 if (page()) |
2412 page()->documentDetached(this); | 2421 page()->documentDetached(this); |
2413 InspectorInstrumentation::documentDetached(this); | 2422 InspectorInstrumentation::documentDetached(this); |
2414 | 2423 |
2415 if (m_frame->loader().client()->sharedWorkerRepositoryClient()) | 2424 if (m_frame->loader().client()->sharedWorkerRepositoryClient()) |
2416 m_frame->loader() | 2425 m_frame->loader() |
(...skipping 4172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6589 } | 6598 } |
6590 | 6599 |
6591 void showLiveDocumentInstances() { | 6600 void showLiveDocumentInstances() { |
6592 WeakDocumentSet& set = liveDocumentSet(); | 6601 WeakDocumentSet& set = liveDocumentSet(); |
6593 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6602 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6594 for (Document* document : set) | 6603 for (Document* document : set) |
6595 fprintf(stderr, "- Document %p URL: %s\n", document, | 6604 fprintf(stderr, "- Document %p URL: %s\n", document, |
6596 document->url().getString().utf8().data()); | 6605 document->url().getString().utf8().data()); |
6597 } | 6606 } |
6598 #endif | 6607 #endif |
OLD | NEW |