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

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

Issue 46783003: Add a unique frame id and save it on HistoryItem. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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/core/fetch/ImageResourceTest.cpp ('k') | Source/core/frame/Frame.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/Frame.h
diff --git a/Source/core/frame/Frame.h b/Source/core/frame/Frame.h
index 0937f95e287c1a3e1e88a4f141d197eb050f750e..5aeadb94b033da6fd3447c287aede55014128e3f 100644
--- a/Source/core/frame/Frame.h
+++ b/Source/core/frame/Frame.h
@@ -68,9 +68,44 @@ namespace WebCore {
class VisiblePosition;
class Widget;
+ class FrameInit : public RefCounted<FrameInit> {
+ public:
+ // For creating a dummy Frame
+ static PassRefPtr<FrameInit> create(int64_t frameID, Page* page, FrameLoaderClient* client)
+ {
+ return adoptRef(new FrameInit(frameID, page, client));
+ }
+
+ void setFrameLoaderClient(FrameLoaderClient* client) { m_client = client; }
+ FrameLoaderClient* frameLoaderClient() const { return m_client; }
+
+ int64_t frameID() const { return m_frameID; }
+
+ void setPage(Page* page) { m_page = page; }
+ Page* page() const { return m_page; }
+
+ void setOwnerElement(HTMLFrameOwnerElement* ownerElement) { m_ownerElement = ownerElement; }
+ HTMLFrameOwnerElement* ownerElement() const { return m_ownerElement; }
+
+ protected:
+ FrameInit(int64_t frameID, Page* page = 0, FrameLoaderClient* client = 0)
+ : m_frameID(frameID)
+ , m_client(client)
+ , m_page(page)
+ , m_ownerElement(0)
+ {
+ }
+
+ private:
+ int64_t m_frameID;
+ FrameLoaderClient* m_client;
+ Page* m_page;
+ HTMLFrameOwnerElement* m_ownerElement;
+ };
+
class Frame : public RefCounted<Frame> {
public:
- static PassRefPtr<Frame> create(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
+ static PassRefPtr<Frame> create(PassRefPtr<FrameInit>);
void init();
void setView(PassRefPtr<FrameView>);
@@ -112,6 +147,8 @@ namespace WebCore {
void dispatchVisibilityStateChangeEvent();
+ int64_t frameID() const { return m_frameInit->frameID(); }
+
// ======== All public functions below this point are candidates to move out of Frame into another class. ========
bool inScope(TreeScope*) const;
@@ -166,7 +203,7 @@ namespace WebCore {
// ========
private:
- Frame(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
+ Frame(PassRefPtr<FrameInit>);
HashSet<FrameDestructionObserver*> m_destructionObservers;
@@ -175,7 +212,6 @@ namespace WebCore {
mutable FrameLoader m_loader;
mutable NavigationScheduler m_navigationScheduler;
- HTMLFrameOwnerElement* m_ownerElement;
RefPtr<FrameView> m_view;
RefPtr<DOMWindow> m_domWindow;
@@ -187,6 +223,8 @@ namespace WebCore {
OwnPtr<AnimationController> m_animationController;
OwnPtr<InputMethodController> m_inputMethodController;
+ RefPtr<FrameInit> m_frameInit;
+
float m_pageZoomFactor;
float m_textZoomFactor;
@@ -254,7 +292,7 @@ namespace WebCore {
inline HTMLFrameOwnerElement* Frame::ownerElement() const
{
- return m_ownerElement;
+ return m_frameInit->ownerElement();
}
inline bool Frame::inViewSourceMode() const
« no previous file with comments | « Source/core/fetch/ImageResourceTest.cpp ('k') | Source/core/frame/Frame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698