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

Unified Diff: third_party/WebKit/Source/core/frame/History.cpp

Issue 2710983003: Move HistoryItem handling to DocumentLoader (Closed)
Patch Set: Address kinuko's comments Created 3 years, 9 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
Index: third_party/WebKit/Source/core/frame/History.cpp
diff --git a/third_party/WebKit/Source/core/frame/History.cpp b/third_party/WebKit/Source/core/frame/History.cpp
index 43f27ac0b018ae1f83f26d0cc1282159542ebf75..a8ade4515686b731d3e907916077cac755665ec9 100644
--- a/third_party/WebKit/Source/core/frame/History.cpp
+++ b/third_party/WebKit/Source/core/frame/History.cpp
@@ -77,8 +77,10 @@ SerializedScriptValue* History::stateInternal() const {
if (!frame())
return 0;
- if (HistoryItem* historyItem = frame()->loader().currentItem())
+ if (HistoryItem* historyItem =
+ frame()->loader().documentLoader()->historyItem()) {
return historyItem->stateObject();
+ }
return 0;
}
@@ -93,7 +95,8 @@ void History::setScrollRestoration(const String& value) {
if (scrollRestoration == scrollRestorationInternal())
return;
- if (HistoryItem* historyItem = frame()->loader().currentItem()) {
+ if (HistoryItem* historyItem =
+ frame()->loader().documentLoader()->historyItem()) {
historyItem->setScrollRestorationType(scrollRestoration);
frame()->loader().client()->didUpdateCurrentHistoryItem();
}
@@ -105,12 +108,10 @@ String History::scrollRestoration() {
}
HistoryScrollRestorationType History::scrollRestorationInternal() const {
- if (frame()) {
- if (HistoryItem* historyItem = frame()->loader().currentItem())
- return historyItem->scrollRestorationType();
- }
-
- return ScrollRestorationAuto;
+ HistoryItem* historyItem =
+ frame() ? frame()->loader().documentLoader()->historyItem() : nullptr;
+ return historyItem ? historyItem->scrollRestorationType()
+ : ScrollRestorationAuto;
}
bool History::stateChanged() const {
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698