Bug 128487

Summary: IDB: storage/indexeddb/mozilla/object-store-remove-values.html fails
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebKit2Assignee: Brady Eidson <beidson>
Status: ASSIGNED ---    
Severity: Normal CC: andersca, ap, commit-queue, sam, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch v1 thorton: review+

Description Brady Eidson 2014-02-08 22:09:49 PST
IDB: storage/indexeddb/mozilla/object-store-remove-values.html fails

The test does a deleteDatabase and then immediately reopens a connection to that same database name.  We don't handle the deleteDatabase cleanup properly in this case.
Comment 1 Radar WebKit Bug Importer 2014-02-10 13:45:43 PST
<rdar://problem/16029319>
Comment 2 Brady Eidson 2014-02-10 13:53:31 PST
Created attachment 223740 [details]
Patch v1
Comment 3 WebKit Commit Bot 2014-02-10 13:56:07 PST
Attachment 223740 [details] did not pass style-queue:


ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:165:  This { should be at the end of the previous line  [whitespace/braces] [4]
Total errors found: 1 in 10 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Tim Horton 2014-02-10 14:05:07 PST
Comment on attachment 223740 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=223740&action=review

> Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:62
> +    if (m_uniqueIDBDatabase)

early return instead?

> Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:166
> +    while (performNextMainThreadTaskWithoutAdoptRef())
> +    {
> +    }

Indentation/brace location looks weird to me.

> Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:79
> +        JSLockHolder lockHolder(JSLockHolder(m_vm.get()));

wut
Comment 5 Mark Hahnenberg 2014-02-10 14:10:26 PST
Comment on attachment 223740 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=223740&action=review

>> Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:79
>> +        JSLockHolder lockHolder(JSLockHolder(m_vm.get()));
> 
> wut

I think you only want one level of JSLockHolder here. It probably works because C++ is auto generating a copy constructor that does something at least somewhat reasonable.

JSLockHolder holder(m_vm.get());

should work.
Comment 6 Brady Eidson 2014-02-10 14:11:38 PST
(In reply to comment #5)
> (From update of attachment 223740 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=223740&action=review
> 
> >> Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:79
> >> +        JSLockHolder lockHolder(JSLockHolder(m_vm.get()));
> > 
> > wut
> 
> I think you only want one level of JSLockHolder here. It probably works because C++ is auto generating a copy constructor that does something at least somewhat reasonable.
> 
> JSLockHolder holder(m_vm.get());
> 
> should work.

You are, of course, very correct.  *sigh*

Just landed in http://trac.webkit.org/changeset/163817 but will followup.
Comment 8 Alexey Proskuryakov 2015-06-03 22:58:13 PDT
Has this been finished? See bug 145623 though.