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

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

Issue 1315543009: Revert of OOPIF: Call setCoreFrame on remote-to-local swaps. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 void WebLocalFrameImpl::setOpener(WebFrame* opener) 740 void WebLocalFrameImpl::setOpener(WebFrame* opener)
741 { 741 {
742 // TODO(alexmos): Remove this once didChangeOpener is implemented in 742 // TODO(alexmos): Remove this once didChangeOpener is implemented in
743 // content, as all opener updates will go through it, including disowned 743 // content, as all opener updates will go through it, including disowned
744 // openers. 744 // openers.
745 if (WebFrame::opener() && !opener && m_client) 745 if (WebFrame::opener() && !opener && m_client)
746 m_client->didDisownOpener(this); 746 m_client->didDisownOpener(this);
747 747
748 WebFrame::setOpener(opener); 748 WebFrame::setOpener(opener);
749 749
750 // TODO(alexmos,dcheng): This should ASSERT(m_frame) once we no longer have 750 ASSERT(m_frame);
751 // provisional local frames.
752 if (m_frame && m_frame->document()) 751 if (m_frame && m_frame->document())
753 m_frame->document()->initSecurityContext(); 752 m_frame->document()->initSecurityContext();
754 } 753 }
755 754
756 WebDocument WebLocalFrameImpl::document() const 755 WebDocument WebLocalFrameImpl::document() const
757 { 756 {
758 if (!frame() || !frame()->document()) 757 if (!frame() || !frame()->document())
759 return WebDocument(); 758 return WebDocument();
760 return WebDocument(frame()->document()); 759 return WebDocument(frame()->document());
761 } 760 }
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1996 } 1995 }
1997 1996
1998 void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFra me, const WebString& name, WebSandboxFlags flags) 1997 void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFra me, const WebString& name, WebSandboxFlags flags)
1999 { 1998 {
2000 Frame* oldFrame = toCoreFrame(oldWebFrame); 1999 Frame* oldFrame = toCoreFrame(oldWebFrame);
2001 // Note: this *always* temporarily sets a frame owner, even for main frames! 2000 // Note: this *always* temporarily sets a frame owner, even for main frames!
2002 // When a core Frame is created with no owner, it attempts to set itself as 2001 // When a core Frame is created with no owner, it attempts to set itself as
2003 // the main frame of the Page. However, this is a provisional frame, and may 2002 // the main frame of the Page. However, this is a provisional frame, and may
2004 // disappear, so Page::m_mainFrame can't be updated just yet. 2003 // disappear, so Page::m_mainFrame can't be updated just yet.
2005 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = RemoteBridgeFrameOwner::create(nu llptr, SandboxNone); 2004 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = RemoteBridgeFrameOwner::create(nu llptr, SandboxNone);
2006 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(m_frameLoaderClien tImpl.get(), oldFrame->host(), tempOwner.get()); 2005 m_frame = LocalFrame::create(m_frameLoaderClientImpl.get(), oldFrame->host() , tempOwner.get());
2007 frame->setOwner(oldFrame->owner()); 2006 m_frame->setOwner(oldFrame->owner());
2008 if (frame->owner() && !frame->owner()->isLocal()) 2007 if (m_frame->owner() && !m_frame->owner()->isLocal())
2009 toRemoteBridgeFrameOwner(frame->owner())->setSandboxFlags(static_cast<Sa ndboxFlags>(flags)); 2008 toRemoteBridgeFrameOwner(m_frame->owner())->setSandboxFlags(static_cast< SandboxFlags>(flags));
2010 frame->tree().setName(name); 2009 m_frame->tree().setName(name);
2011 setParent(oldWebFrame->parent()); 2010 setParent(oldWebFrame->parent());
2012 setOpener(oldWebFrame->opener()); 2011 setOpener(oldWebFrame->opener());
2013 setCoreFrame(frame);
2014 // We must call init() after m_frame is assigned because it is referenced 2012 // We must call init() after m_frame is assigned because it is referenced
2015 // during init(). Note that this may dispatch JS events; the frame may be 2013 // during init(). Note that this may dispatch JS events; the frame may be
2016 // detached after init() returns. 2014 // detached after init() returns.
2017 frame->init(); 2015 m_frame->init();
2018 } 2016 }
2019 2017
2020 void WebLocalFrameImpl::setAutofillClient(WebAutofillClient* autofillClient) 2018 void WebLocalFrameImpl::setAutofillClient(WebAutofillClient* autofillClient)
2021 { 2019 {
2022 m_autofillClient = autofillClient; 2020 m_autofillClient = autofillClient;
2023 } 2021 }
2024 2022
2025 WebAutofillClient* WebLocalFrameImpl::autofillClient() 2023 WebAutofillClient* WebLocalFrameImpl::autofillClient()
2026 { 2024 {
2027 return m_autofillClient; 2025 return m_autofillClient;
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
2198 } 2196 }
2199 2197
2200 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const 2198 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const
2201 { 2199 {
2202 if (!frame()) 2200 if (!frame())
2203 return WebSandboxFlags::None; 2201 return WebSandboxFlags::None;
2204 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2202 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2205 } 2203 }
2206 2204
2207 } // namespace blink 2205 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698