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

Side by Side Diff: Source/core/history/HistoryItem.h

Issue 28983004: Split the frame tree logic out of HistoryItem (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 void setStateObject(PassRefPtr<SerializedScriptValue> object); 85 void setStateObject(PassRefPtr<SerializedScriptValue> object);
86 SerializedScriptValue* stateObject() const { return m_stateObject.get(); } 86 SerializedScriptValue* stateObject() const { return m_stateObject.get(); }
87 87
88 void setItemSequenceNumber(long long number) { m_itemSequenceNumber = number ; } 88 void setItemSequenceNumber(long long number) { m_itemSequenceNumber = number ; }
89 long long itemSequenceNumber() const { return m_itemSequenceNumber; } 89 long long itemSequenceNumber() const { return m_itemSequenceNumber; }
90 90
91 void setDocumentSequenceNumber(long long number) { m_documentSequenceNumber = number; } 91 void setDocumentSequenceNumber(long long number) { m_documentSequenceNumber = number; }
92 long long documentSequenceNumber() const { return m_documentSequenceNumber; } 92 long long documentSequenceNumber() const { return m_documentSequenceNumber; }
93 93
94 void setTargetFrameID(int64_t number) { m_targetFrameID = number; }
abarth-chromium 2013/10/29 20:36:58 s/number/id/ ?
95 int64_t targetFrameID() const { return m_targetFrameID; }
96
94 void setFormInfoFromRequest(const ResourceRequest&); 97 void setFormInfoFromRequest(const ResourceRequest&);
95 void setFormData(PassRefPtr<FormData>); 98 void setFormData(PassRefPtr<FormData>);
96 void setFormContentType(const String&); 99 void setFormContentType(const String&);
97 100
98 void addChildItem(PassRefPtr<HistoryItem>); 101 void addChildItem(PassRefPtr<HistoryItem>);
99 void setChildItem(PassRefPtr<HistoryItem>);
100 HistoryItem* childItemWithTarget(const String&) const;
101 HistoryItem* childItemWithDocumentSequenceNumber(long long number) const;
102 const HistoryItemVector& children() const; 102 const HistoryItemVector& children() const;
103 void clearChildren(); 103 void clearChildren();
104 104
105 bool shouldDoSameDocumentNavigationTo(HistoryItem* otherItem) const;
106 bool hasSameFrames(HistoryItem* otherItem) const;
107
108 bool isCurrentDocument(Document*) const; 105 bool isCurrentDocument(Document*) const;
109 106
110 #ifndef NDEBUG
111 int showTree() const;
112 int showTreeWithIndent(unsigned indentLevel) const;
113 #endif
114
115 private: 107 private:
116 HistoryItem(); 108 HistoryItem();
117 explicit HistoryItem(const HistoryItem&); 109 explicit HistoryItem(const HistoryItem&);
118 110
119 bool hasSameDocumentTree(HistoryItem* otherItem) const;
120
121 String m_urlString; 111 String m_urlString;
122 String m_originalURLString; 112 String m_originalURLString;
123 String m_referrer; 113 String m_referrer;
124 String m_target; 114 String m_target;
125 115
126 IntPoint m_scrollPoint; 116 IntPoint m_scrollPoint;
127 float m_pageScaleFactor; 117 float m_pageScaleFactor;
128 Vector<String> m_documentState; 118 Vector<String> m_documentState;
129 119
130 HistoryItemVector m_children; 120 HistoryItemVector m_children;
131 121
132 // If two HistoryItems have the same item sequence number, then they are 122 // If two HistoryItems have the same item sequence number, then they are
133 // clones of one another. Traversing history from one such HistoryItem to 123 // clones of one another. Traversing history from one such HistoryItem to
134 // another is a no-op. HistoryItem clones are created for parent and 124 // another is a no-op. HistoryItem clones are created for parent and
135 // sibling frames when only a subframe navigates. 125 // sibling frames when only a subframe navigates.
136 int64_t m_itemSequenceNumber; 126 int64_t m_itemSequenceNumber;
137 127
138 // If two HistoryItems have the same document sequence number, then they 128 // If two HistoryItems have the same document sequence number, then they
139 // refer to the same instance of a document. Traversing history from one 129 // refer to the same instance of a document. Traversing history from one
140 // such HistoryItem to another preserves the document. 130 // such HistoryItem to another preserves the document.
141 int64_t m_documentSequenceNumber; 131 int64_t m_documentSequenceNumber;
142 132
133 int64_t m_targetFrameID;
134
143 // Support for HTML5 History 135 // Support for HTML5 History
144 RefPtr<SerializedScriptValue> m_stateObject; 136 RefPtr<SerializedScriptValue> m_stateObject;
145 137
146 // info used to repost form data 138 // info used to repost form data
147 RefPtr<FormData> m_formData; 139 RefPtr<FormData> m_formData;
148 String m_formContentType; 140 String m_formContentType;
149 141
150 }; //class HistoryItem 142 }; //class HistoryItem
151 143
152 } //namespace WebCore 144 } //namespace WebCore
153 145
154 #ifndef NDEBUG
155 // Outside the WebCore namespace for ease of invocation from gdb.
156 extern "C" int showTree(const WebCore::HistoryItem*);
157 #endif
158
159 #endif // HISTORYITEM_H 146 #endif // HISTORYITEM_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698