Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / frame / RemoteFrameView.h
index 614e3a5..ecce68a 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "platform/Widget.h"
 #include "platform/geometry/IntRect.h"
+#include "platform/heap/Handle.h"
 
 namespace blink {
 
@@ -20,7 +21,11 @@ public:
 
     virtual bool isRemoteFrameView() const OVERRIDE { return true; }
 
-    RemoteFrame& frame() const { return *m_remoteFrame; }
+    RemoteFrame& frame() const
+    {
+        ASSERT(m_remoteFrame);
+        return *m_remoteFrame;
+    }
 
     // Override to notify remote frame that its viewport size has changed.
     virtual void frameRectsChanged() OVERRIDE;
@@ -32,7 +37,10 @@ public:
 private:
     explicit RemoteFrameView(RemoteFrame*);
 
-    RefPtr<RemoteFrame> m_remoteFrame;
+    // The RefPtrWillBePersistent-cycle between RemoteFrame and its RemoteFrameView
+    // is broken in the same manner as FrameView::m_frame and LocalFrame::m_view is.
+    // See the FrameView::m_frame comment.
+    RefPtrWillBePersistent<RemoteFrame> m_remoteFrame;
 };
 
 DEFINE_TYPE_CASTS(RemoteFrameView, Widget, widget, widget->isRemoteFrameView(), widget.isRemoteFrameView());