Bug 57477 - ASSERT(cookieStorageAdapter) when calling stopObservingCookieChanges after WebProcess has crashed
Summary: ASSERT(cookieStorageAdapter) when calling stopObservingCookieChanges after We...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.6
: P2 Normal
Assignee: Brian Weinstein
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-03-30 10:56 PDT by Brian Weinstein
Modified: 2011-03-30 11:13 PDT (History)
1 user (show)

See Also:


Attachments
[PATCH] Fix (1.51 KB, patch)
2011-03-30 10:59 PDT, Brian Weinstein
no flags Details | Formatted Diff | Diff
[PATCH] Fix w/ early return + comment (1.76 KB, patch)
2011-03-30 11:06 PDT, Brian Weinstein
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Weinstein 2011-03-30 10:56:04 PDT
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>
Comment 1 Brian Weinstein 2011-03-30 10:59:16 PDT
Created attachment 87575 [details]
[PATCH] Fix
Comment 2 Jessie Berlin 2011-03-30 11:01:49 PDT
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.
Comment 3 Brian Weinstein 2011-03-30 11:06:16 PDT
Created attachment 87576 [details]
[PATCH] Fix w/ early return + comment
Comment 4 Jessie Berlin 2011-03-30 11:07:20 PDT
Comment on attachment 87576 [details]
[PATCH] Fix w/ early return + comment

Unofficially, as I am not a reviewer, r=me.
Comment 5 Brian Weinstein 2011-03-30 11:12:59 PDT
Landed in r82473.