WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
106678
IndexedDB: IDBTransaction should manage lifetime of IDBRequests
https://bugs.webkit.org/show_bug.cgi?id=106678
Summary
IndexedDB: IDBTransaction should manage lifetime of IDBRequests
Joshua Bell
Reported
2013-01-11 10:34:04 PST
IndexedDB: IDBTransaction should manage lifetime of IDBRequests
Attachments
Patch
(3.86 KB, patch)
2013-01-11 10:42 PST
,
Joshua Bell
no flags
Details
Formatted Diff
Diff
Patch
(4.87 KB, patch)
2013-01-11 14:58 PST
,
Joshua Bell
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Joshua Bell
Comment 1
2013-01-11 10:42:24 PST
Created
attachment 182368
[details]
Patch
Joshua Bell
Comment 2
2013-01-11 10:45:20 PST
Speculative fix for possible source of crashes. In IDBObjectStore.cpp it is assumed that the request is kept alive by the owning transaction, but transactions didn't actually do that.
Alec Flett
Comment 3
2013-01-11 11:31:40 PST
Comment on
attachment 182368
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=182368&action=review
> Source/WebCore/Modules/indexeddb/IDBRequest.cpp:82 > + relaxAdoptionRequirement();
Is this because of the iterator, or removal from the m_requestList? Is there any way to call some of the helper methods like removeFirst or remove(iterator it) ?
Joshua Bell
Comment 4
2013-01-11 11:34:02 PST
(In reply to
comment #3
)
> (From update of
attachment 182368
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=182368&action=review
> > > Source/WebCore/Modules/indexeddb/IDBRequest.cpp:82 > > + relaxAdoptionRequirement(); > > Is this because of the iterator, or removal from the m_requestList? Is there any way to call some of the helper methods like removeFirst or remove(iterator it) ?
It on insertion into m_requestList c/o IDBTransaction::registerRequest(), which creates the first RefPtr<> to the request before the IDBRequest's constructor has completed.
Alec Flett
Comment 5
2013-01-11 11:45:40 PST
ah, I see it. LGTM (seems like the proper ownership anyway)
Joshua Bell
Comment 6
2013-01-11 12:22:44 PST
tony@ - can you take a look?
Tony Chang
Comment 7
2013-01-11 14:08:57 PST
Comment on
attachment 182368
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=182368&action=review
>>> Source/WebCore/Modules/indexeddb/IDBRequest.cpp:82 >>> + relaxAdoptionRequirement(); >> >> Is this because of the iterator, or removal from the m_requestList? Is there any way to call some of the helper methods like removeFirst or remove(iterator it) ? > > It on insertion into m_requestList c/o IDBTransaction::registerRequest(), which creates the first RefPtr<> to the request before the IDBRequest's constructor has completed.
Rather than using relaxAdoptionRequirement, could we move the call to transaction->registerRequest() into the IDBRequest::create methods? I think in the long term, we want to remove relaxAdoptionRequirement() from RefCounted.h and it looks like IDB is the only place that uses relaxAdoptionRequirement().
Joshua Bell
Comment 8
2013-01-11 14:58:53 PST
Created
attachment 182423
[details]
Patch
Joshua Bell
Comment 9
2013-01-11 15:01:52 PST
(In reply to
comment #7
)
> Rather than using relaxAdoptionRequirement, could we move the call to transaction->registerRequest() into the IDBRequest::create methods?
Good suggestion - patch updated. (as you noticed...)
> I think in the long term, we want to remove relaxAdoptionRequirement() from RefCounted.h and it looks like IDB is the only place that uses relaxAdoptionRequirement().
Once alecflett@'s current refactor is done we can tackle removing the other uses.
WebKit Review Bot
Comment 10
2013-01-11 16:18:12 PST
Comment on
attachment 182423
[details]
Patch Clearing flags on attachment: 182423 Committed
r139518
: <
http://trac.webkit.org/changeset/139518
>
WebKit Review Bot
Comment 11
2013-01-11 16:18:16 PST
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