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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2589913002: Clear the owner element's widget in Document::shutdown(). (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | 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) 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 2308 matching lines...) Expand 10 before | Expand all | Expand 10 after
2319 FrameNavigationDisabler navigationDisabler(*m_frame); 2319 FrameNavigationDisabler navigationDisabler(*m_frame);
2320 // Defer widget updates to avoid plugins trying to run script inside 2320 // Defer widget updates to avoid plugins trying to run script inside
2321 // ScriptForbiddenScope, which will crash the renderer after 2321 // ScriptForbiddenScope, which will crash the renderer after
2322 // https://crrev.com/200984 2322 // https://crrev.com/200984
2323 HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates; 2323 HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates;
2324 // Don't allow script to run in the middle of detachLayoutTree() because a 2324 // Don't allow script to run in the middle of detachLayoutTree() because a
2325 // detaching Document is not in a consistent state. 2325 // detaching Document is not in a consistent state.
2326 ScriptForbiddenScope forbidScript; 2326 ScriptForbiddenScope forbidScript;
2327 2327
2328 view()->dispose(); 2328 view()->dispose();
2329
2330 // If the widget of the document's frame owner doesn't match view() then
2331 // FrameView::dispose() didn't clear the owner's widget. If we don't clear it
2332 // here, it may be clobbered later in LocalFrame::createView(). See also
2333 // https://crbug.com/673170 and the comment in FrameView::dispose().
2334 HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner();
2335 if (ownerElement)
2336 ownerElement->setWidget(nullptr);
2337
2329 m_markers->prepareForDestruction(); 2338 m_markers->prepareForDestruction();
2330 2339
2331 m_lifecycle.advanceTo(DocumentLifecycle::Stopping); 2340 m_lifecycle.advanceTo(DocumentLifecycle::Stopping);
2332 2341
2333 if (page()) 2342 if (page())
2334 page()->documentDetached(this); 2343 page()->documentDetached(this);
2335 InspectorInstrumentation::documentDetached(this); 2344 InspectorInstrumentation::documentDetached(this);
2336 2345
2337 if (m_frame->loader().client()->sharedWorkerRepositoryClient()) 2346 if (m_frame->loader().client()->sharedWorkerRepositoryClient())
2338 m_frame->loader() 2347 m_frame->loader()
(...skipping 4147 matching lines...) Expand 10 before | Expand all | Expand 10 after
6486 } 6495 }
6487 6496
6488 void showLiveDocumentInstances() { 6497 void showLiveDocumentInstances() {
6489 WeakDocumentSet& set = liveDocumentSet(); 6498 WeakDocumentSet& set = liveDocumentSet();
6490 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6499 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6491 for (Document* document : set) 6500 for (Document* document : set)
6492 fprintf(stderr, "- Document %p URL: %s\n", document, 6501 fprintf(stderr, "- Document %p URL: %s\n", document,
6493 document->url().getString().utf8().data()); 6502 document->url().getString().utf8().data());
6494 } 6503 }
6495 #endif 6504 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698