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

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

Issue 517043003: Move Frame to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update OilpanExpectations 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/Frame.h
diff --git a/Source/core/frame/Frame.h b/Source/core/frame/Frame.h
index 498cb77c81bfd740d26d1fdc0c02b6131f656796..1e62050c71fa286adfe5c7fad0ed50cbed0283fc 100644
--- a/Source/core/frame/Frame.h
+++ b/Source/core/frame/Frame.h
@@ -34,10 +34,6 @@
#include "wtf/RefCounted.h"
namespace blink {
-class WebLayer;
-}
-
-namespace blink {
class ChromeClient;
class FrameClient;
@@ -48,13 +44,15 @@ class LocalDOMWindow;
class Page;
class RenderPart;
class Settings;
+class WebLayer;
-class Frame : public RefCounted<Frame> {
+class Frame : public RefCountedWillBeGarbageCollectedFinalized<Frame> {
public:
virtual bool isLocalFrame() const { return false; }
virtual bool isRemoteFrame() const { return false; }
virtual ~Frame();
+ virtual void trace(Visitor*);
virtual void detach() = 0;
void detachChildren();
@@ -87,8 +85,8 @@ public:
RenderPart* ownerRenderer() const; // Renderer for the element that contains this frame.
// FIXME: These should move to RemoteFrame when that is instantiated.
- void setRemotePlatformLayer(blink::WebLayer*);
- blink::WebLayer* remotePlatformLayer() const { return m_remotePlatformLayer; }
+ void setRemotePlatformLayer(WebLayer*);
dcheng 2014/09/07 22:26:34 Nit: it would be better to move pure cleanups like
+ WebLayer* remotePlatformLayer() const { return m_remotePlatformLayer; }
Settings* settings() const; // can be null
@@ -98,19 +96,36 @@ public:
// method.
bool isRemoteFrameTemporary() const { return m_remotePlatformLayer; }
+#if ENABLE(OILPAN)
+ bool hasBeenClosed() const { return m_hasBeenClosed; }
+ void setHasBeenClosed() { ASSERT(!m_hasBeenClosed); m_hasBeenClosed = true; }
+#endif
+
protected:
Frame(FrameClient*, FrameHost*, FrameOwner*);
mutable FrameTree m_treeNode;
FrameHost* m_host;
haraken 2014/09/08 07:25:58 This should be Member<FrameHost>.
sof 2014/09/08 21:17:45 Yes, now a traced RawPtrWillBeMember<>.
- FrameOwner* m_owner;
+ RawPtrWillBeMember<FrameOwner> m_owner;
- RefPtrWillBePersistent<LocalDOMWindow> m_domWindow;
+ RefPtrWillBeMember<LocalDOMWindow> m_domWindow;
private:
FrameClient* m_client;
- blink::WebLayer* m_remotePlatformLayer;
+ WebLayer* m_remotePlatformLayer;
+
+ void dispose();
+
+#if ENABLE(OILPAN)
+ // With Oilpan, the closing of a frame from the embedder doesn't
+ // trigger the immediate release of this Frame object (or, to be
+ // precise, when the ref-count drops to zero -- there might be
+ // other references to the Frame. Further up the stack, for
+ // instance.) Hence, a separate closed flag is kept -- consulted
+ // by window.closed.
+ bool m_hasBeenClosed;
+#endif
};
inline FrameClient* Frame::client() const

Powered by Google App Engine
This is Rietveld 408576698