Bug 126099

Summary: DatabaseProcess: Implement version changing
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebKit2Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: alecflett, andersca, ap, commit-queue, jsbell, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 124521    
Attachments:
Description Flags
Patch v1 sam: review+

Description Brady Eidson 2013-12-20 17:40:38 PST
DatabaseProcess: Implement version changing

This includes some WebCore tweaks, moving responsibilities currently in the LevelDB implementation that belong in the cross platform backend.
Comment 1 Brady Eidson 2013-12-20 17:50:28 PST
Created attachment 219818 [details]
Patch v1
Comment 2 WebKit Commit Bot 2013-12-20 17:52:27 PST
Attachment 219818 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp', u'Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp', u'Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.h', u'Source/WebCore/Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp', u'Source/WebKit2/ChangeLog', u'Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp', u'Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h', u'Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in', u'Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp', u'Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h', u'Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h', u'Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.cpp', u'Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h', u'Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp', u'Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h', u'Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp', u'Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h', u'Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in', '--commit-queue']" exit_code: 1
ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:303:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:33:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp:180:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 3 in 18 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Joseph Pecoraro 2013-12-20 18:33:38 PST
Comment on attachment 219818 [details]
Patch v1

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

> Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:307
> +        completionCallback(IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Unknown error occured changing database version"));

When there is a "literal string" that turns into a WTF::String you can use ASCIILiteral("literal") for more efficient construction:
<http://trac.webkit.org/wiki/EfficientStrings>

You could do that here with error strings and SQLStatements, since that constructor also takes WTF::String and not a char*.
Comment 4 Brady Eidson 2013-12-20 22:40:29 PST
(In reply to comment #3)
> (From update of attachment 219818 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=219818&action=review
> 
> > Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:307
> > +        completionCallback(IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Unknown error occured changing database version"));
> 
> When there is a "literal string" that turns into a WTF::String you can use ASCIILiteral("literal") for more efficient construction:
> <http://trac.webkit.org/wiki/EfficientStrings>
> 
> You could do that here with error strings and SQLStatements, since that constructor also takes WTF::String and not a char*.

Sure, sometimes I remember this and sometimes I forget.  Easy to forget when nobody else using a coding pattern (SQLite code) has done it before.

Last time this came up in a review I lamented that style bot doesn't capture it.  I know it's just a python script and doesn't understand the underlying C++...  but anything that *CAN* be statically caught in a review *SHOULD* be automatically caught.

So I filed https://bugs.webkit.org/show_bug.cgi?id=126112
Comment 5 Brady Eidson 2013-12-25 16:25:46 PST
http://trac.webkit.org/changeset/161076