If we have called CookieStorageMac::startObservingCookieChanges, and then the WebProcess crashes, the WebProcess will restart, and when we call stopObservingCookieChanges, cookieStorageAdapter won't have been initialized yet, and the ASSERT(cookieStorageAdapter) will fail. We don't need this assert, as it can be clearly incorrect, and there isn't harm in dispatching a message to nil if cookieStorageAdapter hasn't been defined yet. <rdar://problem/9178751>
Created attachment 87575 [details] [PATCH] Fix
Comment on attachment 87575 [details] [PATCH] Fix View in context: https://bugs.webkit.org/attachment.cgi?id=87575&action=review > Source/WebCore/platform/network/mac/CookieStorageMac.mm:119 > [cookieStorageAdapter stopListeningForCookieChangeNotifications]; I know that dispatching a message to nil won't crash, but I think it is very unclear here that it is ok for the cookieStorageAdapter to be null. I think a comment and an early return would be better.
Created attachment 87576 [details] [PATCH] Fix w/ early return + comment
Comment on attachment 87576 [details] [PATCH] Fix w/ early return + comment Unofficially, as I am not a reviewer, r=me.
Landed in r82473.