WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
69277
A little more WebSQLDatabase thread safety
https://bugs.webkit.org/show_bug.cgi?id=69277
Summary
A little more WebSQLDatabase thread safety
Michael Nordman
Reported
2011-10-03 12:06:47 PDT
We're getting reports of INVALID_STATE exceptions being throw from the openDatabase method. It looks like there some unsafe initialization code paths that may be the culprit.
Attachments
safer
(12.22 KB, patch)
2011-10-03 12:12 PDT
,
Michael Nordman
no flags
Details
Formatted Diff
Diff
safer
(12.23 KB, patch)
2011-10-03 12:27 PDT
,
Michael Nordman
ap
: commit-queue-
Details
Formatted Diff
Diff
safer
(12.21 KB, patch)
2011-10-03 14:23 PDT
,
Michael Nordman
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Michael Nordman
Comment 1
2011-10-03 12:12:08 PDT
Created
attachment 109505
[details]
safer
WebKit Review Bot
Comment 2
2011-10-03 12:13:46 PDT
Attachment 109505
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/ChangeLog:5: Need whitespace between colon and description [changelog/filechangedescriptionwhitespace] [5] Source/WebCore/ChangeLog:6: Need whitespace between colon and description [changelog/filechangedescriptionwhitespace] [5] Total errors found: 2 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Michael Nordman
Comment 3
2011-10-03 12:27:41 PDT
Created
attachment 109508
[details]
safer made some whitespace changes in the changelog file
Alexey Proskuryakov
Comment 4
2011-10-03 14:11:56 PDT
Comment on
attachment 109508
[details]
safer View in context:
https://bugs.webkit.org/attachment.cgi?id=109508&action=review
I don't understand thread-safe string copying well enough, so leaving this for someone else (Dave Levin?) to review.
> Source/WebCore/storage/AbstractDatabase.cpp:51 > +static const char versionKey[] = "WebKitDatabaseVersionKey";
Is this actually guaranteed to not use initialization, or do you need to use a pointer?
> Source/WebCore/storage/AbstractDatabase.cpp:298 > + const String tableName(infoTableName);
We don't use local const variables in WebKit.
> Source/WebCore/storage/AbstractDatabase.cpp:396 > + const String query(String("SELECT value FROM ") + infoTableName + " WHERE key = '" + versionKey + "';");
We don't use local const variables in WebKit.
> Source/WebCore/storage/AbstractDatabase.cpp:416 > + const String query(String("INSERT INTO ") + infoTableName + " (key, value) VALUES ('" + versionKey + "', ?);");
We don't use local const variables in WebKit.
Michael Nordman
Comment 5
2011-10-03 14:23:49 PDT
Created
attachment 109530
[details]
safer
Michael Nordman
Comment 6
2011-10-03 14:26:11 PDT
> Is this actually guaranteed to not use initialization, or do you need to use a pointer?
Yes, no.
> We don't use local const variables in WebKit.
Done x 3
David Levin
Comment 7
2011-10-03 14:57:17 PDT
Comment on
attachment 109530
[details]
safer View in context:
https://bugs.webkit.org/attachment.cgi?id=109530&action=review
Looks great!
> Source/WebCore/storage/AbstractDatabase.cpp:2 > + * Copyright (C) 2011 Google Inc. All rights reserved.
In WebKit, we leave the year in tact, so this would become 2010, 2011. But you don't need to change this back -- just fyi for future changes.
Michael Nordman
Comment 8
2011-10-03 14:58:47 PDT
thank you good reviewer sir!
WebKit Review Bot
Comment 9
2011-10-03 16:06:43 PDT
Comment on
attachment 109530
[details]
safer Clearing flags on attachment: 109530 Committed
r96554
: <
http://trac.webkit.org/changeset/96554
>
WebKit Review Bot
Comment 10
2011-10-03 16:06:47 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug