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

Issue 1745933002: Replace ActiveDOMObjects in modules/indexeddb/ with ContextLifecycleObservers (Closed)

Created:
4 years, 9 months ago by haraken
Modified:
4 years, 1 month ago
Reviewers:
sof, jsbell
CC:
chromium-reviews, blink-reviews, jsbell+idb_chromium.org, cmumford
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Replace ActiveDOMObjects in modules/indexeddb/ with ContextLifecycleObservers Per the plan described in https://groups.google.com/a/chromium.org/d/topic/blink-dev/UwRGJgLBElo/discussion, this CL replaces ActiveDOMObjects in modules/mediastream/ with ContextLifecycleObservers. m_contextStopped is equivalent with !executionContext(). So this CL removes m_contextStopped. BUG=589507

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -77 lines) Patch
M third_party/WebKit/Source/modules/indexeddb/IDBDatabase.h View 4 chunks +3 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp View 8 chunks +9 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp View 4 chunks +4 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/modules/indexeddb/IDBRequest.h View 4 chunks +3 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp View 12 chunks +13 lines, -19 lines 0 comments Download
M third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h View 4 chunks +3 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp View 10 chunks +14 lines, -23 lines 1 comment Download

Messages

Total messages: 11 (3 generated)
haraken
PTAL
4 years, 9 months ago (2016-02-29 08:25:51 UTC) #2
haraken
Looks like the bots are not happy -- will take a look tomorrow.
4 years, 9 months ago (2016-02-29 11:22:23 UTC) #5
jsbell
IIRC some of the `if (m_contextDestroyed) return;` guards are because the notification order is indeterminate, ...
4 years, 9 months ago (2016-02-29 18:35:44 UTC) #6
sof
https://codereview.chromium.org/1745933002/diff/1/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp File third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp (right): https://codereview.chromium.org/1745933002/diff/1/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp#newcode383 third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp:383: abort(IGNORE_EXCEPTION); afaict, the abort() call here used to be ...
4 years, 9 months ago (2016-03-01 07:04:26 UTC) #7
haraken
On 2016/03/01 07:04:26, sof wrote: > https://codereview.chromium.org/1745933002/diff/1/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp > File third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp (right): > > https://codereview.chromium.org/1745933002/diff/1/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp#newcode383 > ...
4 years, 9 months ago (2016-03-01 07:05:46 UTC) #8
sof
On 2016/03/01 07:05:46, haraken wrote: > On 2016/03/01 07:04:26, sof wrote: > > > https://codereview.chromium.org/1745933002/diff/1/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp ...
4 years, 9 months ago (2016-03-01 07:37:22 UTC) #9
haraken
On 2016/03/01 07:37:22, sof wrote: > On 2016/03/01 07:05:46, haraken wrote: > > On 2016/03/01 ...
4 years, 9 months ago (2016-03-01 08:06:18 UTC) #10
haraken
4 years, 9 months ago (2016-03-01 09:40:26 UTC) #11
On 2016/03/01 08:06:18, haraken wrote:
> On 2016/03/01 07:37:22, sof wrote:
> > On 2016/03/01 07:05:46, haraken wrote:
> > > On 2016/03/01 07:04:26, sof wrote:
> > > >
> > >
> >
>
https://codereview.chromium.org/1745933002/diff/1/third_party/WebKit/Source/m...
> > > > File third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp
> (right):
> > > > 
> > > >
> > >
> >
>
https://codereview.chromium.org/1745933002/diff/1/third_party/WebKit/Source/m...
> > > > third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp:383:
> > > > abort(IGNORE_EXCEPTION);
> > > > afaict, the abort() call here used to be a no-op. It no longer is as
> > > > executionContext() isn't cleared by the time contextDestroyed()
> > notifications
> > > > run.
> > > 
> > > Yes, that's the problem. I'm now trying to explicitly clear
> > LifecycleObserver's
> > > context in contextDestroyed()
(https://codereview.chromium.org/1752693002),
> > but
> > > a couple of tests are failing.
> > 
> > I seem to vaguely remember something like that being attempted while shaking
> up
> > lifecycle notifier/observer handling some time ago. As part of your series
of
> > improvements, if you want/need to go digging for potential clues.
> 
> Yeah, I think this needs to be fixed.
> 
> We already have a bunch of code that checks 'if(!executionContext())'.
Currently
> the behavior depends on the timing when a GC is triggered and collects the
> ContextLifecycleObserver, which is not nice.

I played around it for a while and realized that this is not as easy work as I
expected. There are many classes that inherit from ContextLifecycleObserver with
an assumption that ContextLifecycleObserver::m_context is never null. Those
classes should stop using ContextLifecycleObserver and instead just hold
Member<ExecutionContext>.

Also there are a lot of code that depends on the weak processing on
ContextLifecycleObserver::m_context (i.e., if(!executionContext())). To make the
behavior deterministic, we should clear the m_context explicitly, but it will
break classes that put the above assumption.

Hmm.

Powered by Google App Engine
This is Rietveld 408576698