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

Issue 2585143002: Introduce ContextObserver (Closed)

Created:
4 years ago by haraken
Modified:
4 years ago
Reviewers:
sof, dcheng
CC:
chromium-reviews, eae+blinkwatch, blink-reviews-dom_chromium.org, dglazkov+blink, blink-reviews, rwlbuis
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Introduce ContextObserver There are many ContextLifecycleObservers that want to use getExecutionContext() and frame() but don't need contextDestroyed() notifications. Since ContextLifecycleObserver is heavy, it seems better to introduce a lightweight version of ContextLifecycleObserver that only provides getExecutionContext() and frame(). This CL introduces ContextObserver and uses it in BarProp. ContextObserver can also be used in classes that are currently storing Member<ExecutionContext> or Member<LocalFrame> and using isContextDestroyed() to check if the observing context is alive. BUG=610176 Committed: https://crrev.com/e873a8e81ec1427467406cbb47293afc35dc1e16 Cr-Commit-Position: refs/heads/master@{#439990}

Patch Set 1 #

Total comments: 1

Patch Set 2 : temp #

Total comments: 4

Patch Set 3 : temp #

Total comments: 1

Patch Set 4 : temp #

Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -15 lines) Patch
M third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h View 1 2 3 1 chunk +25 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp View 1 2 1 chunk +19 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/BarProp.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/frame/BarProp.cpp View 1 2 1 chunk +7 lines, -9 lines 0 comments Download

Messages

Total messages: 26 (6 generated)
haraken
PTAL
4 years ago (2016-12-19 02:07:49 UTC) #2
haraken
https://codereview.chromium.org/2585143002/diff/1/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h File third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h (right): https://codereview.chromium.org/2585143002/diff/1/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h#newcode60 third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h:60: Member<ExecutionContext> m_executionContext; I don't think this needs to be ...
4 years ago (2016-12-19 02:09:25 UTC) #3
haraken
On 2016/12/19 02:09:25, haraken wrote: > https://codereview.chromium.org/2585143002/diff/1/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h > File third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h (right): > > https://codereview.chromium.org/2585143002/diff/1/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h#newcode60 > ...
4 years ago (2016-12-19 05:38:45 UTC) #4
dcheng
Is there a lot of overhead to having a contextDestroyed()? Since we've been trying to ...
4 years ago (2016-12-19 07:16:14 UTC) #5
haraken
On 2016/12/19 07:16:14, dcheng wrote: > Is there a lot of overhead to having a ...
4 years ago (2016-12-19 07:31:47 UTC) #6
sof
On 2016/12/19 07:16:14, dcheng wrote: > Is there a lot of overhead to having a ...
4 years ago (2016-12-19 07:31:57 UTC) #7
haraken
Just to clarify, the goal is to unify everything into ContextLifecycleObserver and ContextObserver. Code that ...
4 years ago (2016-12-19 08:10:41 UTC) #8
dcheng
OK, makes sense. I wonder if we can think of a different name than Observer ...
4 years ago (2016-12-19 08:25:26 UTC) #9
haraken
On 2016/12/19 08:25:26, dcheng wrote: > OK, makes sense. I wonder if we can think ...
4 years ago (2016-12-19 08:34:26 UTC) #10
sof
https://codereview.chromium.org/2585143002/diff/20001/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp File third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp (right): https://codereview.chromium.org/2585143002/diff/20001/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp#newcode13 third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp:13: : m_executionContext(frame ? frame->document() : nullptr) {} Can BarProp ...
4 years ago (2016-12-19 09:14:03 UTC) #11
sof
On 2016/12/19 08:34:26, haraken wrote: > On 2016/12/19 08:25:26, dcheng wrote: > > OK, makes ...
4 years ago (2016-12-19 09:15:17 UTC) #12
haraken
https://codereview.chromium.org/2585143002/diff/20001/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp File third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp (right): https://codereview.chromium.org/2585143002/diff/20001/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp#newcode13 third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp:13: : m_executionContext(frame ? frame->document() : nullptr) {} On 2016/12/19 ...
4 years ago (2016-12-19 09:58:16 UTC) #13
haraken
On 2016/12/19 09:15:17, sof wrote: > On 2016/12/19 08:34:26, haraken wrote: > > On 2016/12/19 ...
4 years ago (2016-12-19 09:58:57 UTC) #14
haraken
On 2016/12/19 09:58:57, haraken wrote: > On 2016/12/19 09:15:17, sof wrote: > > On 2016/12/19 ...
4 years ago (2016-12-19 12:51:12 UTC) #15
sof
On 2016/12/19 12:51:12, haraken wrote: > On 2016/12/19 09:58:57, haraken wrote: > > On 2016/12/19 ...
4 years ago (2016-12-19 13:03:44 UTC) #16
dcheng
LGTM with an optional comment nit (my theory is the getters are pretty straightforward and ...
4 years ago (2016-12-20 07:20:43 UTC) #17
haraken
On 2016/12/20 07:20:43, dcheng wrote: > LGTM with an optional comment nit (my theory is ...
4 years ago (2016-12-21 01:18:06 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2585143002/60001
4 years ago (2016-12-21 01:18:59 UTC) #21
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years ago (2016-12-21 03:04:17 UTC) #24
commit-bot: I haz the power
4 years ago (2016-12-21 03:07:38 UTC) #26
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/e873a8e81ec1427467406cbb47293afc35dc1e16
Cr-Commit-Position: refs/heads/master@{#439990}

Powered by Google App Engine
This is Rietveld 408576698