| 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); | 750 // TODO(alexmos,dcheng): This should ASSERT(m_frame) once we no longer have |
| 751 // provisional local frames. |
| 751 if (m_frame && m_frame->document()) | 752 if (m_frame && m_frame->document()) |
| 752 m_frame->document()->initSecurityContext(); | 753 m_frame->document()->initSecurityContext(); |
| 753 } | 754 } |
| 754 | 755 |
| 755 WebDocument WebLocalFrameImpl::document() const | 756 WebDocument WebLocalFrameImpl::document() const |
| 756 { | 757 { |
| 757 if (!frame() || !frame()->document()) | 758 if (!frame() || !frame()->document()) |
| 758 return WebDocument(); | 759 return WebDocument(); |
| 759 return WebDocument(frame()->document()); | 760 return WebDocument(frame()->document()); |
| 760 } | 761 } |
| (...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1995 } | 1996 } |
| 1996 | 1997 |
| 1997 void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFra
me, const WebString& name, WebSandboxFlags flags) | 1998 void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFra
me, const WebString& name, WebSandboxFlags flags) |
| 1998 { | 1999 { |
| 1999 Frame* oldFrame = toCoreFrame(oldWebFrame); | 2000 Frame* oldFrame = toCoreFrame(oldWebFrame); |
| 2000 // Note: this *always* temporarily sets a frame owner, even for main frames! | 2001 // 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 | 2002 // 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 | 2003 // 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. | 2004 // disappear, so Page::m_mainFrame can't be updated just yet. |
| 2004 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = RemoteBridgeFrameOwner::create(nu
llptr, SandboxNone); | 2005 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = RemoteBridgeFrameOwner::create(nu
llptr, SandboxNone); |
| 2005 m_frame = LocalFrame::create(m_frameLoaderClientImpl.get(), oldFrame->host()
, tempOwner.get()); | 2006 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(m_frameLoaderClien
tImpl.get(), oldFrame->host(), tempOwner.get()); |
| 2006 m_frame->setOwner(oldFrame->owner()); | 2007 frame->setOwner(oldFrame->owner()); |
| 2007 if (m_frame->owner() && !m_frame->owner()->isLocal()) | 2008 if (frame->owner() && !frame->owner()->isLocal()) |
| 2008 toRemoteBridgeFrameOwner(m_frame->owner())->setSandboxFlags(static_cast<
SandboxFlags>(flags)); | 2009 toRemoteBridgeFrameOwner(frame->owner())->setSandboxFlags(static_cast<Sa
ndboxFlags>(flags)); |
| 2009 m_frame->tree().setName(name); | 2010 frame->tree().setName(name); |
| 2010 setParent(oldWebFrame->parent()); | 2011 setParent(oldWebFrame->parent()); |
| 2011 setOpener(oldWebFrame->opener()); | 2012 setOpener(oldWebFrame->opener()); |
| 2013 setCoreFrame(frame); |
| 2012 // We must call init() after m_frame is assigned because it is referenced | 2014 // 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 | 2015 // during init(). Note that this may dispatch JS events; the frame may be |
| 2014 // detached after init() returns. | 2016 // detached after init() returns. |
| 2015 m_frame->init(); | 2017 frame->init(); |
| 2016 } | 2018 } |
| 2017 | 2019 |
| 2018 void WebLocalFrameImpl::setAutofillClient(WebAutofillClient* autofillClient) | 2020 void WebLocalFrameImpl::setAutofillClient(WebAutofillClient* autofillClient) |
| 2019 { | 2021 { |
| 2020 m_autofillClient = autofillClient; | 2022 m_autofillClient = autofillClient; |
| 2021 } | 2023 } |
| 2022 | 2024 |
| 2023 WebAutofillClient* WebLocalFrameImpl::autofillClient() | 2025 WebAutofillClient* WebLocalFrameImpl::autofillClient() |
| 2024 { | 2026 { |
| 2025 return m_autofillClient; | 2027 return m_autofillClient; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2196 } | 2198 } |
| 2197 | 2199 |
| 2198 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const | 2200 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const |
| 2199 { | 2201 { |
| 2200 if (!frame()) | 2202 if (!frame()) |
| 2201 return WebSandboxFlags::None; | 2203 return WebSandboxFlags::None; |
| 2202 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); | 2204 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); |
| 2203 } | 2205 } |
| 2204 | 2206 |
| 2205 } // namespace blink | 2207 } // namespace blink |
| OLD | NEW |