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

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, 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) 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 { 181 {
182 return m_private->documentSequenceNumber(); 182 return m_private->documentSequenceNumber();
183 } 183 }
184 184
185 void WebHistoryItem::setDocumentSequenceNumber(long long documentSequenceNumber) 185 void WebHistoryItem::setDocumentSequenceNumber(long long documentSequenceNumber)
186 { 186 {
187 ensureMutable(); 187 ensureMutable();
188 m_private->setDocumentSequenceNumber(documentSequenceNumber); 188 m_private->setDocumentSequenceNumber(documentSequenceNumber);
189 } 189 }
190 190
191 long long WebHistoryItem::targetFrameID() const
192 {
193 return m_private->targetFrameID();
194 }
195
196 void WebHistoryItem::setTargetFrameID(long long targetFrameID)
197 {
198 ensureMutable();
199 m_private->setTargetFrameID(targetFrameID);
200 }
201
191 WebSerializedScriptValue WebHistoryItem::stateObject() const 202 WebSerializedScriptValue WebHistoryItem::stateObject() const
192 { 203 {
193 return WebSerializedScriptValue(m_private->stateObject()); 204 return WebSerializedScriptValue(m_private->stateObject());
194 } 205 }
195 206
196 void WebHistoryItem::setStateObject(const WebSerializedScriptValue& object) 207 void WebHistoryItem::setStateObject(const WebSerializedScriptValue& object)
197 { 208 {
198 ensureMutable(); 209 ensureMutable();
199 m_private->setStateObject(object); 210 m_private->setStateObject(object);
200 } 211 }
(...skipping 18 matching lines...) Expand all
219 { 230 {
220 ensureMutable(); 231 ensureMutable();
221 m_private->setFormData(httpBody); 232 m_private->setFormData(httpBody);
222 } 233 }
223 234
224 WebVector<WebHistoryItem> WebHistoryItem::children() const 235 WebVector<WebHistoryItem> WebHistoryItem::children() const
225 { 236 {
226 return m_private->children(); 237 return m_private->children();
227 } 238 }
228 239
240 void WebHistoryItem::setChildren(const WebVector<WebHistoryItem>& items)
241 {
242 ensureMutable();
243 m_private->clearChildren();
244 for (size_t i = 0; i < items.size(); ++i)
245 m_private->addChildItem(items[i]);
246 }
247
229 void WebHistoryItem::appendToChildren(const WebHistoryItem& item) 248 void WebHistoryItem::appendToChildren(const WebHistoryItem& item)
230 { 249 {
231 ensureMutable(); 250 ensureMutable();
232 m_private->addChildItem(item); 251 m_private->addChildItem(item);
233 } 252 }
234 253
235 WebVector<WebString> WebHistoryItem::getReferencedFilePaths() const 254 WebVector<WebString> WebHistoryItem::getReferencedFilePaths() const
236 { 255 {
237 HashSet<String> filePaths; 256 HashSet<String> filePaths;
238 addReferencedFilePaths(m_private.get(), filePaths); 257 addReferencedFilePaths(m_private.get(), filePaths);
(...skipping 19 matching lines...) Expand all
258 return m_private.get(); 277 return m_private.get();
259 } 278 }
260 279
261 void WebHistoryItem::ensureMutable() 280 void WebHistoryItem::ensureMutable()
262 { 281 {
263 if (!m_private->hasOneRef()) 282 if (!m_private->hasOneRef())
264 m_private = m_private->copy(); 283 m_private = m_private->copy();
265 } 284 }
266 285
267 } // namespace WebKit 286 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698