Bug 15692 - Gtk Api to check database support and change the path
Summary: Gtk Api to check database support and change the path
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 523.x (Safari 3)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
: 15612 (view as bug list)
Depends on: 27899
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-25 12:25 PDT by Christian Dywan
Modified: 2009-09-07 03:25 PDT (History)
2 users (show)

See Also:


Attachments
A proposal of a possible api (1.66 KB, patch)
2007-10-25 12:31 PDT, Christian Dywan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Dywan 2007-10-25 12:25:05 PDT
The new database storage feature stores databases hidden in the folder $XDG_DATA_HOME/webkit/databases. There is no api to test wether the feature is available at all or to to change the path respectively.
Comment 1 Christian Dywan 2007-10-25 12:31:21 PDT
Created attachment 16863 [details]
A proposal of a possible api

This patch implements webkit_has_database and webkit_set_database_path. This concept is a bit unusual for Gtk+ and not necessarily what we want. Discussion about this is very welcome, especially if you have concrete plans to use this feature.
Comment 2 Jan Alonzo 2007-10-26 14:02:01 PDT
*** Bug 15612 has been marked as a duplicate of this bug. ***
Comment 3 Kalle Vahlman 2008-08-13 10:34:00 PDT
The settings API in WebKit-GTK+ seems to be unsuitable for this, since the path is (as far as I can tell from the code) expected to be a global. There isn't a global version of the settings API (that I know of) but looks like this is at least one instance where we would need one.

One improvement over the current one might be to use g_get_prgname() instead of hard-coded "webkit" in order to not clash between eg. a browser and some other application using WebKit. It's already used in the UA string generation for example, which btw is another candidate for global setting (though maybe that would have use-cases for per-view configuration). Third one I can think of is some cache settings.

I'll refresh the patch to be applyable and move it to webkitprivate.h (there seems to be some other API which is under discussion too), but just to allow people to easily import it if they need the functionality, not for inclusion.
Comment 4 Christian Dywan 2008-08-13 10:47:19 PDT
(In reply to comment #3)
> One improvement over the current one might be to use g_get_prgname() instead of
> hard-coded "webkit" in order to not clash between eg. a browser and some other
> application using WebKit. It's already used in the UA string generation for
> example, which btw is another candidate for global setting (though maybe that
> would have use-cases for per-view configuration). Third one I can think of is
> some cache settings.

I have to disagree with using g_get_prgname(). Usually we want to share things like this. While it should be an optional feature to use for instance databases only in the context of one application, it's not normally very helpful.
Comment 5 Kalle Vahlman 2008-08-13 11:19:01 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > One improvement over the current one might be to use g_get_prgname() instead of
> > hard-coded "webkit" in order to not clash between eg. a browser and some other
> > application using WebKit. It's already used in the UA string generation for
> > example, which btw is another candidate for global setting (though maybe that
> > would have use-cases for per-view configuration). Third one I can think of is
> > some cache settings.
> 
> I have to disagree with using g_get_prgname(). Usually we want to share things
> like this. While it should be an optional feature to use for instance databases
> only in the context of one application, it's not normally very helpful.

Hmm, I suppose you are right. I can imagine for example an music store using the storage area in view embedded in a music application and in a browser session.

Then there's also the question of when this is allowed to be changed? At least it'll ASSERT if a database is open at the time, but does it make any sense to change it after application startup?
Comment 6 Gustavo Noronha (kov) 2009-03-16 07:16:11 PDT
Hey,

(In reply to comment #3)
> I'll refresh the patch to be applyable and move it to webkitprivate.h (there
> seems to be some other API which is under discussion too), but just to allow
> people to easily import it if they need the functionality, not for inclusion.
 
Have you been able to do this work yet? Still plan to do it? =)
Comment 7 Jan Alonzo 2009-05-07 17:05:56 PDT
(In reply to comment #6)
> Hey,
> 
> (In reply to comment #3)
> > I'll refresh the patch to be applyable and move it to webkitprivate.h (there
> > seems to be some other API which is under discussion too), but just to allow
> > people to easily import it if they need the functionality, not for inclusion.
> 
> Have you been able to do this work yet? Still plan to do it? =)

Setting database paths are currently supported in WebCore settings so it might be a good idea to make this a setting (which also make this a per-WebView thing in the API). Apps who want a specific location can just set it to the location they want - and we can just default it to what it is now.

I can cook up a patch if nobody's working on this right now..


Comment 8 Jan Alonzo 2009-05-07 17:51:55 PDT
(In reply to comment #7)
> (In reply to comment #6)
> Setting database paths are currently supported in WebCore settings so it might
> be a good idea to make this a setting (which also make this a per-WebView thing
> in the API). Apps who want a specific location can just set it to the location
> they want - and we can just default it to what it is now.

Correction: setting database paths in Settings is only for localStorage. 
Comment 9 Jan Alonzo 2009-09-07 03:25:59 PDT
You should be able to set the database storage path now that bug #27899 has been fixed.