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, 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 3961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3972 // FIXME: If this document came from the file system, the HTML5 | 3972 // FIXME: If this document came from the file system, the HTML5 |
3973 // specificiation tells us to read the last modification date from the file | 3973 // specificiation tells us to read the last modification date from the file |
3974 // system. | 3974 // system. |
3975 if (!foundDate) | 3975 if (!foundDate) |
3976 date.setMillisecondsSinceEpochForDateTime(convertToLocalTime(currentTime
MS())); | 3976 date.setMillisecondsSinceEpochForDateTime(convertToLocalTime(currentTime
MS())); |
3977 return String::format("%02d/%02d/%04d %02d:%02d:%02d", date.month() + 1, dat
e.monthDay(), date.fullYear(), date.hour(), date.minute(), date.second()); | 3977 return String::format("%02d/%02d/%04d %02d:%02d:%02d", date.month() + 1, dat
e.monthDay(), date.fullYear(), date.hour(), date.minute(), date.second()); |
3978 } | 3978 } |
3979 | 3979 |
3980 const KURL& Document::firstPartyForCookies() const | 3980 const KURL& Document::firstPartyForCookies() const |
3981 { | 3981 { |
3982 if (!RuntimeEnabledFeatures::firstPartyIncludesAncestorsEnabled()) | |
3983 return topDocument().url(); | |
3984 | |
3985 // We're intentionally using the URL of each document rather than the docume
nt's SecurityOrigin. | |
3986 // Sandboxing a document into a unique origin shouldn't effect first-/third-
party status for | |
3987 // cookies and site data. | |
3988 RefPtr<SecurityOrigin> topOrigin = SecurityOrigin::create(topDocument().url(
)); | |
3989 const Document* currentDocument = this; | |
3990 while (currentDocument) { | |
3991 // Skip over srcdoc documents, as they are always same-origin with their
closest non-srcdoc parent. | |
3992 while (currentDocument->isSrcdocDocument()) | |
3993 currentDocument = currentDocument->parentDocument(); | |
3994 ASSERT(currentDocument); | |
3995 | |
3996 if (!topOrigin->canRequest(currentDocument->url())) | |
3997 return SecurityOrigin::urlWithUniqueSecurityOrigin(); | |
3998 | |
3999 currentDocument = currentDocument->parentDocument(); | |
4000 } | |
4001 | |
4002 return topDocument().url(); | 3982 return topDocument().url(); |
4003 } | 3983 } |
4004 | 3984 |
4005 static bool isValidNameNonASCII(const LChar* characters, unsigned length) | 3985 static bool isValidNameNonASCII(const LChar* characters, unsigned length) |
4006 { | 3986 { |
4007 if (!isValidNameStart(characters[0])) | 3987 if (!isValidNameStart(characters[0])) |
4008 return false; | 3988 return false; |
4009 | 3989 |
4010 for (unsigned i = 1; i < length; ++i) { | 3990 for (unsigned i = 1; i < length; ++i) { |
4011 if (!isValidNamePart(characters[i])) | 3991 if (!isValidNamePart(characters[i])) |
(...skipping 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5720 #ifndef NDEBUG | 5700 #ifndef NDEBUG |
5721 using namespace blink; | 5701 using namespace blink; |
5722 void showLiveDocumentInstances() | 5702 void showLiveDocumentInstances() |
5723 { | 5703 { |
5724 WeakDocumentSet& set = liveDocumentSet(); | 5704 WeakDocumentSet& set = liveDocumentSet(); |
5725 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5705 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5726 for (Document* document : set) | 5706 for (Document* document : set) |
5727 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5707 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
5728 } | 5708 } |
5729 #endif | 5709 #endif |
OLD | NEW |