| Index: Source/core/loader/HistoryController.h
|
| diff --git a/Source/core/loader/HistoryController.h b/Source/core/loader/HistoryController.h
|
| index f70840843cbf81dc51aede0abe16dd27c1c0c1d7..5d9d40e287e33d259b640b833a3370c198e120ae 100644
|
| --- a/Source/core/loader/HistoryController.h
|
| +++ b/Source/core/loader/HistoryController.h
|
| @@ -32,6 +32,7 @@
|
|
|
| #include "core/history/HistoryItem.h"
|
| #include "core/loader/FrameLoaderTypes.h"
|
| +#include "wtf/HashMap.h"
|
| #include "wtf/Noncopyable.h"
|
| #include "wtf/RefPtr.h"
|
| #include "wtf/text/WTFString.h"
|
| @@ -39,68 +40,107 @@
|
| namespace WebCore {
|
|
|
| class Frame;
|
| +class HistoryEntry;
|
| +class Page;
|
| class SerializedScriptValue;
|
|
|
| +
|
| +class HistoryEntryItem {
|
| +public:
|
| + static PassOwnPtr<HistoryEntryItem> create(HistoryEntry*, HistoryItem*);
|
| + ~HistoryEntryItem() { }
|
| +
|
| + HistoryEntryItem* addChild(PassRefPtr<HistoryItem>);
|
| + PassOwnPtr<HistoryEntryItem> cloneAndReplace(HistoryEntry*, HistoryItem* newItem, HistoryItem* oldItem, bool clipAtTarget);
|
| + HistoryItem* value() { return m_value.get(); }
|
| + const Vector<OwnPtr<HistoryEntryItem> >& children() const;
|
| +
|
| +private:
|
| + HistoryEntryItem(HistoryEntry*, HistoryItem*);
|
| +
|
| + Vector<OwnPtr<HistoryEntryItem> > m_children;
|
| + RefPtr<HistoryItem> m_value;
|
| + HistoryEntry* m_entry;
|
| +};
|
| +
|
| +class HistoryEntry {
|
| +public:
|
| + static PassOwnPtr<HistoryEntry> create(HistoryItem* root);
|
| + PassOwnPtr<HistoryEntry> cloneAndReplace(HistoryItem* newItem, HistoryItem* oldItem, bool clipAtTarget);
|
| +
|
| + HistoryEntryItem* entryForFrame(Frame*);
|
| + HistoryItem* itemForFrame(Frame*);
|
| + HistoryItem* root();
|
| + HistoryEntryItem* rootEntry();
|
| +
|
| + HistoryItemVector childrenForItem(HistoryItem*);
|
| +
|
| +private:
|
| + friend class HistoryEntryItem;
|
| +
|
| + HistoryEntry() { }
|
| + explicit HistoryEntry(HistoryItem* root);
|
| +
|
| + OwnPtr<HistoryEntryItem> m_root;
|
| + HashMap<String, HistoryEntryItem*> m_framesToItems;
|
| +};
|
| +
|
| class HistoryController {
|
| WTF_MAKE_NONCOPYABLE(HistoryController);
|
| public:
|
| - explicit HistoryController(Frame*);
|
| + explicit HistoryController(Page*);
|
| ~HistoryController();
|
|
|
| void clearScrollPositionAndViewState();
|
| - void restoreScrollPositionAndViewState();
|
| + void restoreScrollPositionAndViewState(Frame*);
|
|
|
| - void updateBackForwardListForFragmentScroll();
|
| + void updateBackForwardListForFragmentScroll(Frame*);
|
|
|
| - void saveDocumentAndScrollState();
|
| - void restoreDocumentState();
|
| + void saveDocumentAndScrollState(Frame*);
|
| + void restoreDocumentState(Frame*);
|
|
|
| - void updateForCommit();
|
| - void updateForSameDocumentNavigation();
|
| + void updateForCommit(Frame*);
|
| + void updateForSameDocumentNavigation(Frame*);
|
|
|
| - HistoryItem* currentItem() const { return m_currentItem.get(); }
|
| - void setCurrentItem(HistoryItem*);
|
| - bool currentItemShouldBeReplaced() const;
|
| + PassRefPtr<HistoryItem> currentItemForExport(Frame*);
|
| + PassRefPtr<HistoryItem> previousItemForExport(Frame*);
|
| + PassRefPtr<HistoryItem> provisionalItemForExport(Frame*);
|
|
|
| - HistoryItem* previousItem() const { return m_previousItem.get(); }
|
| + HistoryItem* currentItem(Frame*) const;
|
| + bool currentItemShouldBeReplaced(Frame*) const;
|
|
|
| - HistoryItem* provisionalItem() const { return m_provisionalItem.get(); }
|
| - void setProvisionalItem(HistoryItem*);
|
| + HistoryItem* previousItem() const { return m_previousEntry->root(); }
|
|
|
| - void pushState(PassRefPtr<SerializedScriptValue>, const String& url);
|
| - void replaceState(PassRefPtr<SerializedScriptValue>, const String& url);
|
| + HistoryItem* provisionalItem(Frame*) const;
|
| + void clearProvisionalEntry();
|
| +
|
| + void pushState(Frame*, PassRefPtr<SerializedScriptValue>, const String& url);
|
| + void replaceState(Frame*, PassRefPtr<SerializedScriptValue>, const String& url);
|
|
|
| void setDefersLoading(bool);
|
|
|
| private:
|
| friend class Page;
|
| - bool shouldStopLoadingForHistoryItem(HistoryItem*) const;
|
| void goToItem(HistoryItem*);
|
| + void goToEntry(PassOwnPtr<HistoryEntry>);
|
|
|
| - void initializeItem(HistoryItem*);
|
| - PassRefPtr<HistoryItem> createItem();
|
| - PassRefPtr<HistoryItem> createItemTree(Frame* targetFrame, bool clipAtTarget);
|
| -
|
| - void updateForStandardLoad();
|
| - void updateForInitialLoadInChildFrame();
|
| + void initializeItem(HistoryItem*, Frame*);
|
| + PassRefPtr<HistoryItem> createItem(Frame*);
|
| + HistoryItem* createItemTree(Frame* targetFrame, bool clipAtTarget);
|
|
|
| - void recursiveSetProvisionalItem(HistoryItem*, HistoryItem*);
|
| - void recursiveGoToItem(HistoryItem*, HistoryItem*);
|
| - void recursiveUpdateForCommit();
|
| - void recursiveUpdateForSameDocumentNavigation();
|
| - bool itemsAreClones(HistoryItem*, HistoryItem*) const;
|
| - bool currentFramesMatchItem(HistoryItem*) const;
|
| + void updateForStandardLoad(Frame*);
|
| + void updateForInitialLoadInChildFrame(Frame*);
|
|
|
| - void createNewBackForwardItem(bool doClip);
|
| - void updateWithoutCreatingNewBackForwardItem();
|
| + void createNewBackForwardItem(Frame*, bool doClip);
|
| + void updateWithoutCreatingNewBackForwardItem(Frame*);
|
|
|
| - void clearProvisionalItemsInAllFrames();
|
| + PassRefPtr<HistoryItem> itemForExport(HistoryEntryItem*);
|
|
|
| - Frame* m_frame;
|
| + Page* m_page;
|
|
|
| - RefPtr<HistoryItem> m_currentItem;
|
| - RefPtr<HistoryItem> m_previousItem;
|
| - RefPtr<HistoryItem> m_provisionalItem;
|
| + OwnPtr<HistoryEntry> m_currentEntry;
|
| + OwnPtr<HistoryEntry> m_previousEntry;
|
| + OwnPtr<HistoryEntry> m_provisionalEntry;
|
|
|
| bool m_defersLoading;
|
| RefPtr<HistoryItem> m_deferredItem;
|
|
|