[webkit-dev] Odd binding problems

Eric Uhrhane ericu at chromium.org
Mon Feb 22 15:16:06 PST 2010

I'm working on adding JSC bindings so that the Database can be
accessed from Web Workers.  I've got it pretty much working, but I
must be missing something important because I'm getting the following
bad behavior:

If I run the existing database layout tests, they're fine.  If I run
my one new Worker database test, it's fine.
If I run the Worker database test and any other database test, in
either order, the second one I run will fail.  Non-database tests
aren't affected.
The failure is that the object returned from openDatabase lacks
certain properties.  You can convert it to a string ("[object
Database]"), but if you look for e.g. database.transaction or
database.version, they're undefined.  If you try to iterate over its
properties, you assert in PropertyNameArray::add, because the
identifier [in this case "version"], fails the
identifier->isIdentifier() check.

This isn't anything timing-related; I can see all the setup and
teardown of the tests and their threads happening just when I expect
them to happen, in a nicely non-overlapping way.  Likewise I can see
the database being opened correctly.  My bet is I've failed to add
something critical to the bindings, some override for the
idl-generated code that wasn't needed in the DOM bindings but is for
the Worker bindings.  In fact the only binding change I made was to
add the openDatabase call to WorkerContext.idl.  I haven't changed the
bindings for the Database object itself at all.

The changes I've made are backed up on the chromium codereview site:

The bindings and related minor changes: http://codereview.chromium.org/602013
Making the DatabaseTracker thread-safe [needed for this to run]:
One layout test refactored to run in workers as well:

Does this sort of a failure mode ring a bell for anyone?

Thanks for any pointers,

    Eric Uhrhane

More information about the webkit-dev mailing list