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

Issue 968633002: Simplify lifecycle notifiers and observers. (Closed)

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

Description

Simplify lifecycle notifiers and observers. The following changes are made to the implementation of lifecycle notifiers and observers: - Avoid keeping duplicate hash sets of registered observers. - Let the C++ type system handle type safety of the observer set, letting go of the notion of an 'observer type' which was dynamically checked for. - Extend parameterization of LifecycleNotifier<> and LifecycleObserver<> to more closely couple the notifier and observer pairs. This allows the retirement of the ad-hoc function templates {un}observeContext(). - Devirtualize the add/removeObserver() notifier methods. R=haraken BUG=462949 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=191062

Patch Set 1 #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+168 lines, -263 lines) Patch
M Source/core/dom/ContextLifecycleNotifier.h View 1 chunk +7 lines, -8 lines 4 comments Download
M Source/core/dom/ContextLifecycleNotifier.cpp View 3 chunks +11 lines, -14 lines 0 comments Download
M Source/core/dom/ContextLifecycleObserver.h View 1 chunk +15 lines, -4 lines 0 comments Download
M Source/core/dom/ContextLifecycleObserver.cpp View 1 chunk +3 lines, -11 lines 0 comments Download
M Source/core/dom/Document.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/DocumentLifecycleNotifier.h View 1 chunk +4 lines, -11 lines 0 comments Download
M Source/core/dom/DocumentLifecycleNotifier.cpp View 1 chunk +9 lines, -20 lines 0 comments Download
M Source/core/dom/DocumentLifecycleObserver.h View 1 chunk +6 lines, -5 lines 0 comments Download
M Source/core/dom/DocumentLifecycleObserver.cpp View 1 chunk +2 lines, -11 lines 0 comments Download
M Source/core/dom/ExecutionContext.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/frame/DOMWindowLifecycleNotifier.h View 1 chunk +5 lines, -12 lines 0 comments Download
M Source/core/frame/DOMWindowLifecycleNotifier.cpp View 1 chunk +14 lines, -24 lines 1 comment Download
M Source/core/frame/DOMWindowLifecycleObserver.h View 1 chunk +7 lines, -7 lines 0 comments Download
M Source/core/frame/DOMWindowLifecycleObserver.cpp View 1 chunk +2 lines, -11 lines 0 comments Download
M Source/core/frame/LocalDOMWindow.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/frame/LocalDOMWindow.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/page/Page.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/page/PageLifecycleNotifier.h View 2 chunks +4 lines, -11 lines 0 comments Download
M Source/core/page/PageLifecycleNotifier.cpp View 1 chunk +11 lines, -21 lines 0 comments Download
M Source/core/page/PageLifecycleObserver.h View 1 chunk +7 lines, -8 lines 0 comments Download
M Source/core/page/PageLifecycleObserver.cpp View 1 chunk +2 lines, -14 lines 0 comments Download
M Source/platform/LifecycleContextTest.cpp View 3 chunks +24 lines, -20 lines 0 comments Download
M Source/platform/LifecycleNotifier.h View 4 chunks +22 lines, -24 lines 2 comments Download
M Source/platform/LifecycleObserver.h View 2 chunks +9 lines, -26 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
sof
Please take a look (No rush; suggestions for other folks it'd be good to ask ...
5 years, 9 months ago (2015-02-28 18:47:12 UTC) #2
haraken
This is a great clean-up! LGTM. https://codereview.chromium.org/968633002/diff/1/Source/core/dom/ContextLifecycleNotifier.h File Source/core/dom/ContextLifecycleNotifier.h (right): https://codereview.chromium.org/968633002/diff/1/Source/core/dom/ContextLifecycleNotifier.h#newcode51 Source/core/dom/ContextLifecycleNotifier.h:51: const ActiveDOMObjectSet& activeDOMObjects() ...
5 years, 9 months ago (2015-03-01 09:18:40 UTC) #3
sof
https://codereview.chromium.org/968633002/diff/1/Source/core/dom/ContextLifecycleNotifier.h File Source/core/dom/ContextLifecycleNotifier.h (right): https://codereview.chromium.org/968633002/diff/1/Source/core/dom/ContextLifecycleNotifier.h#newcode51 Source/core/dom/ContextLifecycleNotifier.h:51: const ActiveDOMObjectSet& activeDOMObjects() const { return m_activeDOMObjects; } On ...
5 years, 9 months ago (2015-03-01 10:00:39 UTC) #4
haraken
https://codereview.chromium.org/968633002/diff/1/Source/core/dom/ContextLifecycleNotifier.h File Source/core/dom/ContextLifecycleNotifier.h (right): https://codereview.chromium.org/968633002/diff/1/Source/core/dom/ContextLifecycleNotifier.h#newcode51 Source/core/dom/ContextLifecycleNotifier.h:51: const ActiveDOMObjectSet& activeDOMObjects() const { return m_activeDOMObjects; } On ...
5 years, 9 months ago (2015-03-01 10:47:56 UTC) #5
sof
Thanks for the review. The lifetime objects are of a delicate nature, so I've created ...
5 years, 9 months ago (2015-03-01 17:21:37 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/968633002/1
5 years, 9 months ago (2015-03-01 17:28:49 UTC) #8
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://src.chromium.org/viewvc/blink?view=rev&revision=191062
5 years, 9 months ago (2015-03-01 17:31:50 UTC) #9
sof
5 years, 9 months ago (2015-03-01 17:50:20 UTC) #10
Message was sent while issue was closed.
https://codereview.chromium.org/968633002/diff/1/Source/core/frame/DOMWindowL...
File Source/core/frame/DOMWindowLifecycleNotifier.cpp (right):

https://codereview.chromium.org/968633002/diff/1/Source/core/frame/DOMWindowL...
Source/core/frame/DOMWindowLifecycleNotifier.cpp:60:
static_cast<DOMWindowLifecycleObserver*>(observer)->didRemoveEventListener(window,
eventType);
Will tidy up this redundant cast.

Powered by Google App Engine
This is Rietveld 408576698