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

Side by Side Diff: Source/web/WebHistoryItem.cpp

Issue 28983004: Split the frame tree logic out of 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 167 }
168 168
169 long long WebHistoryItem::itemSequenceNumber() const 169 long long WebHistoryItem::itemSequenceNumber() const
170 { 170 {
171 return m_private->itemSequenceNumber(); 171 return m_private->itemSequenceNumber();
172 } 172 }
173 173
174 void WebHistoryItem::setItemSequenceNumber(long long itemSequenceNumber) 174 void WebHistoryItem::setItemSequenceNumber(long long itemSequenceNumber)
175 { 175 {
176 ensureMutable(); 176 ensureMutable();
177 m_private->setItemSequenceNumber(itemSequenceNumber);
178 } 177 }
179 178
180 long long WebHistoryItem::documentSequenceNumber() const 179 long long WebHistoryItem::documentSequenceNumber() const
181 { 180 {
182 return m_private->documentSequenceNumber(); 181 return m_private->documentSequenceNumber();
183 } 182 }
184 183
185 void WebHistoryItem::setDocumentSequenceNumber(long long documentSequenceNumber) 184 void WebHistoryItem::setDocumentSequenceNumber(long long documentSequenceNumber)
186 { 185 {
187 ensureMutable(); 186 ensureMutable();
188 m_private->setDocumentSequenceNumber(documentSequenceNumber);
189 } 187 }
190 188
191 WebSerializedScriptValue WebHistoryItem::stateObject() const 189 WebSerializedScriptValue WebHistoryItem::stateObject() const
192 { 190 {
193 return WebSerializedScriptValue(m_private->stateObject()); 191 return WebSerializedScriptValue(m_private->stateObject());
194 } 192 }
195 193
196 void WebHistoryItem::setStateObject(const WebSerializedScriptValue& object) 194 void WebHistoryItem::setStateObject(const WebSerializedScriptValue& object)
197 { 195 {
198 ensureMutable(); 196 ensureMutable();
(...skipping 20 matching lines...) Expand all
219 { 217 {
220 ensureMutable(); 218 ensureMutable();
221 m_private->setFormData(httpBody); 219 m_private->setFormData(httpBody);
222 } 220 }
223 221
224 WebVector<WebHistoryItem> WebHistoryItem::children() const 222 WebVector<WebHistoryItem> WebHistoryItem::children() const
225 { 223 {
226 return m_private->children(); 224 return m_private->children();
227 } 225 }
228 226
227 void WebHistoryItem::setChildren(const WebVector<WebHistoryItem>& items)
228 {
229 ensureMutable();
230 m_private->clearChildren();
231 for (size_t i = 0; i < items.size(); ++i)
232 m_private->addChildItem(items[i]);
233 }
234
229 void WebHistoryItem::appendToChildren(const WebHistoryItem& item) 235 void WebHistoryItem::appendToChildren(const WebHistoryItem& item)
230 { 236 {
231 ensureMutable(); 237 ensureMutable();
232 m_private->addChildItem(item); 238 m_private->addChildItem(item);
233 } 239 }
234 240
235 WebVector<WebString> WebHistoryItem::getReferencedFilePaths() const 241 WebVector<WebString> WebHistoryItem::getReferencedFilePaths() const
236 { 242 {
237 HashSet<String> filePaths; 243 HashSet<String> filePaths;
238 addReferencedFilePaths(m_private.get(), filePaths); 244 addReferencedFilePaths(m_private.get(), filePaths);
(...skipping 19 matching lines...) Expand all
258 return m_private.get(); 264 return m_private.get();
259 } 265 }
260 266
261 void WebHistoryItem::ensureMutable() 267 void WebHistoryItem::ensureMutable()
262 { 268 {
263 if (!m_private->hasOneRef()) 269 if (!m_private->hasOneRef())
264 m_private = m_private->copy(); 270 m_private = m_private->copy();
265 } 271 }
266 272
267 } // namespace WebKit 273 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698