RESOLVED FIXED 207692
[Curl] Implement functions to use ResourceLoadStatistics.
https://bugs.webkit.org/show_bug.cgi?id=207692
Summary [Curl] Implement functions to use ResourceLoadStatistics.
Takashi Komori
Reported 2020-02-13 05:52:59 PST
Implement functions to use ResouceLoadStatistics on curl port. In this ticket we aim to pass all ResourceLoadStatistics tests on curl port.
Attachments
Implement some functions for ResouceLoadStatistics. (33.20 KB, patch)
2020-02-13 05:58 PST, Takashi Komori
no flags
Patch (49.61 KB, patch)
2020-05-31 18:55 PDT, Takashi Komori
no flags
Patch (34.12 KB, patch)
2020-05-31 21:00 PDT, Takashi Komori
no flags
Patch (33.61 KB, patch)
2020-06-01 02:52 PDT, Takashi Komori
no flags
Patch (34.13 KB, patch)
2020-06-05 00:26 PDT, Takashi Komori
no flags
Patch (33.87 KB, patch)
2020-06-09 01:58 PDT, Takashi Komori
no flags
Patch (34.45 KB, patch)
2020-06-10 12:48 PDT, Takashi Komori
no flags
Patch (34.48 KB, patch)
2020-06-12 11:24 PDT, Takashi Komori
no flags
Takashi Komori
Comment 1 2020-02-13 05:58:12 PST
Created attachment 390635 [details] Implement some functions for ResouceLoadStatistics. We implement some functions for curl port while refferring cocoa port. Now 150 ResourceLoadStatistics tests pass and 11 tests fail.
Ross Kirsling
Comment 2 2020-02-13 10:29:41 PST
Comment on attachment 390635 [details] Implement some functions for ResouceLoadStatistics. View in context: https://bugs.webkit.org/attachment.cgi?id=390635&action=review A couple of nitpicks from me. > Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp:60 > + bool blockCookies = false; > +#if ENABLE(RESOURCE_LOAD_STATISTICS) > + blockCookies = storedCredentialsPolicy == WebCore::StoredCredentialsPolicy::EphemeralStateless || shouldBlockCookies(request); > +#endif nit: Seems like an #else would be slightly better here. > Tools/WebKitTestRunner/TestController.cpp:3115 > + explicit GetAllStorageAccessEntriesCallbackContext(TestController& controller, CompletionHandler<void(Vector<String>&&)>&& handler) nit: You shouldn't need `explicit` since this has two parameters.
Stephan Szabo
Comment 3 2020-02-13 10:55:55 PST
Comment on attachment 390635 [details] Implement some functions for ResouceLoadStatistics. View in context: https://bugs.webkit.org/attachment.cgi?id=390635&action=review > Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp:59 > + blockCookies = storedCredentialsPolicy == WebCore::StoredCredentialsPolicy::EphemeralStateless || shouldBlockCookies(request); Looking at the usage, is there a case where we want to separate the comparison with WebCore::StoredCredentialsPolicy::EphemeralStateless and the value of shouldBlockCookies(request)? I wonder if it'd make sense to check the credentials policy inside shouldBlockCookies to prevent the possibility of misuse if the m_storedCredentialsPolicy == WebCore::StoredCredentialsPolicy::EphemeralStateless type comparsion is always required.
Takashi Komori
Comment 4 2020-05-31 18:55:41 PDT
Takashi Komori
Comment 5 2020-05-31 21:00:32 PDT
Takashi Komori
Comment 6 2020-05-31 21:34:46 PDT
(In reply to Ross Kirsling from comment #2) > Comment on attachment 390635 [details] > Implement some functions for ResouceLoadStatistics. > > View in context: > https://bugs.webkit.org/attachment.cgi?id=390635&action=review > > A couple of nitpicks from me. > > > Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp:60 > > + bool blockCookies = false; > > +#if ENABLE(RESOURCE_LOAD_STATISTICS) > > + blockCookies = storedCredentialsPolicy == WebCore::StoredCredentialsPolicy::EphemeralStateless || shouldBlockCookies(request); > > +#endif > > nit: Seems like an #else would be slightly better here. I didn't add else part because now all lines are inside if clause. Is it okay? > > Tools/WebKitTestRunner/TestController.cpp:3115 > > + explicit GetAllStorageAccessEntriesCallbackContext(TestController& controller, CompletionHandler<void(Vector<String>&&)>&& handler) > > nit: You shouldn't need `explicit` since this has two parameters. Fixed.
Takashi Komori
Comment 7 2020-06-01 02:52:21 PDT
Takashi Komori
Comment 8 2020-06-01 02:56:26 PDT
(In reply to Stephan Szabo from comment #3) > Comment on attachment 390635 [details] > Implement some functions for ResouceLoadStatistics. > > View in context: > https://bugs.webkit.org/attachment.cgi?id=390635&action=review > > > Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp:59 > > + blockCookies = storedCredentialsPolicy == WebCore::StoredCredentialsPolicy::EphemeralStateless || shouldBlockCookies(request); > > Looking at the usage, is there a case where we want to separate the > comparison with WebCore::StoredCredentialsPolicy::EphemeralStateless and the > value of shouldBlockCookies(request)? > I wonder if it'd make sense to check the credentials policy inside > shouldBlockCookies to prevent the possibility of misuse if the > m_storedCredentialsPolicy == > WebCore::StoredCredentialsPolicy::EphemeralStateless type comparsion is > always required. We put together comparing StoredCredentialsPolicy and calling NetworkStorageSession::shouldBlockCookies
Basuke Suzuki
Comment 9 2020-06-02 18:54:45 PDT
Comment on attachment 400727 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=400727&action=review This is informal review: LGTM excepts for tiny documentation improvement. > Source/WebCore/ChangeLog:8 > + Implement functions which are required to implement ResourceLoadStatistics for wincairo. This patch seems neutral to all ports using Curl. WinCairo shouldn't be specified as the target of this patch.
Basuke Suzuki
Comment 10 2020-06-02 18:59:35 PDT
It is not the comment for this patch, but adding more comment makes easier to understand the intent of the patch, especially the patch contains both WebKit and WebCore, WTF. Basically what you write is the objective of the patch and that is true for WebKit for many cases. For WebCore/WTF, to achieve that goal please describe what you did on that layer more specifically.
John Wilander
Comment 11 2020-06-04 13:13:09 PDT
Comment on attachment 400727 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=400727&action=review LGTM. See my one comment though. I'll let someone more familiar with the Curl integration to make the final call. > Source/WebCore/platform/network/curl/CookieJarDB.cpp:622 > +bool CookieJarDB::deleteCookiesForHostname(const String& hostname, bool includeHttpOnlyCookies) Why switch to a bool here when we have the IncludeHttpOnlyCookies enum that helps with self documentation?
Takashi Komori
Comment 12 2020-06-05 00:26:34 PDT
Takashi Komori
Comment 13 2020-06-05 00:36:58 PDT
(In reply to Basuke Suzuki from comment #9) > Comment on attachment 400727 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=400727&action=review > > This is informal review: LGTM excepts for tiny documentation improvement. > > > Source/WebCore/ChangeLog:8 > > + Implement functions which are required to implement ResourceLoadStatistics for wincairo. > > This patch seems neutral to all ports using Curl. WinCairo shouldn't be > specified as the target of this patch. Thank you for your review. Changed to curl.
Takashi Komori
Comment 14 2020-06-05 00:42:21 PDT
(In reply to John Wilander from comment #11) > Comment on attachment 400727 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=400727&action=review > > LGTM. See my one comment though. I'll let someone more familiar with the > Curl integration to make the final call. > > > Source/WebCore/platform/network/curl/CookieJarDB.cpp:622 > > +bool CookieJarDB::deleteCookiesForHostname(const String& hostname, bool includeHttpOnlyCookies) > > Why switch to a bool here when we have the IncludeHttpOnlyCookies enum that > helps with self documentation? Thank you very much for the review. There is no reason using bool value so we changed to IncludeHttpOnlyCookies.
Takashi Komori
Comment 15 2020-06-09 01:58:37 PDT
Takashi Komori
Comment 16 2020-06-09 02:01:06 PDT
We found we can improve some tests by implementing getHostnamesWithCookies. So we updated the patch.
EWS
Comment 17 2020-06-09 07:50:54 PDT
Committed r262791: <https://trac.webkit.org/changeset/262791> All reviewed patches have been landed. Closing bug and clearing flags on attachment 401426 [details].
Radar WebKit Bug Importer
Comment 18 2020-06-09 07:51:18 PDT
Radar WebKit Bug Importer
Comment 19 2020-06-09 07:51:21 PDT
Fujii Hironori
Comment 20 2020-06-09 21:10:36 PDT
Takashi Komori
Comment 21 2020-06-10 12:42:55 PDT
Reopen to fix WK1 crash bug.
Takashi Komori
Comment 22 2020-06-10 12:48:55 PDT
Takashi Komori
Comment 23 2020-06-10 13:10:17 PDT
In WK1 some tests crashes because the value passed to NetworkStorageSession::clientSideCookieCap was uninitialized value. We should not have dereferenced the variable. This patch fixes the crash and fixes another compile issue that If we disable ENABLE_RESOURCE_LOAD_STATISTICS option, the build fails.
Takashi Komori
Comment 24 2020-06-12 11:24:25 PDT
EWS
Comment 25 2020-06-12 12:47:20 PDT
Committed r262971: <https://trac.webkit.org/changeset/262971> All reviewed patches have been landed. Closing bug and clearing flags on attachment 401753 [details].
Note You need to log in before you can comment on or make changes to this bug.