Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "public/web/WebFrame.h" | 6 #include "public/web/WebFrame.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/WindowProxyManager.h" | 8 #include "bindings/core/v8/WindowProxyManager.h" |
| 9 #include "core/frame/FrameHost.h" | 9 #include "core/frame/FrameHost.h" |
| 10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 FrameHost* host = oldFrame->host(); | 83 FrameHost* host = oldFrame->host(); |
| 84 AtomicString name = oldFrame->tree().name(); | 84 AtomicString name = oldFrame->tree().name(); |
| 85 FrameOwner* owner = oldFrame->owner(); | 85 FrameOwner* owner = oldFrame->owner(); |
| 86 oldFrame->disconnectOwnerElement(); | 86 oldFrame->disconnectOwnerElement(); |
| 87 | 87 |
| 88 v8::HandleScope handleScope(v8::Isolate::GetCurrent()); | 88 v8::HandleScope handleScope(v8::Isolate::GetCurrent()); |
| 89 HashMap<DOMWrapperWorld*, v8::Local<v8::Object>> globals; | 89 HashMap<DOMWrapperWorld*, v8::Local<v8::Object>> globals; |
| 90 oldFrame->windowProxyManager()->clearForNavigation(); | 90 oldFrame->windowProxyManager()->clearForNavigation(); |
| 91 oldFrame->windowProxyManager()->releaseGlobals(globals); | 91 oldFrame->windowProxyManager()->releaseGlobals(globals); |
| 92 | 92 |
| 93 if (oldFrame->isMainFrame()) | |
| 94 oldFrame->page()->willSwapMainFrame(toCoreFrame(frame)); | |
| 95 | |
| 93 // Although the Document in this frame is now unloaded, many resources | 96 // Although the Document in this frame is now unloaded, many resources |
| 94 // associated with the frame itself have not yet been freed yet. | 97 // associated with the frame itself have not yet been freed yet. |
| 95 oldFrame->detach(FrameDetachType::Swap); | 98 oldFrame->detach(FrameDetachType::Swap); |
|
aelias_OOO_until_Jul13
2015/11/19 01:19:58
Please plumb it from this detach() method instead.
loyso (OOO)
2015/11/19 03:55:00
Done.
loyso (OOO)
2015/11/19 03:59:32
p.s. WebFrame::detach is already called from Page:
| |
| 96 | 99 |
| 97 // Finally, clone the state of the current Frame into one matching | 100 // Finally, clone the state of the current Frame into one matching |
| 98 // the type of the passed in WebFrame. | 101 // the type of the passed in WebFrame. |
| 99 // FIXME: This is a bit clunky; this results in pointless decrements and | 102 // FIXME: This is a bit clunky; this results in pointless decrements and |
| 100 // increments of connected subframes. | 103 // increments of connected subframes. |
| 101 if (frame->isWebLocalFrame()) { | 104 if (frame->isWebLocalFrame()) { |
| 102 LocalFrame& localFrame = *toWebLocalFrameImpl(frame)->frame(); | 105 LocalFrame& localFrame = *toWebLocalFrameImpl(frame)->frame(); |
| 103 ASSERT(owner == localFrame.owner()); | 106 ASSERT(owner == localFrame.owner()); |
| 104 if (owner) { | 107 if (owner) { |
| 105 if (owner->isLocal()) { | 108 if (owner->isLocal()) { |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 363 void WebFrame::traceFrames(VisitorDispatcher visitor, WebFrame* frame) { tra ceFramesImpl(visitor, frame); } \ | 366 void WebFrame::traceFrames(VisitorDispatcher visitor, WebFrame* frame) { tra ceFramesImpl(visitor, frame); } \ |
| 364 void WebFrame::clearWeakFrames(VisitorDispatcher visitor) { clearWeakFramesI mpl(visitor); } | 367 void WebFrame::clearWeakFrames(VisitorDispatcher visitor) { clearWeakFramesI mpl(visitor); } |
| 365 | 368 |
| 366 DEFINE_VISITOR_METHOD(Visitor*) | 369 DEFINE_VISITOR_METHOD(Visitor*) |
| 367 DEFINE_VISITOR_METHOD(InlinedGlobalMarkingVisitor) | 370 DEFINE_VISITOR_METHOD(InlinedGlobalMarkingVisitor) |
| 368 | 371 |
| 369 #undef DEFINE_VISITOR_METHOD | 372 #undef DEFINE_VISITOR_METHOD |
| 370 #endif | 373 #endif |
| 371 | 374 |
| 372 } // namespace blink | 375 } // namespace blink |
| OLD | NEW |