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

Unified Diff: Source/platform/LifecycleObserver.h

Issue 1024543004: Disallow adding ContextLifecycleObservers during iteration. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tidier LifecycleObserver ctor Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/LifecycleNotifier.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/LifecycleObserver.h
diff --git a/Source/platform/LifecycleObserver.h b/Source/platform/LifecycleObserver.h
index 6637428da094e1f927fe49f5baeec6b75879bacb..f1d6f788fce07a135cc5580d9878a3c79b5729a4 100644
--- a/Source/platform/LifecycleObserver.h
+++ b/Source/platform/LifecycleObserver.h
@@ -37,11 +37,6 @@ class LifecycleObserver : public WillBeGarbageCollectedMixin {
public:
using Context = T;
- LifecycleObserver()
- : m_lifecycleContext(nullptr)
- {
- }
-
#if !ENABLE(OILPAN)
virtual ~LifecycleObserver()
{
@@ -64,6 +59,12 @@ public:
void clearLifecycleContext() { m_lifecycleContext = nullptr; }
protected:
+ explicit LifecycleObserver(Context* context)
+ : m_lifecycleContext(nullptr)
+ {
+ setContext(context);
+ }
+
void setContext(Context*);
private:
« no previous file with comments | « Source/platform/LifecycleNotifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698