Title: [272229] trunk/Source/WebKit
Revision
272229
Author
[email protected]
Date
2021-02-02 13:15:50 -0800 (Tue, 02 Feb 2021)

Log Message

REGRESSION(r271744): Broke Microsoft live login in internal builds
https://bugs.webkit.org/show_bug.cgi?id=221271
<rdar://problem/73848416>

Reviewed by Alex Christensen.

If a user goes straight to login.live.com without first visiting
microsoft.com, we crash when checking for storage access because
we assume the user has interacted with the page. Since this is a
quirked flow, we should not assume that, and should insert the
domain into the database.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt):
(WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt const): Deleted.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (272228 => 272229)


--- trunk/Source/WebKit/ChangeLog	2021-02-02 20:57:05 UTC (rev 272228)
+++ trunk/Source/WebKit/ChangeLog	2021-02-02 21:15:50 UTC (rev 272229)
@@ -1,3 +1,22 @@
+2021-02-02  Kate Cheney  <[email protected]>
+
+        REGRESSION(r271744): Broke Microsoft live login in internal builds
+        https://bugs.webkit.org/show_bug.cgi?id=221271
+        <rdar://problem/73848416>
+
+        Reviewed by Alex Christensen.
+
+        If a user goes straight to login.live.com without first visiting
+        microsoft.com, we crash when checking for storage access because
+        we assume the user has interacted with the page. Since this is a
+        quirked flow, we should not assume that, and should insert the
+        domain into the database.
+
+        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
+        (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt):
+        (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt const): Deleted.
+        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
+
 2021-02-02  Alex Christensen  <[email protected]>
 
         Adopt UIEventAttribution instead of _UIEventAttribution

Modified: trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp (272228 => 272229)


--- trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp	2021-02-02 20:57:05 UTC (rev 272228)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp	2021-02-02 21:15:50 UTC (rev 272229)
@@ -2118,12 +2118,18 @@
     return CookieAccess::OnlyIfGranted;
 }
 
-StorageAccessPromptWasShown ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt(unsigned requestingDomainID, const RegistrableDomain& firstPartyDomain) const
+StorageAccessPromptWasShown ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt(unsigned requestingDomainID, const RegistrableDomain& firstPartyDomain)
 {
     ASSERT(!RunLoop::isMain());
 
-    auto firstPartyPrimaryDomainID = domainID(firstPartyDomain).value();
+    auto result = ensureResourceStatisticsForRegistrableDomain(firstPartyDomain);
+    if (!result.second) {
+        RELEASE_LOG_ERROR_IF_ALLOWED(m_sessionID, "%p - ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt was not completed due to failed insert attempt", this);
+        return StorageAccessPromptWasShown::No;
+    }
 
+    auto firstPartyPrimaryDomainID = *result.second;
+
     SQLiteStatement statement(m_database, "SELECT COUNT(*) FROM StorageAccessUnderTopFrameDomains WHERE domainID = ? AND topLevelDomainID = ?");
     if (statement.prepare() != SQLITE_OK
         || statement.bindInt(1, requestingDomainID) != SQLITE_OK

Modified: trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h (272228 => 272229)


--- trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h	2021-02-02 20:57:05 UTC (rev 272228)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h	2021-02-02 21:15:50 UTC (rev 272229)
@@ -193,7 +193,7 @@
     Vector<DomainData> domains() const;
     bool hasHadUnexpiredRecentUserInteraction(const DomainData&, OperatingDatesWindow);
     void clearGrandfathering(Vector<unsigned>&&);
-    WebCore::StorageAccessPromptWasShown hasUserGrantedStorageAccessThroughPrompt(unsigned domainID, const RegistrableDomain&) const;
+    WebCore::StorageAccessPromptWasShown hasUserGrantedStorageAccessThroughPrompt(unsigned domainID, const RegistrableDomain&);
     void incrementRecordsDeletedCountForDomains(HashSet<RegistrableDomain>&&) override;
 
     void reclassifyResources();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to