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

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 1413093007: OOPIF: Use the same uniqueName when swapping between local and remote. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Preserve uniqueName Created 5 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after
1992 void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFra me, const WebString& name, WebSandboxFlags flags, const WebFrameOwnerProperties& frameOwnerProperties) 1992 void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFra me, const WebString& name, WebSandboxFlags flags, const WebFrameOwnerProperties& frameOwnerProperties)
1993 { 1993 {
1994 Frame* oldFrame = toCoreFrame(oldWebFrame); 1994 Frame* oldFrame = toCoreFrame(oldWebFrame);
1995 // Note: this *always* temporarily sets a frame owner, even for main frames! 1995 // Note: this *always* temporarily sets a frame owner, even for main frames!
1996 // When a core Frame is created with no owner, it attempts to set itself as 1996 // When a core Frame is created with no owner, it attempts to set itself as
1997 // the main frame of the Page. However, this is a provisional frame, and may 1997 // the main frame of the Page. However, this is a provisional frame, and may
1998 // disappear, so Page::m_mainFrame can't be updated just yet. 1998 // disappear, so Page::m_mainFrame can't be updated just yet.
1999 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = RemoteBridgeFrameOwner::create(nu llptr, SandboxNone, WebFrameOwnerProperties()); 1999 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = RemoteBridgeFrameOwner::create(nu llptr, SandboxNone, WebFrameOwnerProperties());
2000 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(m_frameLoaderClien tImpl.get(), oldFrame->host(), tempOwner.get()); 2000 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(m_frameLoaderClien tImpl.get(), oldFrame->host(), tempOwner.get());
2001 frame->setOwner(oldFrame->owner()); 2001 frame->setOwner(oldFrame->owner());
2002 frame->tree().setName(name);
2003 setParent(oldWebFrame->parent()); 2002 setParent(oldWebFrame->parent());
2004 setOpener(oldWebFrame->opener()); 2003 setOpener(oldWebFrame->opener());
2004
2005 // Set the name and unique name directly.
2006 // TODO(creis): Remove |name| parameter.
Charlie Reis 2015/11/06 23:04:48 We would need to be able to call WebRemoteFrame::n
2007 frame->tree().setNameForReplacementFrame(name, oldWebFrame->uniqueName());
2005 setCoreFrame(frame); 2008 setCoreFrame(frame);
2006 2009
2007 if (frame->owner() && !frame->owner()->isLocal()) { 2010 if (frame->owner() && !frame->owner()->isLocal()) {
2008 toRemoteBridgeFrameOwner(frame->owner())->setSandboxFlags(static_cast<Sa ndboxFlags>(flags)); 2011 toRemoteBridgeFrameOwner(frame->owner())->setSandboxFlags(static_cast<Sa ndboxFlags>(flags));
2009 // Since a remote frame doesn't get the notifications about frame owner 2012 // Since a remote frame doesn't get the notifications about frame owner
2010 // property modifications, we need to sync up those properties here. 2013 // property modifications, we need to sync up those properties here.
2011 WebLocalFrameImpl::fromFrame(frame.get())->setFrameOwnerProperties(frame OwnerProperties); 2014 WebLocalFrameImpl::fromFrame(frame.get())->setFrameOwnerProperties(frame OwnerProperties);
2012 } 2015 }
2013 2016
2014 // We must call init() after m_frame is assigned because it is referenced 2017 // We must call init() after m_frame is assigned because it is referenced
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
2219 } 2222 }
2220 2223
2221 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const 2224 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const
2222 { 2225 {
2223 if (!frame()) 2226 if (!frame())
2224 return WebSandboxFlags::None; 2227 return WebSandboxFlags::None;
2225 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2228 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2226 } 2229 }
2227 2230
2228 } // namespace blink 2231 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698