Comment 2 for bug 288236

Revision history for this message
In , Myk (myk) wrote :

Created an attachment (id=298424)
patch v2: a better approach

On second thought, a simpler and cleaner approach is for the sanitizer to remove the data from the database directly, since other callers are unlikely to want to do the same thing, and thus an API method for doing it is unwarranted.

Also, we can use executeSimpleSQL to make the actual database calls much simpler. And we can still have an XPCShell test that loads the sanitizer JavaScript and calls it in the same way the the Clear Private Data dialog does.

We just need to expose the database connection to the content prefs database in the API, which I've done using the same name for the connection attribute that nsIDownloadManager uses to expose its database connection: DBConnection.

Here's a patch that implements this approach. Note that the bulk of the patch is comments and XPCShell tests. The actual code changes are fairly small.