Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Issue 596083005: DatabaseBackend should not post a task to an already terminated database thread (Closed)

Created:
6 years, 3 months ago by haraken
Modified:
6 years, 3 months ago
CC:
blink-reviews, mkwst+moarreviews_chromium.org
Project:
blink
Visibility:
Public.

Description

DatabaseBackend should not post a task to an already terminated database thread Currently some methods of DatabaseBackend post a task to a database thread without checking DatabaseThread::terminationRequested(). Consequently, the task can be posted to an already terminated database thread. This is problematic but by accident isn't currently causing any real issue (for some reason). This begins to cause an issue when I destruct DatabaseThread::m_thread promptly after the database thread processed a cleanup task (See https://codereview.chromium.org/589363002). This CL adds the necessary DatabaseThread::terminationRequested()s before DatabaseBackend posts a task to the database thread. BUG=340522 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=182552 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=182593

Patch Set 1 #

Total comments: 3

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 1

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -28 lines) Patch
M Source/modules/webdatabase/Database.cpp View 1 2 3 5 chunks +6 lines, -7 lines 0 comments Download
M Source/modules/webdatabase/DatabaseContext.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M Source/modules/webdatabase/DatabaseContext.cpp View 1 2 3 4 5 2 chunks +6 lines, -1 line 0 comments Download
M Source/modules/webdatabase/DatabaseTask.h View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M Source/modules/webdatabase/DatabaseThread.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/webdatabase/DatabaseThread.cpp View 1 2 3 2 chunks +2 lines, -7 lines 0 comments Download
M Source/platform/TaskSynchronizer.h View 1 chunk +0 lines, -8 lines 0 comments Download
M Source/platform/TaskSynchronizer.cpp View 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 27 (9 generated)
haraken
PTAL
6 years, 3 months ago (2014-09-24 01:04:34 UTC) #2
haraken
https://codereview.chromium.org/596083005/diff/1/Source/modules/webdatabase/DatabaseThread.cpp File Source/modules/webdatabase/DatabaseThread.cpp (right): https://codereview.chromium.org/596083005/diff/1/Source/modules/webdatabase/DatabaseThread.cpp#newcode155 Source/modules/webdatabase/DatabaseThread.cpp:155: ASSERT(!terminationRequested()); This is a stronger (more straightforward) way to ...
6 years, 3 months ago (2014-09-24 01:06:28 UTC) #3
tkent
lgtm https://codereview.chromium.org/596083005/diff/1/Source/modules/webdatabase/DatabaseBackend.cpp File Source/modules/webdatabase/DatabaseBackend.cpp (right): https://codereview.chromium.org/596083005/diff/1/Source/modules/webdatabase/DatabaseBackend.cpp#newcode263 Source/modules/webdatabase/DatabaseBackend.cpp:263: if (!databaseContext()->databaseThread() || databaseContext()->databaseThread()->terminationRequested()) We should have DatabaseContext::databaseThreadIsAvailable() ...
6 years, 3 months ago (2014-09-24 02:14:04 UTC) #4
haraken
https://codereview.chromium.org/596083005/diff/1/Source/modules/webdatabase/DatabaseBackend.cpp File Source/modules/webdatabase/DatabaseBackend.cpp (right): https://codereview.chromium.org/596083005/diff/1/Source/modules/webdatabase/DatabaseBackend.cpp#newcode263 Source/modules/webdatabase/DatabaseBackend.cpp:263: if (!databaseContext()->databaseThread() || databaseContext()->databaseThread()->terminationRequested()) On 2014/09/24 02:14:04, tkent (high ...
6 years, 3 months ago (2014-09-24 02:23:18 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/596083005/20001
6 years, 3 months ago (2014-09-24 02:25:01 UTC) #7
commit-bot: I haz the power
Failed to apply patch for Source/modules/webdatabase/DatabaseBackend.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; can't find ...
6 years, 3 months ago (2014-09-24 03:37:05 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/596083005/40001
6 years, 3 months ago (2014-09-24 03:48:08 UTC) #11
commit-bot: I haz the power
Failed to apply patch for Source/modules/webdatabase/DatabaseBackend.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; can't find ...
6 years, 3 months ago (2014-09-24 03:48:16 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/596083005/60001
6 years, 3 months ago (2014-09-24 03:56:11 UTC) #15
commit-bot: I haz the power
Committed patchset #4 (id:60001) as 182552
6 years, 3 months ago (2014-09-24 05:03:40 UTC) #16
Mads Ager (chromium)
A revert of this CL (patchset #4 id:60001) has been created in https://codereview.chromium.org/593423002/ by ager@chromium.org. ...
6 years, 3 months ago (2014-09-24 06:42:15 UTC) #17
haraken
On 2014/09/24 06:42:15, Mads Ager (chromium) wrote: > A revert of this CL (patchset #4 ...
6 years, 3 months ago (2014-09-24 10:42:40 UTC) #18
haraken
Mads: Let me reland this (with a small fix). Feel free to revert this if ...
6 years, 3 months ago (2014-09-24 10:51:57 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/596083005/100001
6 years, 3 months ago (2014-09-24 10:52:59 UTC) #21
Mads Ager (chromium)
On 2014/09/24 10:51:57, haraken wrote: > Mads: Let me reland this (with a small fix). ...
6 years, 3 months ago (2014-09-24 10:53:33 UTC) #22
Mads Ager (chromium)
On 2014/09/24 10:53:33, Mads Ager (chromium) wrote: > On 2014/09/24 10:51:57, haraken wrote: > > ...
6 years, 3 months ago (2014-09-24 11:45:04 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/596083005/100001
6 years, 3 months ago (2014-09-24 11:45:42 UTC) #26
commit-bot: I haz the power
6 years, 3 months ago (2014-09-24 12:00:58 UTC) #27
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as 182593

Powered by Google App Engine
This is Rietveld 408576698