Summary: | REGRESSION (r289474): cacheStoragePath is empty in NetworkStorageManager::localOriginStorageManager | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> | ||||||||||
Component: | Website Storage | Assignee: | Sihui Liu <sihui_liu> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | annulen, cdumez, cgarcia, ews-watchlist, gyuyoung.kim, ryuan.choi, sergio, sihui_liu, simon.fraser, webkit-bug-importer | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | Safari Technology Preview | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=234925 | ||||||||||||
Attachments: |
|
Description
Simon Fraser (smfr)
2022-03-01 10:50:59 PST
Created attachment 453551 [details]
Patch
Created attachment 453564 [details]
Patch
Comment on attachment 453564 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=453564&action=review r=me with comments. > Source/WebKit/NetworkProcess/NetworkProcess.cpp:419 > + RetainPtr<CFStringRef> cfIdentifier = makeString(identifierBase, ".PrivateBrowsing.", createVersion4UUIDString()).createCFString(); Could use auto. > Source/WebKit/NetworkProcess/NetworkProcess.cpp:442 > + if (m_networkSessions.contains(sessionID)) This could be dropped and we could use HashMap::ensure() below to avoid double hash map lookup. > Source/WebKit/NetworkProcess/NetworkProcess.cpp:2177 > + if (auto* session = networkSession(sessionID)) BUG: You're now failing to call the completionHandler in the else case. > Source/WebKit/NetworkProcess/NetworkProcess.cpp:2282 > +const String& NetworkProcess::uiProcessBundleIdentifier() Given that this is a one liner, I would keep inline in the header. Outside the class but inline in the header: ``` #if !PLATFORM(COCOA) inline const String& NetworkProcess::uiProcessBundleIdentifier() const { return m_uiProcessBundleIdentifier; } #endif ``` > Source/WebKit/NetworkProcess/NetworkProcess.h:303 > + const String& uiProcessBundleIdentifier(); I think this should remain const. > Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp:480 > + , WTFMove(*shouldUseCustomStoragePaths) Please don't use WTFMove() for booleans and integers. > Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm:258 > +const String& NetworkProcess::uiProcessBundleIdentifier() I think we should keep the getter as const and mark m_uiProcessBundleIdentifier as mutable. It is a typical pattern for lazy initialization. > Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm:260 > + if (m_uiProcessBundleIdentifier.isEmpty()) Shouldn't this is a isNull() check? > Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm:261 > + m_uiProcessBundleIdentifier = String([[NSBundle mainBundle] bundleIdentifier]); Is String() really needed? > Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1856 > + FileSystem::makeAllDirectories(directory); Not new in this patch but we really should NOT be blocking the main thread of the UIProcess (or any process for that matter but the UIProcess is probably this worse) on file system operations. If you don't want to fix in this patch, at the very least add a FIXME because we likely need to revisit. > Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1857 > + FileSystem::excludeFromBackup(directory); ditto. > Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h:257 > + const String& resolvedIndexedDBDirectory() const { return m_resolvedConfiguration->indexedDBDatabaseDirectory(); } The lack of consistency in the naming between "resolvedIndexedDBDirectory" and `m_resolvedConfiguration->indexedDBDatabaseDirectory()` is bothering me. Comment on attachment 453564 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=453564&action=review >> Source/WebKit/NetworkProcess/NetworkProcess.cpp:419 >> + RetainPtr<CFStringRef> cfIdentifier = makeString(identifierBase, ".PrivateBrowsing.", createVersion4UUIDString()).createCFString(); > > Could use auto. Sure. >> Source/WebKit/NetworkProcess/NetworkProcess.cpp:442 >> + if (m_networkSessions.contains(sessionID)) > > This could be dropped and we could use HashMap::ensure() below to avoid double hash map lookup. Okay. >> Source/WebKit/NetworkProcess/NetworkProcess.cpp:2177 >> + if (auto* session = networkSession(sessionID)) > > BUG: You're now failing to call the completionHandler in the else case. Ooops >> Source/WebKit/NetworkProcess/NetworkProcess.cpp:2282 >> +const String& NetworkProcess::uiProcessBundleIdentifier() > > Given that this is a one liner, I would keep inline in the header. Outside the class but inline in the header: > ``` > #if !PLATFORM(COCOA) > inline const String& NetworkProcess::uiProcessBundleIdentifier() const > { > return m_uiProcessBundleIdentifier; > } > #endif > ``` Sure. >> Source/WebKit/NetworkProcess/NetworkProcess.h:303 >> + const String& uiProcessBundleIdentifier(); > > I think this should remain const. We may change its value in its definition on Cocoa platforms >> Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp:480 >> + , WTFMove(*shouldUseCustomStoragePaths) > > Please don't use WTFMove() for booleans and integers. Sure. >> Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm:258 >> +const String& NetworkProcess::uiProcessBundleIdentifier() > > I think we should keep the getter as const and mark m_uiProcessBundleIdentifier as mutable. It is a typical pattern for lazy initialization. Okay. >> Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm:260 >> + if (m_uiProcessBundleIdentifier.isEmpty()) > > Shouldn't this is a isNull() check? Will change it back to isNull() >> Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm:261 >> + m_uiProcessBundleIdentifier = String([[NSBundle mainBundle] bundleIdentifier]); > > Is String() really needed? Maybe not. >> Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1856 >> + FileSystem::makeAllDirectories(directory); > > Not new in this patch but we really should NOT be blocking the main thread of the UIProcess (or any process for that matter but the UIProcess is probably this worse) on file system operations. > > If you don't want to fix in this patch, at the very least add a FIXME because we likely need to revisit. Sure, will add. >> Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1857 >> + FileSystem::excludeFromBackup(directory); > > ditto. Sure. >> Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h:257 >> + const String& resolvedIndexedDBDirectory() const { return m_resolvedConfiguration->indexedDBDatabaseDirectory(); } > > The lack of consistency in the naming between "resolvedIndexedDBDirectory" and `m_resolvedConfiguration->indexedDBDatabaseDirectory()` is bothering me. Will change to resolvedIndexedDBDatabaseDirectory (the inconsistency between resolvedIndexedDatabaseDirectory and indexedDBDatabaseDirectory is more annoying to me) (In reply to Sihui Liu from comment #4) > Comment on attachment 453564 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=453564&action=review > > >> Source/WebKit/NetworkProcess/NetworkProcess.cpp:419 > >> + RetainPtr<CFStringRef> cfIdentifier = makeString(identifierBase, ".PrivateBrowsing.", createVersion4UUIDString()).createCFString(); > > > > Could use auto. > > Sure. > > >> Source/WebKit/NetworkProcess/NetworkProcess.cpp:442 > >> + if (m_networkSessions.contains(sessionID)) > > > > This could be dropped and we could use HashMap::ensure() below to avoid double hash map lookup. > > Okay. > > >> Source/WebKit/NetworkProcess/NetworkProcess.cpp:2177 > >> + if (auto* session = networkSession(sessionID)) > > > > BUG: You're now failing to call the completionHandler in the else case. > > Ooops > > >> Source/WebKit/NetworkProcess/NetworkProcess.cpp:2282 > >> +const String& NetworkProcess::uiProcessBundleIdentifier() > > > > Given that this is a one liner, I would keep inline in the header. Outside the class but inline in the header: > > ``` > > #if !PLATFORM(COCOA) > > inline const String& NetworkProcess::uiProcessBundleIdentifier() const > > { > > return m_uiProcessBundleIdentifier; > > } > > #endif > > ``` > > Sure. > > >> Source/WebKit/NetworkProcess/NetworkProcess.h:303 > >> + const String& uiProcessBundleIdentifier(); > > > > I think this should remain const. > > We may change its value in its definition on Cocoa platforms Yes and I commented on how to address that. Created attachment 453661 [details]
Patch
Created attachment 453672 [details]
Patch
Committed r290766 (248010@main): <https://commits.webkit.org/248010@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 453672 [details]. |