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

Unified Diff: Source/web/WebFrameImpl.h

Issue 117493002: Invert the owning relationship between WebFrame and Frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 12 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
« no previous file with comments | « Source/web/FrameLoaderClientImpl.cpp ('k') | Source/web/WebFrameImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebFrameImpl.h
diff --git a/Source/web/WebFrameImpl.h b/Source/web/WebFrameImpl.h
index 03eb06434022d5321dbfd51e08e16ac2858e60a6..163436ae889066209e7a89b1554f2708615652c6 100644
--- a/Source/web/WebFrameImpl.h
+++ b/Source/web/WebFrameImpl.h
@@ -35,7 +35,6 @@
#include "FrameLoaderClientImpl.h"
#include "core/frame/Frame.h"
-#include "core/frame/FrameDestructionObserver.h"
#include "platform/geometry/FloatRect.h"
#include "public/platform/WebFileSystemType.h"
#include "wtf/Compiler.h"
@@ -73,8 +72,7 @@ template <typename T> class WebVector;
// Implementation of WebFrame, note that this is a reference counted object.
class WebFrameImpl
: public WebFrame
- , public RefCounted<WebFrameImpl>
- , public WebCore::FrameDestructionObserver {
+ , public RefCounted<WebFrameImpl> {
public:
// WebFrame methods:
virtual void close();
@@ -237,8 +235,7 @@ public:
virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const;
virtual WebString layerTreeAsText(bool showDebugInfo = false) const;
- // WebCore::FrameDestructionObserver methods.
- virtual void willDetachFrameHost();
+ void willDetachParent();
static WebFrameImpl* create(WebFrameClient*);
// FIXME: Move the embedderIdentifier concept fully to the embedder and
@@ -301,6 +298,7 @@ public:
// Otherwise, disallow scrolling.
void setCanHaveScrollbars(bool);
+ WebCore::Frame* frame() const { return m_frame.get(); }
WebFrameClient* client() const { return m_client; }
void setClient(WebFrameClient* client) { m_client = client; }
@@ -340,7 +338,7 @@ private:
WebFrameImpl(WebFrameClient*, long long frame_identifier);
// Sets the local WebCore frame and registers destruction observers.
- void setWebCoreFrame(WebCore::Frame*);
+ void setWebCoreFrame(PassRefPtr<WebCore::Frame>);
// Notifies the delegate about a new selection rect.
void reportFindInPageSelection(
@@ -438,6 +436,10 @@ private:
};
RefPtr<WebFrameInit> m_frameInit;
+ // The embedder retains a reference to the WebCore Frame while it is active in the DOM. This
+ // reference is released when the frame is removed from the DOM or the entire page is closed.
+ RefPtr<WebCore::Frame> m_frame;
+
WebFrameClient* m_client;
WebPermissionClient* m_permissionClient;
OwnPtr<SharedWorkerRepositoryClientImpl> m_sharedWorkerRepositoryClient;
« no previous file with comments | « Source/web/FrameLoaderClientImpl.cpp ('k') | Source/web/WebFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698