RESOLVED FIXED135346
Make WKOriginDataManager actually operate on IndexedDatabases
https://bugs.webkit.org/show_bug.cgi?id=135346
Summary Make WKOriginDataManager actually operate on IndexedDatabases
Brady Eidson
Reported 2014-07-28 12:56:44 PDT
Make WKOriginDataManager correctly operate on IndexedDatabases This patch will get the list of origins with databases by checking for their entries in the directory structure on disk. It will also delete the database files (and any resulting empty directories) when requested. <rdar://problem/15917314>
Attachments
Patch v1 (21.36 KB, patch)
2014-07-28 13:17 PDT, Brady Eidson
no flags
Patch v2 - Also added a new API we'll need very soon anyways (24.95 KB, patch)
2014-07-28 17:12 PDT, Brady Eidson
sam: review+
Brady Eidson
Comment 1 2014-07-28 12:59:55 PDT
In this patch, open handles to the database files on disk will not be notified and invalidated. This is probably quite an acceptable situation for now. because: - For read-only operations, they will continue functioning as normal on the unlinked file. - For write operations, they will start producing errors as SQLite notices the missing backing store. But it should still be fixed, and I filed https://bugs.webkit.org/show_bug.cgi?id=135347 to track that in a followup
Brady Eidson
Comment 2 2014-07-28 13:17:08 PDT
Created attachment 235611 [details] Patch v1
Sam Weinig
Comment 3 2014-07-28 16:03:06 PDT
Comment on attachment 235611 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=235611&action=review > Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp:60 > + // FIXME (<rdar://problem/9127819>): Is there a more explicit way of doing this besides accessing the UTF8Encoding? This should probably be a bugzilla bug. > Source/WebKit2/UIProcess/WebOriginDataManagerProxy.cpp:116 > + if (!callback) { > + LOG_ERROR("WebOriginDataManagerProxy::didGetOrigins - Invalid callback ID"); > + return; > + } > + When can this happen? Should this be a MESSAGE_CHECK()? > Source/WebKit2/UIProcess/WebOriginDataManagerProxy.cpp:131 > + if (!(types & kWKIndexedDatabaseData)) { > + callbackFunction(CallbackBase::Error::None); > return; > + } This should probably have the same comment as above (or just move the one from below). > Source/WebKit2/UIProcess/WebOriginDataManagerProxy.cpp:160 > + if (!(types & kWKIndexedDatabaseData)) { > + callbackFunction(CallbackBase::Error::None); > return; > + } This should probably have the same comment as above (or just move the one from below). > Source/WebKit2/UIProcess/WebOriginDataManagerProxy.cpp:190 > + if (!(types & kWKIndexedDatabaseData)) { > + callbackFunction(CallbackBase::Error::None); > return; > + } This should probably have the same comment as above (or just move the one from below).
Brady Eidson
Comment 4 2014-07-28 16:07:27 PDT
(In reply to comment #3) > (From update of attachment 235611 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=235611&action=review > > > Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp:60 > > + // FIXME (<rdar://problem/9127819>): Is there a more explicit way of doing this besides accessing the UTF8Encoding? > > This should probably be a bugzilla bug. Yah, probably! > > Source/WebKit2/UIProcess/WebOriginDataManagerProxy.cpp:116 > > + if (!callback) { > > + LOG_ERROR("WebOriginDataManagerProxy::didGetOrigins - Invalid callback ID"); > > + return; > > + } > > + > > When can this happen? Should this be a MESSAGE_CHECK()? Shouldn't happen. Should probably be a MESSAGE_CHECK. > This should probably have the same comment as above (or just move the one from below). ... > This should probably have the same comment as above (or just move the one from below). ... > This should probably have the same comment as above (or just move the one from below). Willdo
Brady Eidson
Comment 5 2014-07-28 16:12:37 PDT
Filed https://bugs.webkit.org/show_bug.cgi?id=135365 for that radar. Will update the comment in the patch (as well as the comment in LocalStorageDatabaseTracker.cpp) before landing.
Brady Eidson
Comment 6 2014-07-28 16:26:58 PDT
(In reply to comment #4) > (In reply to comment #3) > > > > Source/WebKit2/UIProcess/WebOriginDataManagerProxy.cpp:116 > > > + if (!callback) { > > > + LOG_ERROR("WebOriginDataManagerProxy::didGetOrigins - Invalid callback ID"); > > > + return; > > > + } > > > + > > > > When can this happen? Should this be a MESSAGE_CHECK()? > > Shouldn't happen. Should probably be a MESSAGE_CHECK. MESSAGE_CHECK requires you know what Connection the current dispatched message came from. Right now, that can only be the DatabaseProcess, so I can do it. In the future, WebOriginDataManagerProxy will *not* know what Connection this message is coming from, so we'll have to deal with that later.
Brady Eidson
Comment 7 2014-07-28 16:40:50 PDT
(In reply to comment #6) > (In reply to comment #4) > > (In reply to comment #3) > > > > > > Source/WebKit2/UIProcess/WebOriginDataManagerProxy.cpp:116 > > > > + if (!callback) { > > > > + LOG_ERROR("WebOriginDataManagerProxy::didGetOrigins - Invalid callback ID"); > > > > + return; > > > > + } > > > > + > > > > > > When can this happen? Should this be a MESSAGE_CHECK()? > > > > Shouldn't happen. Should probably be a MESSAGE_CHECK. > > MESSAGE_CHECK requires you know what Connection the current dispatched message came from. > > Right now, that can only be the DatabaseProcess, so I can do it. > > In the future, WebOriginDataManagerProxy will *not* know what Connection this message is coming from, so we'll have to deal with that later. Actually with the magic of WantsConnection, we can do this. New patch forthcoming.
Brady Eidson
Comment 8 2014-07-28 17:12:49 PDT
Created attachment 235647 [details] Patch v2 - Also added a new API we'll need very soon anyways
Brady Eidson
Comment 9 2014-07-28 21:57:47 PDT
Sorry about the "Also added a new API we'll need very soon anyways" - That got in there from autocomplete history. This V2 is basically V1 with review feedback addressed.
David Kilzer (:ddkilzer)
Comment 10 2014-07-29 09:42:37 PDT
Comment on attachment 235647 [details] Patch v2 - Also added a new API we'll need very soon anyways r=me on the parts of the patch that touch the filesystem.
Alex Christensen
Comment 11 2014-07-29 10:29:40 PDT
(In reply to comment #10) > (From update of attachment 235647 [details]) > r=me on the parts of the patch that touch the filesystem. me, too!
Brady Eidson
Comment 12 2014-07-29 10:38:30 PDT
Csaba Osztrogonác
Comment 13 2014-07-29 13:15:57 PDT
Note You need to log in before you can comment on or make changes to this bug.