Bug 38555

Summary: Small code refactoring: move the logic to figure out the path to the databases directory to another method
Product: WebKit Reporter: Ada Chan <adachan>
Component: WebKit Misc.Assignee: Ada Chan <adachan>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ddkilzer, eric, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Patch ddkilzer: review+

Ada Chan
Reported 2010-05-04 16:45:10 PDT
Move the logic to figure out the path to the databases directory to another method, so new code that needs that information doesn't need to duplicate that code.
Attachments
Patch (2.57 KB, patch)
2010-05-04 16:47 PDT, Ada Chan
ddkilzer: review+
Ada Chan
Comment 1 2010-05-04 16:47:11 PDT
David Kilzer (:ddkilzer)
Comment 2 2010-05-04 16:50:15 PDT
Comment on attachment 55071 [details] Patch > Index: WebKit/mac/Storage/WebDatabaseManager.mm > +static NSString *databasesDirectoryPath(); I don't think static is needed here. Also, this definition isn't needed unless the method appears after the first use (IIRC). > @@ -119,6 +121,16 @@ - (BOOL)deleteDatabase:(NSString *)datab > +NSString *databasesDirectoryPath() But "static" should definitely be added above. > +{ > + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; > + NSString *databasesDirectory = [defaults objectForKey:WebDatabaseDirectoryDefaultsKey]; > + if (!databasesDirectory || ![databasesDirectory isKindOfClass:[NSString class]]) > + databasesDirectory = @"~/Library/WebKit/Databases"; > + > + return [databasesDirectory stringByStandardizingPath]; > +} r=me Dave
Ada Chan
Comment 3 2010-05-04 16:58:38 PDT
WebKit Review Bot
Comment 4 2010-05-04 17:48:36 PDT
http://trac.webkit.org/changeset/58787 might have broken Qt Linux Release
David Kilzer (:ddkilzer)
Comment 5 2010-05-04 18:01:25 PDT
(In reply to comment #4) > http://trac.webkit.org/changeset/58787 might have broken Qt Linux Release Lies.
Eric Seidel (no email)
Comment 6 2010-05-04 18:43:13 PDT
"might"! :)
Note You need to log in before you can comment on or make changes to this bug.