Summary: | REGRESSION: Curious Location of StorageTracker.db | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Martin Stricker <martin.stricker> | ||||||
Component: | WebKit Misc. | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | adauria, amaral, ap, beidson, ddkilzer | ||||||
Priority: | P1 | Keywords: | InRadar, Regression | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.6 | ||||||||
Attachments: |
|
Description
Martin Stricker
2011-10-04 16:55:30 PDT
This only happens when extensions like Adblock (http://safariadblock.com) are used. <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> |