Chromium Code Reviews| Index: Source/core/dom/DocumentInit.cpp |
| diff --git a/Source/core/dom/DocumentInit.cpp b/Source/core/dom/DocumentInit.cpp |
| index adf48c24b6932eab4b95cb7beeda5751a70223a3..6e6c584c90a3930b7758b6e627d8a2c7a7dc714e 100644 |
| --- a/Source/core/dom/DocumentInit.cpp |
| +++ b/Source/core/dom/DocumentInit.cpp |
| @@ -33,24 +33,30 @@ |
| namespace WebCore { |
| +bool DocumentInit::hasSecurityContextSource() const |
| +{ |
| + return contextSourceFrame(); |
| +} |
| + |
| bool DocumentInit::shouldSetURL() const |
| { |
| - return (m_frame && m_frame->ownerElement()) || !m_url.isEmpty(); |
| + Frame* frame = contextSourceFrame(); |
| + return (frame && frame->ownerElement()) || !m_url.isEmpty(); |
| } |
| bool DocumentInit::shouldTreatURLAsSrcdocDocument() const |
| { |
| - return m_frame->loader()->shouldTreatURLAsSrcdocDocument(m_url); |
| + return contextSourceFrame()->loader()->shouldTreatURLAsSrcdocDocument(m_url); |
| } |
| SandboxFlags DocumentInit::sandboxFlags() const |
| { |
| - return m_frame->loader()->effectiveSandboxFlags(); |
| + return contextSourceFrame()->loader()->effectiveSandboxFlags(); |
| } |
| Settings* DocumentInit::settings() const |
| { |
| - return m_frame->settings(); |
| + return contextSourceFrame()->settings(); |
| } |
| Frame* DocumentInit::ownerFrame() const |
| @@ -61,5 +67,14 @@ Frame* DocumentInit::ownerFrame() const |
| return ownerFrame; |
| } |
| +inline Frame* DocumentInit::contextSourceFrame() const |
|
abarth-chromium
2013/07/19 07:55:55
Why not just sourceFrame() or just frame() ? I do
|
| +{ |
| + if (m_frame) |
| + return m_frame; |
| + if (m_import) |
| + return m_import->frame(); |
| + return 0; |
| +} |
| + |
| } // namespace WebCore |