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

Unified Diff: Source/web/WebRemoteFrameImpl.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/web/WebRemoteFrameImpl.h
diff --git a/Source/web/WebRemoteFrameImpl.h b/Source/web/WebRemoteFrameImpl.h
index 5a9ab49b9e49661f8aa9a5034b90ff288ed42f69..2e377a340d5ec0ce731389eece266f2b4ed18c1d 100644
--- a/Source/web/WebRemoteFrameImpl.h
+++ b/Source/web/WebRemoteFrameImpl.h
@@ -5,6 +5,7 @@
#ifndef WebRemoteFrameImpl_h
#define WebRemoteFrameImpl_h
+#include "platform/heap/Handle.h"
#include "public/web/WebRemoteFrame.h"
#include "public/web/WebRemoteFrameClient.h"
#include "web/RemoteFrameClient.h"
@@ -17,10 +18,11 @@ namespace blink {
class FrameHost;
class FrameOwner;
class RemoteFrame;
+class WebViewImpl;
-class WebRemoteFrameImpl : public WebRemoteFrame, public RefCounted<WebRemoteFrameImpl> {
+class WebRemoteFrameImpl FINAL : public RefCountedWillBeGarbageCollectedFinalized<WebRemoteFrameImpl>, public WebRemoteFrame {
public:
- WebRemoteFrameImpl(WebRemoteFrameClient*);
+ explicit WebRemoteFrameImpl(WebRemoteFrameClient*);
virtual ~WebRemoteFrameImpl();
// WebRemoteFrame methods.
@@ -178,19 +180,34 @@ public:
void initializeCoreFrame(FrameHost*, FrameOwner*, const AtomicString& name);
- void setCoreFrame(PassRefPtr<RemoteFrame>);
+ void setCoreFrame(PassRefPtrWillBeRawPtr<RemoteFrame>);
RemoteFrame* frame() const { return m_frame.get(); }
WebRemoteFrameClient* client() const { return m_client; }
static WebRemoteFrameImpl* fromFrame(RemoteFrame&);
+ virtual void trace(Visitor*);
+
private:
RemoteFrameClient m_frameClient;
- RefPtr<RemoteFrame> m_frame;
+ RefPtrWillBeMember<RemoteFrame> m_frame;
WebRemoteFrameClient* m_client;
- HashMap<WebFrame*, OwnPtr<FrameOwner> > m_ownersForChildren;
+ WebViewImpl* viewImpl() const;
+
+ WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner> > m_ownersForChildren;
+
+#if ENABLE(OILPAN)
+ // Oilpan: to provide the guarantee of having the frame live until
+ // close() is called, an instance keep a self-persistent. It is
+ // cleared upon calling close(). This avoids having to assume that
+ // an embedder's WebFrame references are all discovered via thread
+ // state (stack, registers) should an Oilpan GC strike while we're
+ // in the process of detaching.
+ GC_PLUGIN_IGNORE("340522")
+ Persistent<WebRemoteFrameImpl> m_selfKeepAlive;
+#endif
};
DEFINE_TYPE_CASTS(WebRemoteFrameImpl, WebFrame, frame, frame->isWebRemoteFrame(), frame.isWebRemoteFrame());

Powered by Google App Engine
This is Rietveld 408576698