WebKit Version 5.1 (6534.50, r96515) Since a few days, WebKit on Mac 10.6.8 creates StorageTracker.db at '/~/Library/Safari/LocalStorage/StorageTracker.db' (directory literally named "~" at root). Also, extensions like Adblock reinstall on each browser startup.
This only happens when extensions like Adblock (http://safariadblock.com) are used.
<rdar://problem/10235680>
<http://trac.webkit.org/changeset/96255> is a suspicious change.
I can confirm this bug. In my case, it does not seem to be caused by AdBlock, for I disabled AdBlock and the bug persisted. However when I disabled _all_ extensions, the misplaced StorageTracker.db was no longer created. 5.1 (6534.50, r96636)
Created attachment 109853 [details] Patch
Comment on attachment 109853 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=109853&action=review > Source/WebKit/mac/Storage/WebStorageManager.mm:93 > static NSString *sLocalStoragePath; Is this code only ever running on main thread? > Source/WebKit/mac/Storage/WebStorageManager.mm:98 > NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; I wonder why it's reading defaults every time, not just on initialization. > Source/WebKit/mac/Storage/WebStorageManager.mm:105 > + sLocalStoragePath = [[sLocalStoragePath stringByStandardizingPath] retain]; This code will retain each time, but the function is not a "copy" one.
Comment on attachment 109853 [details] Patch My bad. I didn't notice the early return (we usually use a different pattern in WebCore, something like static NSString *sLocalStoragePath = calculateStoragePath();
Created attachment 109862 [details] Now with more thread-safe\!
Comment on attachment 109862 [details] Now with more thread-safe\! View in context: https://bugs.webkit.org/attachment.cgi?id=109862&action=review I don't know if thread safety is a real issue for this function, but the patch looks good. > Source/WebKit/mac/Storage/WebStorageManager.mm:35 > +#import <pthread.h> > #import <WebCore/SecurityOrigin.h> > #import <WebCore/StorageTracker.h> Alphabetically, upper case comes first.
Committed r96748: <http://trac.webkit.org/changeset/96748>