Title: [219703] trunk/Source
- Revision
- 219703
- Author
- [email protected]
- Date
- 2017-07-20 14:08:16 -0700 (Thu, 20 Jul 2017)
Log Message
Regression(ITP): May get frequently logged out of wsj.com
https://bugs.webkit.org/show_bug.cgi?id=174661
<rdar://problem/32343256>
Reviewed by Geoffrey Garen.
Source/WebCore:
Add the concept of associated domains in the ResourceLoadObserver. We
previously ignore loads to and from the same domains. We now do the same
if the to and from domains are associated (i.e. owned by the same entity).
For now, only add domains owned by Dow Jones & Company, Inc. to the list,
to address login issues on wsj.com.
No new tests, verified manually on wsj.com.
* loader/ResourceLoadObserver.cpp:
(WebCore::areDomainsAssociated):
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
Source/WebKit:
Bump statistics file version to blow away old statistics on disk since those do not
take into account associated domains.
* UIProcess/WebResourceLoadStatisticsStore.cpp:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (219702 => 219703)
--- trunk/Source/WebCore/ChangeLog 2017-07-20 21:06:12 UTC (rev 219702)
+++ trunk/Source/WebCore/ChangeLog 2017-07-20 21:08:16 UTC (rev 219703)
@@ -1,5 +1,28 @@
2017-07-20 Chris Dumez <[email protected]>
+ Regression(ITP): May get frequently logged out of wsj.com
+ https://bugs.webkit.org/show_bug.cgi?id=174661
+ <rdar://problem/32343256>
+
+ Reviewed by Geoffrey Garen.
+
+ Add the concept of associated domains in the ResourceLoadObserver. We
+ previously ignore loads to and from the same domains. We now do the same
+ if the to and from domains are associated (i.e. owned by the same entity).
+
+ For now, only add domains owned by Dow Jones & Company, Inc. to the list,
+ to address login issues on wsj.com.
+
+ No new tests, verified manually on wsj.com.
+
+ * loader/ResourceLoadObserver.cpp:
+ (WebCore::areDomainsAssociated):
+ (WebCore::ResourceLoadObserver::logFrameNavigation):
+ (WebCore::ResourceLoadObserver::logSubresourceLoading):
+ (WebCore::ResourceLoadObserver::logWebSocketLoading):
+
+2017-07-20 Chris Dumez <[email protected]>
+
Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable
https://bugs.webkit.org/show_bug.cgi?id=174660
Modified: trunk/Source/WebCore/loader/ResourceLoadObserver.cpp (219702 => 219703)
--- trunk/Source/WebCore/loader/ResourceLoadObserver.cpp 2017-07-20 21:06:12 UTC (rev 219702)
+++ trunk/Source/WebCore/loader/ResourceLoadObserver.cpp 2017-07-20 21:08:16 UTC (rev 219703)
@@ -54,6 +54,35 @@
return resourceLoadObserver;
}
+// FIXME: Temporary fix for <rdar://problem/32343256> until content can be updated.
+static bool areDomainsAssociated(const String& firstDomain, const String& secondDomain)
+{
+ static NeverDestroyed<HashMap<String, unsigned>> metaDomainIdentifiers = [] {
+ HashMap<String, unsigned> map;
+
+ // Domains owned by Dow Jones & Company, Inc.
+ const unsigned dowJonesIdentifier = 1;
+ map.add(ASCIILiteral("dowjones.com"), dowJonesIdentifier);
+ map.add(ASCIILiteral("wsj.com"), dowJonesIdentifier);
+ map.add(ASCIILiteral("barrons.com"), dowJonesIdentifier);
+ map.add(ASCIILiteral("marketwatch.com"), dowJonesIdentifier);
+ map.add(ASCIILiteral("wsjplus.com"), dowJonesIdentifier);
+
+ return map;
+ }();
+
+ if (firstDomain == secondDomain)
+ return true;
+
+ ASSERT(!equalIgnoringASCIICase(firstDomain, secondDomain));
+
+ unsigned firstMetaDomainIdentifier = metaDomainIdentifiers.get().get(firstDomain);
+ if (!firstMetaDomainIdentifier)
+ return false;
+
+ return firstMetaDomainIdentifier == metaDomainIdentifiers.get().get(secondDomain);
+}
+
void ResourceLoadObserver::setShouldThrottleObserverNotifications(bool shouldThrottle)
{
m_shouldThrottleNotifications = shouldThrottle;
@@ -126,7 +155,7 @@
auto mainFramePrimaryDomain = primaryDomain(mainFrameURL);
auto sourcePrimaryDomain = primaryDomain(sourceURL);
- if (targetPrimaryDomain == mainFramePrimaryDomain || targetPrimaryDomain == sourcePrimaryDomain)
+ if (areDomainsAssociated(targetPrimaryDomain, mainFramePrimaryDomain) || areDomainsAssociated(targetPrimaryDomain, sourcePrimaryDomain))
return;
auto& targetStatistics = ensureResourceStatisticsForPrimaryDomain(targetPrimaryDomain);
@@ -167,7 +196,7 @@
auto mainFramePrimaryDomain = primaryDomain(mainFrameURL);
auto sourcePrimaryDomain = primaryDomain(sourceURL);
- if (targetPrimaryDomain == mainFramePrimaryDomain || (isRedirect && targetPrimaryDomain == sourcePrimaryDomain))
+ if (areDomainsAssociated(targetPrimaryDomain, mainFramePrimaryDomain) || (isRedirect && areDomainsAssociated(targetPrimaryDomain, sourcePrimaryDomain)))
return;
if (resourceNeedsSSOQuirk(targetURL))
@@ -212,7 +241,7 @@
auto targetPrimaryDomain = primaryDomain(targetURL);
auto mainFramePrimaryDomain = primaryDomain(mainFrameURL);
- if (targetPrimaryDomain == mainFramePrimaryDomain)
+ if (areDomainsAssociated(targetPrimaryDomain, mainFramePrimaryDomain))
return;
auto& targetStatistics = ensureResourceStatisticsForPrimaryDomain(targetPrimaryDomain);
Modified: trunk/Source/WebKit/ChangeLog (219702 => 219703)
--- trunk/Source/WebKit/ChangeLog 2017-07-20 21:06:12 UTC (rev 219702)
+++ trunk/Source/WebKit/ChangeLog 2017-07-20 21:08:16 UTC (rev 219703)
@@ -1,5 +1,18 @@
2017-07-20 Chris Dumez <[email protected]>
+ Regression(ITP): May get frequently logged out of wsj.com
+ https://bugs.webkit.org/show_bug.cgi?id=174661
+ <rdar://problem/32343256>
+
+ Reviewed by Geoffrey Garen.
+
+ Bump statistics file version to blow away old statistics on disk since those do not
+ take into account associated domains.
+
+ * UIProcess/WebResourceLoadStatisticsStore.cpp:
+
+2017-07-20 Chris Dumez <[email protected]>
+
Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable
https://bugs.webkit.org/show_bug.cgi?id=174660
Modified: trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp (219702 => 219703)
--- trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp 2017-07-20 21:06:12 UTC (rev 219702)
+++ trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp 2017-07-20 21:08:16 UTC (rev 219703)
@@ -46,7 +46,7 @@
namespace WebKit {
constexpr unsigned operatingDatesWindow { 30 };
-constexpr unsigned statisticsModelVersion { 8 };
+constexpr unsigned statisticsModelVersion { 9 };
constexpr unsigned maxImportance { 3 };
template<typename T> static inline String isolatedPrimaryDomain(const T& value)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes