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

Issue 198793003: Oilpan: Prepare to move SQLTransactionBackendSync and SQLTransactionSync to Oilpan heap. (Closed)

Created:
6 years, 9 months ago by tkent
Modified:
6 years, 9 months ago
CC:
blink-reviews
Visibility:
Public.

Description

Oilpan: Prepare to move SQLTransactionBackendSync and SQLTransactionSync to Oilpan heap. We need to rollback a transaction if SQLTransactionBackendSync is dying and its transaction is in progress. However Oilpan architecture doesn't allow us to touch associated DatabaseSync in ~SQLTransactionBackendSync. This CL adds a PersistentHeapHashMap<WeakMember<T>, U> to DatabaseSync to manage SQLTransactionSync, and it makes possible to call SQLTransactionSync::rollbackIfInProgress before the destruction. Note: - m_database->executionContext() can be null in some functions because on-heap objects can live after dissociation of ExecutionContext. - Change the argument of DatabaseSync::rollbackTransaction to a reference because PassRefPtr is unnecessary here and the argument is always non-null. BUG=347902 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=169428

Patch Set 1 #

Patch Set 2 : DatabaseSync owns observers. #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -16 lines) Patch
M Source/modules/webdatabase/DatabaseSync.h View 1 2 chunks +15 lines, -1 line 4 comments Download
M Source/modules/webdatabase/DatabaseSync.cpp View 1 4 chunks +21 lines, -7 lines 3 comments Download
M Source/modules/webdatabase/SQLTransactionBackendSync.h View 1 2 chunks +4 lines, -2 lines 3 comments Download
M Source/modules/webdatabase/SQLTransactionBackendSync.cpp View 1 2 chunks +18 lines, -3 lines 2 comments Download
M Source/modules/webdatabase/SQLTransactionSync.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/webdatabase/SQLTransactionSync.cpp View 1 2 chunks +3 lines, -2 lines 0 comments Download
M Source/modules/webdatabase/SQLTransactionSync.idl View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
tkent
6 years, 9 months ago (2014-03-14 07:23:33 UTC) #1
zerny-chromium
Hi Kent. Erik and I have discussed the CL locally and suggest using something like: ...
6 years, 9 months ago (2014-03-14 10:42:24 UTC) #2
tkent
On 2014/03/14 10:42:24, zerny-chromium wrote: > Hi Kent. > > Erik and I have discussed ...
6 years, 9 months ago (2014-03-17 02:30:44 UTC) #3
zerny-chromium
I think we can allocate the set as part of the database object and avoid ...
6 years, 9 months ago (2014-03-17 09:21:23 UTC) #4
tkent
On 2014/03/17 09:21:23, zerny-chromium wrote: > I think we can allocate the set as part ...
6 years, 9 months ago (2014-03-17 12:54:28 UTC) #5
zerny-chromium
> If we allow to use Persistent members in an on-heap class, making an observer ...
6 years, 9 months ago (2014-03-17 13:08:02 UTC) #6
tkent
On 2014/03/17 13:08:02, zerny-chromium wrote: > > If we allow to use Persistent members in ...
6 years, 9 months ago (2014-03-18 06:31:35 UTC) #7
Mads Ager (chromium)
LGTM! Thanks for iterating on this. I like the final result. :)
6 years, 9 months ago (2014-03-18 07:38:32 UTC) #8
zerny-chromium
LGTM too!
6 years, 9 months ago (2014-03-18 07:40:20 UTC) #9
tkent
The CQ bit was checked by tkent@chromium.org
6 years, 9 months ago (2014-03-18 07:47:12 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/198793003/20001
6 years, 9 months ago (2014-03-18 07:47:14 UTC) #11
Vyacheslav Egorov (Google)
lgtm https://codereview.chromium.org/198793003/diff/20001/Source/modules/webdatabase/SQLTransactionBackendSync.cpp File Source/modules/webdatabase/SQLTransactionBackendSync.cpp (right): https://codereview.chromium.org/198793003/diff/20001/Source/modules/webdatabase/SQLTransactionBackendSync.cpp#newcode246 Source/modules/webdatabase/SQLTransactionBackendSync.cpp:246: // This can be called during GC. Do ...
6 years, 9 months ago (2014-03-18 07:54:54 UTC) #12
commit-bot: I haz the power
Change committed as 169428
6 years, 9 months ago (2014-03-18 08:08:45 UTC) #13
haraken
https://codereview.chromium.org/198793003/diff/20001/Source/modules/webdatabase/DatabaseSync.cpp File Source/modules/webdatabase/DatabaseSync.cpp (right): https://codereview.chromium.org/198793003/diff/20001/Source/modules/webdatabase/DatabaseSync.cpp#newcode200 Source/modules/webdatabase/DatabaseSync.cpp:200: m_observers.add(&transaction, adoptPtr(new TransactionObserver(transaction))); Who removes an item from m_observers? ...
6 years, 9 months ago (2014-03-18 09:59:08 UTC) #14
zerny-chromium
https://codereview.chromium.org/198793003/diff/20001/Source/modules/webdatabase/DatabaseSync.cpp File Source/modules/webdatabase/DatabaseSync.cpp (right): https://codereview.chromium.org/198793003/diff/20001/Source/modules/webdatabase/DatabaseSync.cpp#newcode200 Source/modules/webdatabase/DatabaseSync.cpp:200: m_observers.add(&transaction, adoptPtr(new TransactionObserver(transaction))); On 2014/03/18 09:59:09, haraken wrote: > ...
6 years, 9 months ago (2014-03-18 10:09:08 UTC) #15
haraken
Now I understand how the persistent weak hash map is working :) LGTM. https://codereview.chromium.org/198793003/diff/20001/Source/modules/webdatabase/DatabaseSync.cpp File ...
6 years, 9 months ago (2014-03-18 11:31:33 UTC) #16
tkent
6 years, 9 months ago (2014-03-19 04:58:38 UTC) #17
Message was sent while issue was closed.
https://codereview.chromium.org/198793003/diff/20001/Source/modules/webdataba...
File Source/modules/webdatabase/DatabaseSync.h (right):

https://codereview.chromium.org/198793003/diff/20001/Source/modules/webdataba...
Source/modules/webdatabase/DatabaseSync.h:92:
PersistentHeapHashMap<WeakMember<SQLTransactionSync>,
OwnPtr<TransactionObserver> > m_observers;
On 2014/03/18 11:31:33, haraken wrote:
> On 2014/03/18 10:09:09, zerny-chromium wrote:
> > On 2014/03/18 09:59:09, haraken wrote:
> > > 
> > > I'd like to have a comment about why this needs to be persistent.
> > 
> > I think the bug report provides sufficient documentation here.
> 
> I want to have a comment about the threading issue of this specific case. I
> couldn't get it until mads explained it in the issue tracker :)

I'll add a comment.

https://codereview.chromium.org/198793003/diff/20001/Source/modules/webdataba...
File Source/modules/webdatabase/SQLTransactionBackendSync.h (right):

https://codereview.chromium.org/198793003/diff/20001/Source/modules/webdataba...
Source/modules/webdatabase/SQLTransactionBackendSync.h:56: void trace(Visitor*);
On 2014/03/18 09:59:09, haraken wrote:
> 
> Shall we make this virtual and override it in SQLTransactionSync?

I object to add such override.  It would look very silly according to common
sense of C++.
blink_gc_plugin can catch missing trace even if there are no overrides, right?

http://www.chromium.org/developers/blink-gc-plugin-errors

Powered by Google App Engine
This is Rietveld 408576698