Title: [208507] trunk/Source/WebCore
- Revision
- 208507
- Author
- achristen...@apple.com
- Date
- 2016-11-09 16:18:54 -0800 (Wed, 09 Nov 2016)
Log Message
Simplify logic of SecurityOrigin::databaseIdentifier
https://bugs.webkit.org/show_bug.cgi?id=164565
Reviewed by Brady Eidson.
No change in behavior.
SecurityOrigins with the file scheme need a special database identifier to be backwards-compatible with existing storage.
Instead of determining whether this is a file SecurityOrigin at parsing time and only using that information when
making the database identifier, just determine whether we need this quirk when making the database identifier.
I'm planning to move this logic to SecurityOriginData in another patch.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::create):
(WebCore::SecurityOrigin::databaseIdentifier):
* page/SecurityOrigin.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (208506 => 208507)
--- trunk/Source/WebCore/ChangeLog 2016-11-10 00:11:30 UTC (rev 208506)
+++ trunk/Source/WebCore/ChangeLog 2016-11-10 00:18:54 UTC (rev 208507)
@@ -1,3 +1,23 @@
+2016-11-09 Alex Christensen <achristen...@webkit.org>
+
+ Simplify logic of SecurityOrigin::databaseIdentifier
+ https://bugs.webkit.org/show_bug.cgi?id=164565
+
+ Reviewed by Brady Eidson.
+
+ No change in behavior.
+
+ SecurityOrigins with the file scheme need a special database identifier to be backwards-compatible with existing storage.
+ Instead of determining whether this is a file SecurityOrigin at parsing time and only using that information when
+ making the database identifier, just determine whether we need this quirk when making the database identifier.
+ I'm planning to move this logic to SecurityOriginData in another patch.
+
+ * page/SecurityOrigin.cpp:
+ (WebCore::SecurityOrigin::SecurityOrigin):
+ (WebCore::SecurityOrigin::create):
+ (WebCore::SecurityOrigin::databaseIdentifier):
+ * page/SecurityOrigin.h:
+
2016-11-09 Jaehun Lim <ljaehun....@samsung.com>
Unreviewed, build fix after r208460
Modified: trunk/Source/WebCore/page/SecurityOrigin.cpp (208506 => 208507)
--- trunk/Source/WebCore/page/SecurityOrigin.cpp 2016-11-10 00:11:30 UTC (rev 208506)
+++ trunk/Source/WebCore/page/SecurityOrigin.cpp 2016-11-10 00:18:54 UTC (rev 208507)
@@ -110,7 +110,6 @@
, m_domainWasSetInDOM(false)
, m_storageBlockingPolicy(AllowAllStorage)
, m_enforceFilePathSeparation(false)
- , m_needsDatabaseIdentifierQuirkForFiles(false)
{
// document.domain starts as m_host, but can be set by the DOM.
m_domain = m_host;
@@ -135,7 +134,6 @@
, m_canLoadLocalResources(false)
, m_storageBlockingPolicy(AllowAllStorage)
, m_enforceFilePathSeparation(false)
- , m_needsDatabaseIdentifierQuirkForFiles(false)
{
}
@@ -151,7 +149,6 @@
, m_canLoadLocalResources(other->m_canLoadLocalResources)
, m_storageBlockingPolicy(other->m_storageBlockingPolicy)
, m_enforceFilePathSeparation(other->m_enforceFilePathSeparation)
- , m_needsDatabaseIdentifierQuirkForFiles(other->m_needsDatabaseIdentifierQuirkForFiles)
{
}
@@ -160,20 +157,9 @@
if (RefPtr<SecurityOrigin> cachedOrigin = getCachedOrigin(url))
return cachedOrigin.releaseNonNull();
- if (shouldTreatAsUniqueOrigin(url)) {
- Ref<SecurityOrigin> origin(adoptRef(*new SecurityOrigin));
+ if (shouldTreatAsUniqueOrigin(url))
+ return adoptRef(*new SecurityOrigin);
- if (url.protocolIs("file")) {
- // Unfortunately, we can't represent all unique origins exactly
- // the same way because we need to produce a quirky database
- // identifier for file URLs due to persistent storage in some
- // embedders of WebKit.
- origin->m_needsDatabaseIdentifierQuirkForFiles = true;
- }
-
- return origin;
- }
-
if (shouldUseInnerURL(url))
return adoptRef(*new SecurityOrigin(extractInnerURL(url)));
@@ -564,7 +550,7 @@
// string because of a bug in how we handled the scheme for file URLs.
// Now that we've fixed that bug, we still need to produce this string
// to avoid breaking existing persistent state.
- if (m_needsDatabaseIdentifierQuirkForFiles)
+ if (equalIgnoringASCIICase(m_protocol, "file"))
return ASCIILiteral("file__0");
StringBuilder stringBuilder;
Modified: trunk/Source/WebCore/page/SecurityOrigin.h (208506 => 208507)
--- trunk/Source/WebCore/page/SecurityOrigin.h 2016-11-10 00:11:30 UTC (rev 208506)
+++ trunk/Source/WebCore/page/SecurityOrigin.h 2016-11-10 00:18:54 UTC (rev 208507)
@@ -232,7 +232,6 @@
bool m_canLoadLocalResources;
StorageBlockingPolicy m_storageBlockingPolicy;
bool m_enforceFilePathSeparation;
- bool m_needsDatabaseIdentifierQuirkForFiles;
};
// Returns true if the Origin header values serialized from these two origins would be the same.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes