[webkit-reviews] review granted: [Bug 225855] Avoid more String creations when preparing SQLite statements : [Attachment 428802] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 17 09:30:14 PDT 2021


Alex Christensen <achristensen at apple.com> has granted Chris Dumez
<cdumez at apple.com>'s request for review:
Bug 225855: Avoid more String creations when preparing SQLite statements
https://bugs.webkit.org/show_bug.cgi?id=225855

Attachment 428802: Patch

https://bugs.webkit.org/attachment.cgi?id=428802&action=review




--- Comment #6 from Alex Christensen <achristensen at apple.com> ---
Comment on attachment 428802
  --> https://bugs.webkit.org/attachment.cgi?id=428802
Patch

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

> Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:136
> +    return "CREATE TABLE Records (objectStoreID INTEGER NOT NULL ON CONFLICT
FAIL, key TEXT COLLATE IDBKEY NOT NULL ON CONFLICT FAIL, value NOT NULL ON
CONFLICT FAIL, recordID INTEGER PRIMARY KEY)"_s;

We could use the preprocessor to put the common parts of this in one place.

> Source/WebCore/workers/service/server/RegistrationDatabase.cpp:73
>  static const String recordsTableSchemaAlternate()

It looks like this can be an ASCIILiteral too.

> Source/WebCore/workers/service/server/RegistrationDatabase.cpp:76
> +	   "key TEXT NOT NULL ON CONFLICT FAIL UNIQUE ON CONFLICT REPLACE"

ditto on the duplicate code.  preprocessor


More information about the webkit-reviews mailing list