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

Unified Diff: Source/core/loader/HistoryItem.cpp

Issue 239993011: Lazily generate HistoryItem's serialized form state (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merged to trunk Created 6 years, 8 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/loader/HistoryItem.h ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/HistoryItem.cpp
diff --git a/Source/core/loader/HistoryItem.cpp b/Source/core/loader/HistoryItem.cpp
index 37e73da0c10ef2ff2f4c29b0488600425d5bc229..e8e09d1f308a6e29eaceda3da4e9b461748739fc 100644
--- a/Source/core/loader/HistoryItem.cpp
+++ b/Source/core/loader/HistoryItem.cpp
@@ -27,6 +27,7 @@
#include "core/loader/HistoryItem.h"
#include "core/dom/Document.h"
+#include "core/html/forms/FormController.h"
#include "platform/network/ResourceRequest.h"
#include "wtf/CurrentTime.h"
#include "wtf/text/CString.h"
@@ -87,7 +88,6 @@ void HistoryItem::setURLString(const String& urlString)
void HistoryItem::setURL(const KURL& url)
{
setURLString(url.string());
- clearDocumentState();
}
void HistoryItem::setReferrer(const Referrer& referrer)
@@ -128,17 +128,31 @@ void HistoryItem::setPageScaleFactor(float scaleFactor)
void HistoryItem::setDocumentState(const Vector<String>& state)
{
+ ASSERT(!m_documentState);
+ m_documentStateVector = state;
+}
+
+void HistoryItem::setDocumentState(DocumentState* state)
+{
m_documentState = state;
}
-const Vector<String>& HistoryItem::documentState() const
+const Vector<String>& HistoryItem::documentState()
+{
+ if (m_documentState)
+ m_documentStateVector = m_documentState->toStateVector();
+ return m_documentStateVector;
+}
+
+Vector<String> HistoryItem::getReferencedFilePaths()
{
- return m_documentState;
+ return FormController::getReferencedFilePaths(documentState());
}
void HistoryItem::clearDocumentState()
{
m_documentState.clear();
+ m_documentStateVector.clear();
}
void HistoryItem::setStateObject(PassRefPtr<SerializedScriptValue> object)
« no previous file with comments | « Source/core/loader/HistoryItem.h ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698