[Webkit-unassigned] [Bug 27899] [Gtk] Expose a database API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Aug 30 23:11:04 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=27899





--- Comment #10 from Martin Robinson <martin.james.robinson at gmail.com>  2009-08-30 23:11:03 PDT ---
(In reply to comment #9)

Thanks for the feedback. I have a few comments below and should be able to
submit another patch soon fixing the other issues.

> (From update of attachment 38795 [details])
> > +    WebKitSecurityOrigin* origin = webkit_web_frame_get_origin(webFrame);
> > +    WebKitWebDatabase* webDatabase = webkit_web_database_from_security_origin(origin, databaseName.utf8().data());
> > +    g_signal_emit_by_name(webView, "database-quota-exceeded", webFrame, webDatabase);
> 
> I am not sure we need this signal, though it may be good for convenience, one
> could just watch a usage property to see if it's past the quota, I guess.

This signal is for parity with other ports' delegates and it's needed by DRT.
I'm not sure if there is a good way to track database usage as a GObject
property with the current WebCore API, but I could be wrong.

> > +        gchar* protocol;
> Does the spec say protocol, or scheme?

The property accessor on the WebCore SecurityOrigin object calls it protocol,
so I'll try to make sure that's used everywhere.

> > +        g_free(priv->protocol);
> > +        priv->protocol = g_strdup(protocol.utf8().data());
> > +        return priv->protocol;
> 
> I don't see much point in using g_free/g_strdup here. Since it's const, just
> use return protocol.utf8().data(), perhaps? Is there a problem you noticed with
> doing that?

Hmm. Seems that utf8() returned a fresh CString every time. If so, the
destructor for that object will be called after that line. Perhaps the text
data is stored in some buffer outside the CString as well, but can we really
depend on that happening? I used this particular pattern, because it was used
for webkit_web_frame_get_name.

> > + * WebKit uses SQLite to create and access the local SQL databases. The location
> > + * of a #WebKitWebDatabase can be accessed wth #webkit_web_database_get_path.
> > + * You can configure the location of all databases with
> > + * #webkit_set_database_directory_path.
> 
> That's pretty inconsistent. I do think these two should be
> webkit_get/set_web_database_path, since they are not acting on a specific
> web_database, or are they?

The first gets the full path to the SQLite file for the database and the latter
gets the path to the parent directory for all SQLite web database files.
Perhaps there is a way I can clarify this?

> > +     /**
> > +      * WebKitWebDatabase:path:
> > +      *
> > +      * The filesystem path of the Web Database database.
> 
> The path of the specific file? I am not sure what this property is supposed to
> represent. It looks like we would want a filename here, that would be joined
> with the global databases directory obtained by a webkit_get_web_database_path
> call.

We may have to return the full path. I'm not sure the API exposes the way to
get from /path/to/all/databases to
/path/to/all/databases/various/subdirectories/0000000000000002.db-journal.
Subdirectories are used to separate database files by origin. I'll try to
improve the doc here though.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list