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

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

Issue 2631233003: Avoid mutating frame owner when detaching a provisional frame. (Closed)
Patch Set: Fix test to actually test the changed behavior. Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/FrameOwner.h » ('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) 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 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
9 * rights reserved. 9 * rights reserved.
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 disconnectOwnerElement(); 75 disconnectOwnerElement();
76 // After this, we must no longer talk to the client since this clears 76 // After this, we must no longer talk to the client since this clears
77 // its owning reference back to our owning LocalFrame. 77 // its owning reference back to our owning LocalFrame.
78 m_client->detached(type); 78 m_client->detached(type);
79 m_client = nullptr; 79 m_client = nullptr;
80 m_host = nullptr; 80 m_host = nullptr;
81 } 81 }
82 82
83 void Frame::disconnectOwnerElement() { 83 void Frame::disconnectOwnerElement() {
84 if (m_owner) { 84 if (m_owner) {
85 m_owner->clearContentFrame(); 85 // Ocassionally, provisional frames need to be detached, but it shouldn't
86 // affect the frame tree structure. Make sure the frame owner's content
87 // frame actually refers to this frame before clearing it.
88 // TODO(dcheng): https://crbug.com/578349 tracks the cleanup for this once
89 // it's no longer needed.
90 if (m_owner->contentFrame() == this)
haraken 2017/01/17 09:30:22 Is there any way to add something like DCHECK(isPr
dcheng 2017/01/17 09:38:29 I considered something like that, but didn't add i
91 m_owner->clearContentFrame();
86 m_owner = nullptr; 92 m_owner = nullptr;
87 } 93 }
88 } 94 }
89 95
90 Page* Frame::page() const { 96 Page* Frame::page() const {
91 if (m_host) 97 if (m_host)
92 return &m_host->page(); 98 return &m_host->page();
93 return nullptr; 99 return nullptr;
94 } 100 }
95 101
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 392
387 ASSERT(page()); 393 ASSERT(page());
388 394
389 if (m_owner) 395 if (m_owner)
390 m_owner->setContentFrame(*this); 396 m_owner->setContentFrame(*this);
391 else 397 else
392 page()->setMainFrame(this); 398 page()->setMainFrame(this);
393 } 399 }
394 400
395 } // namespace blink 401 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/FrameOwner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698