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

Issue 183883005: DatabaseBackend objects should be destructed in the originator thread (Closed)

Created:
6 years, 9 months ago by tkent
Modified:
6 years, 9 months ago
CC:
blink-reviews, kinuko+watch, Nate Chapin, gavinp+loader_chromium.org
Visibility:
Public.

Description

DatabaseBackend objects should be destructed in the originator thread. Before this CL, it was possible that DatabaseThread held the last references of DatabaseBackend objects and it was released in the database thread. We must destruct objects in the originator thread in Oilpan. Implementation: DatabaseThread::recordDatabaseClosed doesn't remove a RefPtr< DatabaseBackend>, and we release RefPtr<DatabaseBackend> objects in ~DatabaseThread, which is executed in the main/worker thread. Note that there are no ways to close a database explicitly, and DatabaseBackend objects are never destructed before their DatabaseContext is stopped. DatabaseThread::recordDatabaseClosed is actually unnecessary. DatabaseThread doesn't know DatabaseBackend open status any longer. We remove DatabaseThread::isDatabaseOpen, and its existing callsites use DatabaseBackend::open() instead. BUG=347902 TEST=none; no visible behavior changes hopefully. R=michaeln@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=168362

Patch Set 1 : #

Patch Set 2 : Delete copy in cleanupDatabaseThread #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -17 lines) Patch
M Source/modules/webdatabase/DatabaseTask.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/webdatabase/DatabaseThread.h View 1 chunk +0 lines, -1 line 0 comments Download
M Source/modules/webdatabase/DatabaseThread.cpp View 1 3 chunks +6 lines, -15 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
tkent
6 years, 9 months ago (2014-03-03 05:51:01 UTC) #1
michaeln
I'm not sure this accomplishes the behavior you want, what about cleanupDatabaseThread()? Also, I'd like ...
6 years, 9 months ago (2014-03-03 19:42:33 UTC) #2
michaeln
also, cc'ing jochen is is pretty familiar with this too
6 years, 9 months ago (2014-03-03 19:43:43 UTC) #3
tkent
On 2014/03/03 19:42:33, michaeln wrote: > I'm not sure this accomplishes the behavior you want, ...
6 years, 9 months ago (2014-03-04 01:03:49 UTC) #4
michaeln
On 2014/03/04 01:03:49, tkent wrote: > On 2014/03/03 19:42:33, michaeln wrote: > > I'm not ...
6 years, 9 months ago (2014-03-04 01:16:02 UTC) #5
tkent
> Can you explain to me how this prevents DatabaseBackend destruction in > cleanupDatabaseThread? Please ...
6 years, 9 months ago (2014-03-04 01:19:23 UTC) #6
tkent
On 2014/03/04 01:19:23, tkent wrote: > > Can you explain to me how this prevents ...
6 years, 9 months ago (2014-03-04 01:29:22 UTC) #7
michaeln
Ok, now the patch makes more sense to me :) lgtm pending green'ness
6 years, 9 months ago (2014-03-04 01:42:52 UTC) #8
tkent
Thanks!
6 years, 9 months ago (2014-03-04 01:46:31 UTC) #9
tkent
The CQ bit was checked by tkent@chromium.org
6 years, 9 months ago (2014-03-04 03:09:45 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tkent@chromium.org/183883005/100001
6 years, 9 months ago (2014-03-04 03:10:29 UTC) #11
tkent
Committed patchset #2 manually as r168362 (presubmit successful).
6 years, 9 months ago (2014-03-04 05:26:42 UTC) #12
tkent
I realized this change was unnecessary. Reverting.
6 years, 9 months ago (2014-03-05 04:58:37 UTC) #13
tkent
6 years, 9 months ago (2014-03-05 04:59:03 UTC) #14
Message was sent while issue was closed.
A revert of this CL has been created in
https://codereview.chromium.org/178103007/ by tkent@chromium.org.

The reason for reverting is: Unnecessary change
.

Powered by Google App Engine
This is Rietveld 408576698