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

Unified Diff: Source/core/frame/FrameDestructionObserver.h

Issue 1017313002: Simplify handling of LocalFrame lifecycle notifications. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: clear context on FDO::contextDestroyed() 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
Index: Source/core/frame/FrameDestructionObserver.h
diff --git a/Source/core/frame/FrameDestructionObserver.h b/Source/core/frame/FrameDestructionObserver.h
index 3337ceb99d350b0de8e5249efbf4ab0ef6d2ee12..a9db185567883851491311913645a99aa8b04e3f 100644
--- a/Source/core/frame/FrameDestructionObserver.h
+++ b/Source/core/frame/FrameDestructionObserver.h
@@ -26,32 +26,27 @@
#ifndef FrameDestructionObserver_h
#define FrameDestructionObserver_h
+#include "core/frame/LocalFrame.h"
+#include "platform/LifecycleObserver.h"
#include "platform/heap/Handle.h"
namespace blink {
class LocalFrame;
+class LocalFrameLifecycleNotifier;
-class FrameDestructionObserver : public WillBeGarbageCollectedMixin {
+class FrameDestructionObserver : public LifecycleObserver<LocalFrame, FrameDestructionObserver, LocalFrameLifecycleNotifier> {
haraken 2015/03/19 23:42:00 Would it make sense to rename FrameDestructionObse
sof 2015/03/20 06:22:05 I think it makes sense to be consistent, but will
public:
- virtual void frameDestroyed();
virtual void willDetachFrameHost();
+ virtual void contextDestroyed()
+ {
+ setContext(nullptr);
+ }
- LocalFrame* frame() const { return m_frame; }
-
- DECLARE_VIRTUAL_TRACE();
+ LocalFrame* frame() const { return lifecycleContext(); }
protected:
explicit FrameDestructionObserver(LocalFrame*);
-
-#if !ENABLE(OILPAN)
- virtual ~FrameDestructionObserver();
-#endif
-
- void observeFrame(LocalFrame*);
-
-private:
- RawPtrWillBeMember<LocalFrame> m_frame;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698