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

Side by Side Diff: Source/core/dom/DocumentInit.cpp

Issue 19940002: [HTML Import] Respect Content Security Policy Model (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix mac build failure. Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
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 25 matching lines...) Expand all
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 return m_frame->loader()->shouldTreatURLAsSrcdocDocument(m_url); 43 return m_frame->loader()->shouldTreatURLAsSrcdocDocument(m_url);
44 } 44 }
45 45
46 Frame* DocumentInit::frameForSecurityContext() const
47 {
48 if (m_frame)
49 return m_frame;
50 if (m_import)
51 return m_import->frame();
52 return 0;
53 }
54
46 SandboxFlags DocumentInit::sandboxFlags() const 55 SandboxFlags DocumentInit::sandboxFlags() const
47 { 56 {
48 return m_frame->loader()->effectiveSandboxFlags(); 57 return frameForSecurityContext()->loader()->effectiveSandboxFlags();
Mike West 2013/07/22 14:39:42 It looks like this can now be null?
49 } 58 }
50 59
51 Settings* DocumentInit::settings() const 60 Settings* DocumentInit::settings() const
52 { 61 {
53 return m_frame->settings(); 62 return frameForSecurityContext()->settings();
Mike West 2013/07/22 14:39:42 Ditto.
54 } 63 }
55 64
56 Frame* DocumentInit::ownerFrame() const 65 Frame* DocumentInit::ownerFrame() const
57 { 66 {
67 if (!m_frame)
68 return 0;
69
58 Frame* ownerFrame = m_frame->tree()->parent(); 70 Frame* ownerFrame = m_frame->tree()->parent();
59 if (!ownerFrame) 71 if (!ownerFrame)
60 ownerFrame = m_frame->loader()->opener(); 72 ownerFrame = m_frame->loader()->opener();
61 return ownerFrame; 73 return ownerFrame;
62 } 74 }
63 75
64 } // namespace WebCore 76 } // namespace WebCore
65 77
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698