Bug 234366

Summary: Move WebIDBServers from NetworkProcess to NetworkSession class
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, berto, cgarcia, darin, ews-watchlist, galpeter, ggaren, gustavo, kkinnunen, mkwst, sam, sihui_liu, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=234179
https://bugs.webkit.org/show_bug.cgi?id=234409
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
none
Patch
ews-feeder: commit-queue-
Patch
none
Patch
none
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch none

Chris Dumez
Reported 2021-12-15 14:20:57 PST
Move WebIDBServers from NetworkProcess to NetworkSession class, since they are per session.
Attachments
Patch (27.89 KB, patch)
2021-12-15 14:23 PST, Chris Dumez
ews-feeder: commit-queue-
Patch (28.64 KB, patch)
2021-12-15 14:39 PST, Chris Dumez
no flags
Patch (28.90 KB, patch)
2021-12-15 15:10 PST, Chris Dumez
ews-feeder: commit-queue-
Patch (28.90 KB, patch)
2021-12-15 15:34 PST, Chris Dumez
no flags
Patch (88.71 KB, patch)
2021-12-16 07:52 PST, Chris Dumez
no flags
Patch (104.72 KB, patch)
2021-12-16 11:42 PST, Chris Dumez
ews-feeder: commit-queue-
Patch (105.25 KB, patch)
2021-12-16 11:53 PST, Chris Dumez
ews-feeder: commit-queue-
Patch (105.28 KB, patch)
2021-12-16 11:59 PST, Chris Dumez
ews-feeder: commit-queue-
Patch (105.83 KB, patch)
2021-12-16 12:10 PST, Chris Dumez
ews-feeder: commit-queue-
Patch (112.58 KB, patch)
2021-12-16 12:28 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2021-12-15 14:23:19 PST
Chris Dumez
Comment 2 2021-12-15 14:39:42 PST
Chris Dumez
Comment 3 2021-12-15 15:10:47 PST
Chris Dumez
Comment 4 2021-12-15 15:34:32 PST
Darin Adler
Comment 5 2021-12-15 17:47:27 PST
Comment on attachment 447292 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=447292&action=review Looks like a good, relatively straightforward refactoring. I didn’t spot anything obviously missing. > Source/WebKit/NetworkProcess/NetworkProcess.cpp:393 > + if (auto* networkSession = this->networkSession(sessionID)) > + networkSession->ensureWebIDBServer().addConnection(connection.connection(), identifier); Tempting to just use "session" to avoid the need for "this->" and possibly make things even more readable. Other cases of that below. > Source/WebKit/NetworkProcess/NetworkProcess.cpp:1847 > + auto* session = this->networkSession(sessionID); Not sure we need the "this->" here since there is no name collision. > Source/WebKit/NetworkProcess/NetworkSession.cpp:677 > + // ********* > + // IMPORTANT: Do not change the directory structure for indexed databases on disk without first consulting a reviewer from Apple (<rdar://problem/17454712>) > + // ********* This is clearly a valuable comment. But is this function the absolute best place for it? > Source/WebKit/NetworkProcess/ios/NetworkProcessIOS.mm:120 > + forEachNetworkSession([](auto& networkSession) { Formatting tweak: can’t remember if we use spaces here. Cod style tweak: Always love the single words when the scope is small enough, so just "session" would be nice.
Chris Dumez
Comment 6 2021-12-16 07:15:09 PST
(In reply to Darin Adler from comment #5) > Comment on attachment 447292 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=447292&action=review > > Looks like a good, relatively straightforward refactoring. I didn’t spot > anything obviously missing. > > > Source/WebKit/NetworkProcess/NetworkProcess.cpp:393 > > + if (auto* networkSession = this->networkSession(sessionID)) > > + networkSession->ensureWebIDBServer().addConnection(connection.connection(), identifier); > > Tempting to just use "session" to avoid the need for "this->" and possibly > make things even more readable. Other cases of that below. Will fix. > > Source/WebKit/NetworkProcess/NetworkProcess.cpp:1847 > > + auto* session = this->networkSession(sessionID); > > Not sure we need the "this->" here since there is no name collision. I had to for this one because there is a networkSession variable outside the lambda and the compiler was complaining that it couldn't be called as a function and wasn't captured in the lambda. > > Source/WebKit/NetworkProcess/NetworkSession.cpp:677 > > + // ********* > > + // IMPORTANT: Do not change the directory structure for indexed databases on disk without first consulting a reviewer from Apple (<rdar://problem/17454712>) > > + // ********* > > This is clearly a valuable comment. But is this function the absolute best > place for it? > > > Source/WebKit/NetworkProcess/ios/NetworkProcessIOS.mm:120 > > + forEachNetworkSession([](auto& networkSession) { > > Formatting tweak: can’t remember if we use spaces here. > Cod style tweak: Always love the single words when the scope is small > enough, so just "session" would be nice. Ok.
Chris Dumez
Comment 7 2021-12-16 07:52:27 PST
Chris Dumez
Comment 8 2021-12-16 11:42:46 PST
Chris Dumez
Comment 9 2021-12-16 11:53:35 PST
Chris Dumez
Comment 10 2021-12-16 11:59:11 PST
Chris Dumez
Comment 11 2021-12-16 12:10:03 PST
Chris Dumez
Comment 12 2021-12-16 12:28:24 PST
EWS
Comment 13 2021-12-16 14:39:02 PST
Committed r287159 (245336@main): <https://commits.webkit.org/245336@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 447384 [details].
Radar WebKit Bug Importer
Comment 14 2021-12-16 15:09:59 PST
Note You need to log in before you can comment on or make changes to this bug.