Chromium Code Reviews| 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; |
| } |
| } |