Title: [231684] trunk/Source/WebKit
- Revision
- 231684
- Author
- [email protected]
- Date
- 2018-05-10 18:59:24 -0700 (Thu, 10 May 2018)
Log Message
Storage Access API: Extend lifetime of cookies on successful user approval
https://bugs.webkit.org/show_bug.cgi?id=185534
<rdar://problem/40064547>
Reviewed by Brent Fulgham.
* UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
(WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
Picks up the experimental feature flag.
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
Now updates the domain's user interaction timestamp if the user was
prompted for this access.
* UIProcess/WebResourceLoadStatisticsStore.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (231683 => 231684)
--- trunk/Source/WebKit/ChangeLog 2018-05-11 01:59:03 UTC (rev 231683)
+++ trunk/Source/WebKit/ChangeLog 2018-05-11 01:59:24 UTC (rev 231684)
@@ -1,3 +1,20 @@
+2018-05-10 John Wilander <[email protected]>
+
+ Storage Access API: Extend lifetime of cookies on successful user approval
+ https://bugs.webkit.org/show_bug.cgi?id=185534
+ <rdar://problem/40064547>
+
+ Reviewed by Brent Fulgham.
+
+ * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
+ (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
+ Picks up the experimental feature flag.
+ * UIProcess/WebResourceLoadStatisticsStore.cpp:
+ (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
+ Now updates the domain's user interaction timestamp if the user was
+ prompted for this access.
+ * UIProcess/WebResourceLoadStatisticsStore.h:
+
2018-05-10 Chris Dumez <[email protected]>
[iOS] Release page load process assertion if the screen is locked
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm (231683 => 231684)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm 2018-05-11 01:59:03 UTC (rev 231683)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm 2018-05-11 01:59:24 UTC (rev 231684)
@@ -51,6 +51,7 @@
setDebugLogggingEnabled([[NSUserDefaults standardUserDefaults] boolForKey:@"ResourceLoadStatisticsDebugLoggingEnabled"]);
setResourceLoadStatisticsDebugMode([[NSUserDefaults standardUserDefaults] boolForKey:@"ExperimentalResourceLoadStatisticsDebugMode"]);
+ setStorageAccessPromptsEnabled([[NSUserDefaults standardUserDefaults] boolForKey:@"ExperimentalStorageAccessPromptsEnabled"]);
});
}
Modified: trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp (231683 => 231684)
--- trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp 2018-05-11 01:59:03 UTC (rev 231683)
+++ trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp 2018-05-11 01:59:24 UTC (rev 231684)
@@ -456,7 +456,6 @@
void WebResourceLoadStatisticsStore::grantStorageAccessInternal(String&& subFramePrimaryDomain, String&& topFramePrimaryDomain, std::optional<uint64_t> frameID, uint64_t pageID, bool userWasPromptedNowOrEarlier, CompletionHandler<void(bool)>&& callback)
{
- UNUSED_PARAM(userWasPromptedNowOrEarlier);
ASSERT(!RunLoop::isMain());
if (subFramePrimaryDomain == topFramePrimaryDomain) {
@@ -464,6 +463,14 @@
return;
}
+ // FIXME: Remove m_storageAccessPromptsEnabled check if prompting is no longer experimental.
+ if (userWasPromptedNowOrEarlier && m_storageAccessPromptsEnabled) {
+ auto& subFrameStatistic = ensureResourceStatisticsForPrimaryDomain(subFramePrimaryDomain);
+ ASSERT(subFrameStatistic.hadUserInteraction);
+ ASSERT(subFrameStatistic.storageAccessUnderTopFrameOrigins.contains(topFramePrimaryDomain));
+ subFrameStatistic.mostRecentUserInteractionTime = WallTime::now();
+ }
+
m_grantStorageAccessHandler(subFramePrimaryDomain, topFramePrimaryDomain, frameID, pageID, WTFMove(callback));
}
Modified: trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h (231683 => 231684)
--- trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h 2018-05-11 01:59:03 UTC (rev 231683)
+++ trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h 2018-05-11 01:59:24 UTC (rev 231684)
@@ -191,6 +191,7 @@
void removeAllStorageAccess();
void setDebugLogggingEnabled(bool enabled) { m_debugLoggingEnabled = enabled; }
+ void setStorageAccessPromptsEnabled(bool enabled) { m_storageAccessPromptsEnabled = enabled; }
#if PLATFORM(COCOA)
void registerUserDefaultsIfNeeded();
@@ -239,6 +240,7 @@
bool m_debugModeEnabled { false };
bool m_debugLoggingEnabled { false };
+ bool m_storageAccessPromptsEnabled { false };
Function<void (const String&)> m_statisticsTestingCallback;
};
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes