Chromium Code Reviews| Index: Source/core/frame/Frame.cpp |
| diff --git a/Source/core/frame/Frame.cpp b/Source/core/frame/Frame.cpp |
| index 3502201f9bd31c2f21081b6b8ed3daa46ea79968..53b819a8ad665c818922e4bf8bcf5370a88f3b9a 100644 |
| --- a/Source/core/frame/Frame.cpp |
| +++ b/Source/core/frame/Frame.cpp |
| @@ -79,10 +79,16 @@ Frame::Frame(FrameHost* host, HTMLFrameOwnerElement* ownerElement) |
| #ifndef NDEBUG |
| frameCounter.increment(); |
| #endif |
| + |
| + if (this->ownerElement()) { |
| + page()->incrementSubframeCount(); |
| + this->ownerElement()->setContentFrame(*this); |
| + } |
| } |
| Frame::~Frame() |
| { |
| + disconnectOwnerElement(); |
| setDOMWindow(nullptr); |
| // FIXME: We should not be doing all this work inside the destructor |
| @@ -179,4 +185,16 @@ bool Frame::isMainFrame() const |
| return page && this == page->mainFrame(); |
| } |
| +void Frame::disconnectOwnerElement() |
| +{ |
| + if (ownerElement()) { |
| + if (Document* doc = document()) |
| + doc->topDocument().clearAXObjectCache(); |
|
dcheng
2014/03/17 18:17:44
Do we need a FIXME here? What will topDocument() d
kenrb
2014/03/18 20:01:19
Done.
|
| + ownerElement()->clearContentFrame(); |
| + if (page()) |
| + page()->decrementSubframeCount(); |
| + } |
| + m_ownerElement = 0; |
| +} |
| + |
| } // namespace WebCore |