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

Side by Side Diff: Source/web/WebFrame.cpp

Issue 668963002: Delay calling FrameOwner::setWidget when doing a remote->local frame transition (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "core/frame/FrameHost.h" 8 #include "core/frame/FrameHost.h"
9 #include "core/frame/FrameView.h"
9 #include "core/frame/RemoteFrame.h" 10 #include "core/frame/RemoteFrame.h"
10 #include "core/html/HTMLFrameOwnerElement.h" 11 #include "core/html/HTMLFrameOwnerElement.h"
11 #include "platform/UserGestureIndicator.h" 12 #include "platform/UserGestureIndicator.h"
12 #include "platform/heap/Handle.h" 13 #include "platform/heap/Handle.h"
13 #include "web/OpenedFrameTracker.h" 14 #include "web/OpenedFrameTracker.h"
14 #include "web/WebLocalFrameImpl.h" 15 #include "web/WebLocalFrameImpl.h"
15 #include "web/WebRemoteFrameImpl.h" 16 #include "web/WebRemoteFrameImpl.h"
16 #include <algorithm> 17 #include <algorithm>
17 18
18 namespace blink { 19 namespace blink {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 m_openedFrameTracker->updateOpener(frame); 69 m_openedFrameTracker->updateOpener(frame);
69 frame->m_openedFrameTracker.reset(m_openedFrameTracker.release()); 70 frame->m_openedFrameTracker.reset(m_openedFrameTracker.release());
70 } 71 }
71 72
72 // Finally, clone the state of the current Frame into one matching 73 // Finally, clone the state of the current Frame into one matching
73 // the type of the passed in WebFrame. 74 // the type of the passed in WebFrame.
74 // FIXME: This is a bit clunky; this results in pointless decrements and 75 // FIXME: This is a bit clunky; this results in pointless decrements and
75 // increments of connected subframes. 76 // increments of connected subframes.
76 FrameOwner* owner = oldFrame->owner(); 77 FrameOwner* owner = oldFrame->owner();
77 oldFrame->disconnectOwnerElement(); 78 oldFrame->disconnectOwnerElement();
78 if (toCoreFrame(frame)) { 79 if (Frame* newFrame = toCoreFrame(frame)) {
79 ASSERT(owner == toCoreFrame(frame)->owner()); 80 ASSERT(owner == newFrame->owner());
80 if (owner->isLocal()) 81 if (owner->isLocal()) {
81 toHTMLFrameOwnerElement(owner)->setContentFrame(*toCoreFrame(frame)) ; 82 HTMLFrameOwnerElement* ownerElement = toHTMLFrameOwnerElement(owner) ;
83 ownerElement->setContentFrame(*newFrame);
84 if (newFrame->isLocalFrame())
85 ownerElement->setWidget(toLocalFrame(newFrame)->view());
86 }
82 } else if (frame->isWebLocalFrame()) { 87 } else if (frame->isWebLocalFrame()) {
83 toWebLocalFrameImpl(frame)->initializeCoreFrame(oldFrame->host(), owner, oldFrame->tree().name(), nullAtom); 88 toWebLocalFrameImpl(frame)->initializeCoreFrame(oldFrame->host(), owner, oldFrame->tree().name(), nullAtom);
84 } else { 89 } else {
85 toWebRemoteFrameImpl(frame)->initializeCoreFrame(oldFrame->host(), owner , oldFrame->tree().name()); 90 toWebRemoteFrameImpl(frame)->initializeCoreFrame(oldFrame->host(), owner , oldFrame->tree().name());
86 } 91 }
87 92
88 return true; 93 return true;
89 } 94 }
90 95
91 void WebFrame::detach() 96 void WebFrame::detach()
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 } 273 }
269 274
270 void WebFrame::clearWeakFrames(Visitor* visitor) 275 void WebFrame::clearWeakFrames(Visitor* visitor)
271 { 276 {
272 if (!isFrameAlive(visitor, m_opener)) 277 if (!isFrameAlive(visitor, m_opener))
273 m_opener = nullptr; 278 m_opener = nullptr;
274 } 279 }
275 #endif 280 #endif
276 281
277 } // namespace blink 282 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698