OLD | NEW |
---|---|
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 Loading... | |
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 ASSERT(m_frame); | |
alexmos
2015/09/03 16:43:38
This is the ASSERT.
dcheng
2015/09/03 16:51:43
(Add a TODO to add this assert back once we don't
alexmos
2015/09/03 16:55:42
Done.
| |
751 if (m_frame && m_frame->document()) | 750 if (m_frame && m_frame->document()) |
752 m_frame->document()->initSecurityContext(); | 751 m_frame->document()->initSecurityContext(); |
753 } | 752 } |
754 | 753 |
755 WebDocument WebLocalFrameImpl::document() const | 754 WebDocument WebLocalFrameImpl::document() const |
756 { | 755 { |
757 if (!frame() || !frame()->document()) | 756 if (!frame() || !frame()->document()) |
758 return WebDocument(); | 757 return WebDocument(); |
759 return WebDocument(frame()->document()); | 758 return WebDocument(frame()->document()); |
760 } | 759 } |
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1995 } | 1994 } |
1996 | 1995 |
1997 void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFra me, const WebString& name, WebSandboxFlags flags) | 1996 void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFra me, const WebString& name, WebSandboxFlags flags) |
1998 { | 1997 { |
1999 Frame* oldFrame = toCoreFrame(oldWebFrame); | 1998 Frame* oldFrame = toCoreFrame(oldWebFrame); |
2000 // Note: this *always* temporarily sets a frame owner, even for main frames! | 1999 // Note: this *always* temporarily sets a frame owner, even for main frames! |
2001 // When a core Frame is created with no owner, it attempts to set itself as | 2000 // When a core Frame is created with no owner, it attempts to set itself as |
2002 // the main frame of the Page. However, this is a provisional frame, and may | 2001 // the main frame of the Page. However, this is a provisional frame, and may |
2003 // disappear, so Page::m_mainFrame can't be updated just yet. | 2002 // disappear, so Page::m_mainFrame can't be updated just yet. |
2004 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = RemoteBridgeFrameOwner::create(nu llptr, SandboxNone); | 2003 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = RemoteBridgeFrameOwner::create(nu llptr, SandboxNone); |
2005 m_frame = LocalFrame::create(m_frameLoaderClientImpl.get(), oldFrame->host() , tempOwner.get()); | 2004 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(m_frameLoaderClien tImpl.get(), oldFrame->host(), tempOwner.get()); |
2006 m_frame->setOwner(oldFrame->owner()); | 2005 frame->setOwner(oldFrame->owner()); |
2007 if (m_frame->owner() && !m_frame->owner()->isLocal()) | 2006 if (frame->owner() && !frame->owner()->isLocal()) |
2008 toRemoteBridgeFrameOwner(m_frame->owner())->setSandboxFlags(static_cast< SandboxFlags>(flags)); | 2007 toRemoteBridgeFrameOwner(frame->owner())->setSandboxFlags(static_cast<Sa ndboxFlags>(flags)); |
2009 m_frame->tree().setName(name); | 2008 frame->tree().setName(name); |
2010 setParent(oldWebFrame->parent()); | 2009 setParent(oldWebFrame->parent()); |
2011 setOpener(oldWebFrame->opener()); | 2010 setOpener(oldWebFrame->opener()); |
2011 setCoreFrame(frame); | |
alexmos
2015/09/03 16:33:55
I wanted to do this after setting up the tree rela
dcheng
2015/09/03 16:42:09
Which assert is this that you're referring to? I d
alexmos
2015/09/03 16:43:38
The one I removed above in WebLocalFrameImpl::setO
dcheng
2015/09/03 16:51:22
Err, oops. I think it's a /little/ weird to remove
| |
2012 // 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 |
2013 // 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 |
2014 // detached after init() returns. | 2014 // detached after init() returns. |
2015 m_frame->init(); | 2015 frame->init(); |
2016 } | 2016 } |
2017 | 2017 |
2018 void WebLocalFrameImpl::setAutofillClient(WebAutofillClient* autofillClient) | 2018 void WebLocalFrameImpl::setAutofillClient(WebAutofillClient* autofillClient) |
2019 { | 2019 { |
2020 m_autofillClient = autofillClient; | 2020 m_autofillClient = autofillClient; |
2021 } | 2021 } |
2022 | 2022 |
2023 WebAutofillClient* WebLocalFrameImpl::autofillClient() | 2023 WebAutofillClient* WebLocalFrameImpl::autofillClient() |
2024 { | 2024 { |
2025 return m_autofillClient; | 2025 return m_autofillClient; |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2196 } | 2196 } |
2197 | 2197 |
2198 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const | 2198 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const |
2199 { | 2199 { |
2200 if (!frame()) | 2200 if (!frame()) |
2201 return WebSandboxFlags::None; | 2201 return WebSandboxFlags::None; |
2202 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); | 2202 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); |
2203 } | 2203 } |
2204 | 2204 |
2205 } // namespace blink | 2205 } // namespace blink |
OLD | NEW |