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 "public/web/WebFrame.h" | 5 #include "public/web/WebFrame.h" |
6 | 6 |
7 #include "bindings/core/v8/WindowProxyManager.h" | 7 #include "bindings/core/v8/WindowProxyManager.h" |
8 #include "core/HTMLNames.h" | 8 #include "core/HTMLNames.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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 | 63 |
64 if (m_opener) { | 64 if (m_opener) { |
65 frame->setOpener(m_opener); | 65 frame->setOpener(m_opener); |
66 setOpener(nullptr); | 66 setOpener(nullptr); |
67 } | 67 } |
68 m_openedFrameTracker->transferTo(frame); | 68 m_openedFrameTracker->transferTo(frame); |
69 | 69 |
70 FrameHost* host = oldFrame->host(); | 70 FrameHost* host = oldFrame->host(); |
71 AtomicString name = oldFrame->tree().name(); | 71 AtomicString name = oldFrame->tree().name(); |
72 AtomicString uniqueName = oldFrame->tree().uniqueName(); | |
73 FrameOwner* owner = oldFrame->owner(); | 72 FrameOwner* owner = oldFrame->owner(); |
74 | 73 |
75 v8::HandleScope handleScope(v8::Isolate::GetCurrent()); | 74 v8::HandleScope handleScope(v8::Isolate::GetCurrent()); |
76 HashMap<DOMWrapperWorld*, v8::Local<v8::Object>> globals; | 75 HashMap<DOMWrapperWorld*, v8::Local<v8::Object>> globals; |
77 oldFrame->getWindowProxyManager()->clearForNavigation(); | 76 oldFrame->getWindowProxyManager()->clearForNavigation(); |
78 oldFrame->getWindowProxyManager()->releaseGlobals(globals); | 77 oldFrame->getWindowProxyManager()->releaseGlobals(globals); |
79 | 78 |
80 // Although the Document in this frame is now unloaded, many resources | 79 // Although the Document in this frame is now unloaded, many resources |
81 // associated with the frame itself have not yet been freed yet. | 80 // associated with the frame itself have not yet been freed yet. |
82 oldFrame->detach(FrameDetachType::Swap); | 81 oldFrame->detach(FrameDetachType::Swap); |
(...skipping 11 matching lines...) Expand all Loading... |
94 LocalFrame& localFrame = *toWebLocalFrameImpl(frame)->frame(); | 93 LocalFrame& localFrame = *toWebLocalFrameImpl(frame)->frame(); |
95 DCHECK_EQ(owner, localFrame.owner()); | 94 DCHECK_EQ(owner, localFrame.owner()); |
96 if (owner) { | 95 if (owner) { |
97 owner->setContentFrame(localFrame); | 96 owner->setContentFrame(localFrame); |
98 if (owner->isLocal()) | 97 if (owner->isLocal()) |
99 toHTMLFrameOwnerElement(owner)->setWidget(localFrame.view()); | 98 toHTMLFrameOwnerElement(owner)->setWidget(localFrame.view()); |
100 } else { | 99 } else { |
101 localFrame.page()->setMainFrame(&localFrame); | 100 localFrame.page()->setMainFrame(&localFrame); |
102 } | 101 } |
103 } else { | 102 } else { |
104 toWebRemoteFrameImpl(frame)->initializeCoreFrame(host, owner, name, | 103 toWebRemoteFrameImpl(frame)->initializeCoreFrame(host, owner, name); |
105 uniqueName); | |
106 } | 104 } |
107 | 105 |
108 if (oldFrame->hasReceivedUserGesture()) | 106 if (oldFrame->hasReceivedUserGesture()) |
109 frame->toImplBase()->frame()->setDocumentHasReceivedUserGesture(); | 107 frame->toImplBase()->frame()->setDocumentHasReceivedUserGesture(); |
110 | 108 |
111 frame->toImplBase()->frame()->getWindowProxyManager()->setGlobals(globals); | 109 frame->toImplBase()->frame()->getWindowProxyManager()->setGlobals(globals); |
112 | 110 |
113 m_parent = nullptr; | 111 m_parent = nullptr; |
114 | 112 |
115 return true; | 113 return true; |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 for (WebFrame* child = frame->firstChild(); child; | 306 for (WebFrame* child = frame->firstChild(); child; |
309 child = child->nextSibling()) | 307 child = child->nextSibling()) |
310 traceFrame(visitor, child); | 308 traceFrame(visitor, child); |
311 } | 309 } |
312 | 310 |
313 void WebFrame::close() { | 311 void WebFrame::close() { |
314 m_openedFrameTracker->dispose(); | 312 m_openedFrameTracker->dispose(); |
315 } | 313 } |
316 | 314 |
317 } // namespace blink | 315 } // namespace blink |
OLD | NEW |