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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/FrameOwner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/Frame.cpp
diff --git a/third_party/WebKit/Source/core/frame/Frame.cpp b/third_party/WebKit/Source/core/frame/Frame.cpp
index 6f7a7402da5898e23d8477e1302556579c2b8883..d259c5d72b7450a82a4d6534d673f801fab881a1 100644
--- a/third_party/WebKit/Source/core/frame/Frame.cpp
+++ b/third_party/WebKit/Source/core/frame/Frame.cpp
@@ -82,7 +82,13 @@ void Frame::detach(FrameDetachType type) {
void Frame::disconnectOwnerElement() {
if (m_owner) {
- m_owner->clearContentFrame();
+ // Ocassionally, provisional frames need to be detached, but it shouldn't
+ // affect the frame tree structure. Make sure the frame owner's content
+ // frame actually refers to this frame before clearing it.
+ // TODO(dcheng): https://crbug.com/578349 tracks the cleanup for this once
+ // it's no longer needed.
+ 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
+ m_owner->clearContentFrame();
m_owner = nullptr;
}
}
« 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