Bug 39486

Summary: Regression: Database origins aren't populated at launch (missing db in prefs sheet, possible other symptoms)
Product: WebKit Reporter: Adam Roben (:aroben) <aroben>
Component: WebKit APIAssignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, dglazkov, dumi, hamaji, webkit.review.bot
Priority: P2 Keywords: InRadar, Regression
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
Initialize a DatabaseTracker with it's initial path, instead of setting the path later.
beidson: commit-queue-
Same thing, with Chromium build fix darin: review+, beidson: commit-queue-

Adam Roben (:aroben)
Reported 2010-05-21 07:26:23 PDT
To reproduce: 1. Go to http://webkit.org/misc/DatabaseExample.html 2. Make a few notes 3. Go to Preferences > Security > Show Databases No databases are listed. But there should be a database for webkit.org!
Attachments
Initialize a DatabaseTracker with it's initial path, instead of setting the path later. (8.60 KB, patch)
2010-05-21 17:09 PDT, Brady Eidson
beidson: commit-queue-
Same thing, with Chromium build fix (9.41 KB, patch)
2010-05-21 17:31 PDT, Brady Eidson
darin: review+
beidson: commit-queue-
Adam Roben (:aroben)
Comment 1 2010-05-21 07:26:48 PDT
This happens on both Mac and Windows.
Adam Roben (:aroben)
Comment 2 2010-05-21 07:26:53 PDT
Brady Eidson
Comment 3 2010-05-21 13:26:46 PDT
The first major cause I've found is http://trac.webkit.org/changeset/57668. Things happen like this: -On launch, WebKit initializes databases in WebKitInitializeDatabasesIfNecessary() -In that method the first thing it tries to do is: DatabaseTracker::tracker().setDatabaseDirectoryPath(databasesDirectoryPath()); -In r57668, populating the origins was moved to the constructor. Other than rote refactoring, it's not immediately clear to me why this was necessary. -So when that initialization code runs, it creates the tracker, whose c'tor tries to populate the origins, but the database path hasn't been set, so that fails. And after it fails once the tracker is in a pretty bogus state. The fix for this might be very, very easy, but I can't get to it for an hour or two.
Brady Eidson
Comment 4 2010-05-21 15:58:18 PDT
There was a lot of changes and refactoring done in database code that I didn't pay super close attention to, but I think the change to move populateOrigins() into the constructor was misguided, since it forced origin populate on startup for at least 2 ports - even if databases are never to be used.
Brady Eidson
Comment 5 2010-05-21 17:09:58 PDT
Created attachment 56765 [details] Initialize a DatabaseTracker with it's initial path, instead of setting the path later. I can test this in DRT to make sure it doesn't break again but doing so will require an API-specific test. I plan to followup this patch with that, as this bug is keeping us from doing real work in the short term.
WebKit Review Bot
Comment 6 2010-05-21 17:12:51 PDT
Brady Eidson
Comment 7 2010-05-21 17:31:46 PDT
Created attachment 56767 [details] Same thing, with Chromium build fix
Brady Eidson
Comment 8 2010-05-24 15:47:01 PDT
Shinichiro Hamaji
Comment 9 2010-06-17 01:38:46 PDT
Looks like this issue was fixed?
Note You need to log in before you can comment on or make changes to this bug.