WebKit Bugzilla
Attachment 340154 Details for
Bug 185534
: Storage Access API: Extend lifetime of cookies on successful user approval
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-185534-20180510182141.patch (text/plain), 4.50 KB, created by
John Wilander
on 2018-05-10 18:21:41 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
John Wilander
Created:
2018-05-10 18:21:41 PDT
Size:
4.50 KB
patch
obsolete
>Subversion Revision: 231679 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index d6c02bd7ff7910819f2af26faeb612e21feed2a0..8adf65be887d46b2182087b4604c53e9a6cac6cb 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,20 @@ >+2018-05-10 John Wilander <wilander@apple.com> >+ >+ 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 <cdumez@apple.com> > > [iOS] Release page load process assertion if the screen is locked >diff --git a/Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm >index 5075fc853a2fc3c6ea2a34fe6544ea86ceeccc91..fe312c775487955680353cc3ba6cf807b50ea618 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm >+++ b/Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm >@@ -51,6 +51,7 @@ void WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded() > > setDebugLogggingEnabled([[NSUserDefaults standardUserDefaults] boolForKey:@"ResourceLoadStatisticsDebugLoggingEnabled"]); > setResourceLoadStatisticsDebugMode([[NSUserDefaults standardUserDefaults] boolForKey:@"ExperimentalResourceLoadStatisticsDebugMode"]); >+ setStorageAccessPromptsEnabled([[NSUserDefaults standardUserDefaults] boolForKey:@"ExperimentalStorageAccessPromptsEnabled"]); > }); > } > >diff --git a/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp b/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp >index 2479bcfd9e7bda12eee247a271c8a5bb20bf94bc..3e78315ac79bae823ef117bbb7ec767ea8b10d5b 100644 >--- a/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp >+++ b/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp >@@ -456,7 +456,6 @@ void WebResourceLoadStatisticsStore::grantStorageAccess(String&& subFrameHost, S > > 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 @@ void WebResourceLoadStatisticsStore::grantStorageAccessInternal(String&& subFram > 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)); > } > >diff --git a/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h b/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h >index e8ad1df7acd409f5fe38719cdc73f28ba712f05e..468d594868996716579bc75fd32a5aeae77f8520 100644 >--- a/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h >+++ b/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h >@@ -191,6 +191,7 @@ private: > 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 @@ private: > > bool m_debugModeEnabled { false }; > bool m_debugLoggingEnabled { false }; >+ bool m_storageAccessPromptsEnabled { false }; > > Function<void (const String&)> m_statisticsTestingCallback; > };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185534
:
340146
| 340154