diff options
author | Ben Murdoch <benm@google.com> | 2010-05-11 18:35:50 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-05-14 10:23:05 +0100 |
commit | 21939df44de1705786c545cd1bf519d47250322d (patch) | |
tree | ef56c310f5c0cdc379c2abb2e212308a3281ce20 /WebKit/mac/Storage | |
parent | 4ff1d8891d520763f17675827154340c7c740f90 (diff) | |
download | external_webkit-21939df44de1705786c545cd1bf519d47250322d.zip external_webkit-21939df44de1705786c545cd1bf519d47250322d.tar.gz external_webkit-21939df44de1705786c545cd1bf519d47250322d.tar.bz2 |
Merge Webkit at r58956: Initial merge by Git.
Change-Id: I1d9fb60ea2c3f2ddc04c17a871acdb39353be228
Diffstat (limited to 'WebKit/mac/Storage')
-rw-r--r-- | WebKit/mac/Storage/WebDatabaseManager.mm | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/WebKit/mac/Storage/WebDatabaseManager.mm b/WebKit/mac/Storage/WebDatabaseManager.mm index 2c58889..782f422 100644 --- a/WebKit/mac/Storage/WebDatabaseManager.mm +++ b/WebKit/mac/Storage/WebDatabaseManager.mm @@ -49,6 +49,8 @@ NSString *WebDatabaseDidModifyOriginNotification = @"WebDatabaseDidModifyOriginN NSString *WebDatabaseDidModifyDatabaseNotification = @"WebDatabaseDidModifyDatabaseNotification"; NSString *WebDatabaseIdentifierKey = @"WebDatabaseIdentifierKey"; +static NSString *databasesDirectoryPath(); + @implementation WebDatabaseManager + (WebDatabaseManager *) sharedWebDatabaseManager @@ -119,6 +121,16 @@ NSString *WebDatabaseIdentifierKey = @"WebDatabaseIdentifierKey"; @end +static NSString *databasesDirectoryPath() +{ + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + NSString *databasesDirectory = [defaults objectForKey:WebDatabaseDirectoryDefaultsKey]; + if (!databasesDirectory || ![databasesDirectory isKindOfClass:[NSString class]]) + databasesDirectory = @"~/Library/WebKit/Databases"; + + return [databasesDirectory stringByStandardizingPath]; +} + void WebKitInitializeDatabasesIfNecessary() { static BOOL initialized = NO; @@ -126,13 +138,7 @@ void WebKitInitializeDatabasesIfNecessary() return; // Set the database root path in WebCore - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - - NSString *databasesDirectory = [defaults objectForKey:WebDatabaseDirectoryDefaultsKey]; - if (!databasesDirectory || ![databasesDirectory isKindOfClass:[NSString class]]) - databasesDirectory = @"~/Library/WebKit/Databases"; - - DatabaseTracker::tracker().setDatabaseDirectoryPath([databasesDirectory stringByStandardizingPath]); + DatabaseTracker::tracker().setDatabaseDirectoryPath(databasesDirectoryPath()); // Set the DatabaseTrackerClient DatabaseTracker::tracker().setClient(WebDatabaseTrackerClient::sharedWebDatabaseTrackerClient()); |