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

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

Issue 517043003: Move Frame to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Back out non-Oilpan experiment + tidy up by adding frame() ref accessors Created 6 years, 3 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 fd3b11a06ebb8ec1fc2769bc6ff0e219cdc999fb..13e77dfd046e178cc1b8abbd1d4bc3845f8b5443 100644
--- a/Source/core/frame/FrameDestructionObserver.h
+++ b/Source/core/frame/FrameDestructionObserver.h
@@ -26,24 +26,38 @@
#ifndef FrameDestructionObserver_h
#define FrameDestructionObserver_h
+#include "platform/heap/Handle.h"
+
namespace blink {
class LocalFrame;
-class FrameDestructionObserver {
+class FrameDestructionObserver : public WillBeGarbageCollectedMixin {
public:
explicit FrameDestructionObserver(LocalFrame*);
+#if !ENABLE(OILPAN)
+ // Oilpan: there is no known need for directly observing
+ // frameDestroyed() with Oilpan enabled, as its clearing is
+ // handled by keeping a weak reference.
+ //
+ // A weak callback version of frameDestroyed() can be reintroduced
+ // later, should the need arise.
virtual void frameDestroyed();
+#endif
virtual void willDetachFrameHost();
LocalFrame* frame() const { return m_frame; }
+ virtual void trace(Visitor*);
+
protected:
+#if !ENABLE(OILPAN)
virtual ~FrameDestructionObserver();
+#endif
void observeFrame(LocalFrame*);
- LocalFrame* m_frame;
+ RawPtrWillBeWeakMember<LocalFrame> m_frame;
};
}

Powered by Google App Engine
This is Rietveld 408576698