Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / frame / FrameDestructionObserver.h
index fd3b11a..a62d202 100644 (file)
 #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;
 };
 
 }