OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
9 * Copyright (C) 2013 Google Inc. All rights reserved. | 9 * Copyright (C) 2013 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 namespace WebCore { | 34 namespace WebCore { |
35 | 35 |
36 bool DocumentInit::shouldSetURL() const | 36 bool DocumentInit::shouldSetURL() const |
37 { | 37 { |
38 return (m_frame && m_frame->ownerElement()) || !m_url.isEmpty(); | 38 return (m_frame && m_frame->ownerElement()) || !m_url.isEmpty(); |
39 } | 39 } |
40 | 40 |
41 bool DocumentInit::shouldTreatURLAsSrcdocDocument() const | 41 bool DocumentInit::shouldTreatURLAsSrcdocDocument() const |
42 { | 42 { |
| 43 ASSERT(m_frame); |
43 return m_frame->loader()->shouldTreatURLAsSrcdocDocument(m_url); | 44 return m_frame->loader()->shouldTreatURLAsSrcdocDocument(m_url); |
44 } | 45 } |
45 | 46 |
| 47 Frame* DocumentInit::frameForSecurityContext() const |
| 48 { |
| 49 if (m_frame) |
| 50 return m_frame; |
| 51 if (m_import) |
| 52 return m_import->frame(); |
| 53 return 0; |
| 54 } |
| 55 |
46 SandboxFlags DocumentInit::sandboxFlags() const | 56 SandboxFlags DocumentInit::sandboxFlags() const |
47 { | 57 { |
48 return m_frame->loader()->effectiveSandboxFlags(); | 58 ASSERT(frameForSecurityContext()); |
| 59 return frameForSecurityContext()->loader()->effectiveSandboxFlags(); |
49 } | 60 } |
50 | 61 |
51 Settings* DocumentInit::settings() const | 62 Settings* DocumentInit::settings() const |
52 { | 63 { |
53 return m_frame->settings(); | 64 ASSERT(frameForSecurityContext()); |
| 65 return frameForSecurityContext()->settings(); |
54 } | 66 } |
55 | 67 |
56 Frame* DocumentInit::ownerFrame() const | 68 Frame* DocumentInit::ownerFrame() const |
57 { | 69 { |
| 70 if (!m_frame) |
| 71 return 0; |
| 72 |
58 Frame* ownerFrame = m_frame->tree()->parent(); | 73 Frame* ownerFrame = m_frame->tree()->parent(); |
59 if (!ownerFrame) | 74 if (!ownerFrame) |
60 ownerFrame = m_frame->loader()->opener(); | 75 ownerFrame = m_frame->loader()->opener(); |
61 return ownerFrame; | 76 return ownerFrame; |
62 } | 77 } |
63 | 78 |
64 } // namespace WebCore | 79 } // namespace WebCore |
65 | 80 |
OLD | NEW |