WebKit Bugzilla
Attachment 360373 Details for
Bug 193922
: REGRESSION (r240498): Storage Access API prompts result is not remembered
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193922-20190128135352.patch (text/plain), 5.55 KB, created by
Brent Fulgham
on 2019-01-28 13:53:53 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Brent Fulgham
Created:
2019-01-28 13:53:53 PST
Size:
5.55 KB
patch
obsolete
>Subversion Revision: 240588 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index e90a49d68ad6ee2f5a07cd88c41367e1905242a0..15a71770a034b49c8e4d0e7c914915b34869a4eb 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,24 @@ >+2019-01-28 Brent Fulgham <bfulgham@apple.com> >+ >+ REGRESSION (r240498): Storage Access API prompts result is not remembered >+ https://bugs.webkit.org/show_bug.cgi?id=193922 >+ <rdar://problem/47608767> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The refactoring in r240498 bypassed bookkeeping in ResourceLoadStatisticsMemoryStore >+ that kept track of whether a successful user prompt had been encountered. This >+ patch corrects this codepath so the user is not prompted repeatedly after approving >+ use of the Storage Access API. >+ >+ * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: >+ (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess): Switch from Move operator to >+ const reference to allow the method to be called by the NetworkProcess. >+ * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: >+ * NetworkProcess/NetworkProcess.cpp: >+ (WebKit::NetworkProcess::grantStorageAccess): Request access through the WebResourceLoadStatistics >+ object, rather than jumping directly to the NetworkStorageSession. >+ > 2019-01-28 Antoine Quint <graouts@apple.com> > > Limit user-agent interactions based on the touch-action property on iOS >diff --git a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp >index 33f5f0d0028702d215c6450d7f778b0333c6ab92..5cdf830265271014a95c0454b87c4cf18558f527 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp >+++ b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp >@@ -339,7 +339,7 @@ void WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener(String&& pr > }); > } > >-void WebResourceLoadStatisticsStore::grantStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, bool userWasPromptedNow, CompletionHandler<void(bool)>&& completionHandler) >+void WebResourceLoadStatisticsStore::grantStorageAccess(const String& subFrameHost, const String& topFrameHost, uint64_t frameID, uint64_t pageID, bool userWasPromptedNow, CompletionHandler<void(bool)>&& completionHandler) > { > ASSERT(RunLoop::isMain()); > postTask([this, subFrameHost = crossThreadCopy(subFrameHost), topFrameHost = crossThreadCopy(topFrameHost), frameID, pageID, userWasPromptedNow, completionHandler = WTFMove(completionHandler)]() mutable { >diff --git a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h >index dfd065ad59a1f8a70e133066b616d1f9f20f7d3f..d28890ebe0b4e637f03130dafa0e70f423635c21 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h >+++ b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h >@@ -76,7 +76,7 @@ public: > void setShouldSubmitTelemetry(bool); > > void requestStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, bool promptEnabled, CompletionHandler<void(StorageAccessStatus)>&&); >- void grantStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, bool userWasPromptedNow, CompletionHandler<void(bool)>&&); >+ void grantStorageAccess(const String& subFrameHost, const String& topFrameHost, uint64_t frameID, uint64_t pageID, bool userWasPromptedNow, CompletionHandler<void(bool)>&&); > void requestStorageAccessCallback(bool wasGranted, uint64_t contextId); > > void applicationWillTerminate(); >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.cpp b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >index cdcb2ab24ab3899f43cbbb7427b0fe29cc35a38a..9542879cd70a3dfe00c65f0bd9a38ba762485918 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >@@ -980,15 +980,15 @@ void NetworkProcess::requestStorageAccess(PAL::SessionID sessionID, const String > > void NetworkProcess::grantStorageAccess(PAL::SessionID sessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool userWasPrompted, CompletionHandler<void(bool)>&& completionHandler) > { >- bool isStorageGranted = false; >- if (auto* networkStorageSession = storageSession(sessionID)) { >- networkStorageSession->grantStorageAccess(resourceDomain, firstPartyDomain, frameID, pageID); >- ASSERT(networkStorageSession->hasStorageAccess(resourceDomain, firstPartyDomain, frameID, pageID)); >- isStorageGranted = true; >- } else >+ if (auto* networkSession = this->networkSession(sessionID)) { >+ if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) >+ resourceLoadStatistics->grantStorageAccess(resourceDomain, firstPartyDomain, frameID.value(), pageID, userWasPrompted, WTFMove(completionHandler)); >+ else >+ completionHandler(false); >+ } else { > ASSERT_NOT_REACHED(); >- >- completionHandler(isStorageGranted); >+ completionHandler(false); >+ } > } > > void NetworkProcess::logFrameNavigation(PAL::SessionID sessionID, const String& targetPrimaryDomain, const String& mainFramePrimaryDomain, const String& sourcePrimaryDomain, const String& targetHost, const String& mainFrameHost, bool isRedirect, bool isMainFrame)
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
Flags:
cdumez
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193922
: 360373