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

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

Issue 26444008: Remove several Page.h includes in preparation for removing page/ dependencies from the rest of core (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Now 100% more buildable on debug Created 7 years, 2 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
« no previous file with comments | « Source/core/css/resolver/StyleAdjuster.cpp ('k') | Source/core/dom/FullscreenElementStack.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 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) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 3664 matching lines...) Expand 10 before | Expand all | Expand 10 after
3675 3675
3676 HTMLFrameOwnerElement* Document::ownerElement() const 3676 HTMLFrameOwnerElement* Document::ownerElement() const
3677 { 3677 {
3678 if (!frame()) 3678 if (!frame())
3679 return 0; 3679 return 0;
3680 return frame()->ownerElement(); 3680 return frame()->ownerElement();
3681 } 3681 }
3682 3682
3683 String Document::cookie(ExceptionState& es) const 3683 String Document::cookie(ExceptionState& es) const
3684 { 3684 {
3685 if (page() && !page()->settings().cookieEnabled()) 3685 if (settings() && !settings()->cookieEnabled())
3686 return String(); 3686 return String();
3687 3687
3688 // FIXME: The HTML5 DOM spec states that this attribute can raise an 3688 // FIXME: The HTML5 DOM spec states that this attribute can raise an
3689 // InvalidStateError exception on getting if the Document has no 3689 // InvalidStateError exception on getting if the Document has no
3690 // browsing context. 3690 // browsing context.
3691 3691
3692 if (!securityOrigin()->canAccessCookies()) { 3692 if (!securityOrigin()->canAccessCookies()) {
3693 String accessDeniedMessage = "Access to 'cookie' is denied for this docu ment."; 3693 String accessDeniedMessage = "Access to 'cookie' is denied for this docu ment.";
3694 if (isSandboxed(SandboxOrigin)) 3694 if (isSandboxed(SandboxOrigin))
3695 es.throwSecurityError(accessDeniedMessage + " The document is sandbo xed and lacks the 'allow-same-origin' flag."); 3695 es.throwSecurityError(accessDeniedMessage + " The document is sandbo xed and lacks the 'allow-same-origin' flag.");
3696 else if (url().protocolIs("data")) 3696 else if (url().protocolIs("data"))
3697 es.throwSecurityError(accessDeniedMessage + " Cookies are disabled i nside 'data:' URLs."); 3697 es.throwSecurityError(accessDeniedMessage + " Cookies are disabled i nside 'data:' URLs.");
3698 else 3698 else
3699 es.throwSecurityError(accessDeniedMessage); 3699 es.throwSecurityError(accessDeniedMessage);
3700 return String(); 3700 return String();
3701 } 3701 }
3702 3702
3703 KURL cookieURL = this->cookieURL(); 3703 KURL cookieURL = this->cookieURL();
3704 if (cookieURL.isEmpty()) 3704 if (cookieURL.isEmpty())
3705 return String(); 3705 return String();
3706 3706
3707 return cookies(this, cookieURL); 3707 return cookies(this, cookieURL);
3708 } 3708 }
3709 3709
3710 void Document::setCookie(const String& value, ExceptionState& es) 3710 void Document::setCookie(const String& value, ExceptionState& es)
3711 { 3711 {
3712 if (page() && !page()->settings().cookieEnabled()) 3712 if (settings() && !settings()->cookieEnabled())
3713 return; 3713 return;
3714 3714
3715 // FIXME: The HTML5 DOM spec states that this attribute can raise an 3715 // FIXME: The HTML5 DOM spec states that this attribute can raise an
3716 // InvalidStateError exception on setting if the Document has no 3716 // InvalidStateError exception on setting if the Document has no
3717 // browsing context. 3717 // browsing context.
3718 3718
3719 if (!securityOrigin()->canAccessCookies()) { 3719 if (!securityOrigin()->canAccessCookies()) {
3720 String accessDeniedMessage = "Access to 'cookie' is denied for this docu ment."; 3720 String accessDeniedMessage = "Access to 'cookie' is denied for this docu ment.";
3721 if (isSandboxed(SandboxOrigin)) 3721 if (isSandboxed(SandboxOrigin))
3722 es.throwSecurityError(accessDeniedMessage + " The document is sandbo xed and lacks the 'allow-same-origin' flag."); 3722 es.throwSecurityError(accessDeniedMessage + " The document is sandbo xed and lacks the 'allow-same-origin' flag.");
(...skipping 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after
5301 { 5301 {
5302 return DocumentLifecycleNotifier::create(this); 5302 return DocumentLifecycleNotifier::create(this);
5303 } 5303 }
5304 5304
5305 DocumentLifecycleNotifier* Document::lifecycleNotifier() 5305 DocumentLifecycleNotifier* Document::lifecycleNotifier()
5306 { 5306 {
5307 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); 5307 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier());
5308 } 5308 }
5309 5309
5310 } // namespace WebCore 5310 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleAdjuster.cpp ('k') | Source/core/dom/FullscreenElementStack.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698