Chromium Code Reviews| 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 59c101e2985c9d715bd50d0f524646fbb866d8d8..5da6b0413fb843055e4253c38ce3448b830a8ac3 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()) { |
|
yhirano
2017/03/29 09:38:13
Can |frame()->loader().documentLoader()| be null?
Nate Chapin
2017/03/29 18:23:06
I *think* it can't. FrameLoader::documentLoader()
|
| 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 { |