summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-11 23:39:31 +0000
committerdglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-11 23:39:31 +0000
commit579f8970ea79d64a3d76c9201f28c9b0c8ed5862 (patch)
tree105e82072d7ef7855869fdb5f1bbaa2cabffc842
parenta8038816209e01e619e97f46e22bf1b216dc22cd (diff)
downloadchromium_src-579f8970ea79d64a3d76c9201f28c9b0c8ed5862.zip
chromium_src-579f8970ea79d64a3d76c9201f28c9b0c8ed5862.tar.gz
chromium_src-579f8970ea79d64a3d76c9201f28c9b0c8ed5862.tar.bz2
Use HistoryItem::lastVisitWasFailure to replace fakeHistoryItem semantics.
Review URL: http://codereview.chromium.org/14014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6844 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/webframe_impl.cc10
-rw-r--r--webkit/port/history/BackForwardList.cpp14
-rw-r--r--webkit/port/history/BackForwardList.h16
3 files changed, 3 insertions, 37 deletions
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc
index bdb43b4..520dca8 100644
--- a/webkit/glue/webframe_impl.cc
+++ b/webkit/glue/webframe_impl.cc
@@ -395,12 +395,9 @@ void WebFrameImpl::InternalLoadRequest(const WebRequest* request,
// work.
if (!current_item) {
current_item = HistoryItem::create();
+ current_item->setLastVisitWasFailure(true);
frame_->loader()->setCurrentHistoryItem(current_item);
frame_->page()->backForwardList()->setCurrentItem(current_item.get());
-
- // Mark the item as fake, so that we don't attempt to save its state and
- // end up with about:blank in the navigation history.
- frame_->page()->backForwardList()->setCurrentItemFake(true);
}
frame_->loader()->goToItem(request_impl->history_item().get(),
@@ -482,11 +479,8 @@ bool WebFrameImpl::GetPreviousHistoryState(std::string* history_state) const {
// only get saved to history when it becomes the previous item. The caller
// is expected to query the history state after a navigation occurs, after
// the desired history item has become the previous entry.
- if (frame_->page()->backForwardList()->isPreviousItemFake())
- return false;
-
RefPtr<HistoryItem> item = frame_->page()->backForwardList()->previousItem();
- if (!item)
+ if (!item || item->lastVisitWasFailure())
return false;
static StatsCounterTimer history_timer("GetHistoryTimer");
diff --git a/webkit/port/history/BackForwardList.cpp b/webkit/port/history/BackForwardList.cpp
index 0f64861..55c2e72 100644
--- a/webkit/port/history/BackForwardList.cpp
+++ b/webkit/port/history/BackForwardList.cpp
@@ -43,8 +43,6 @@ BackForwardList::BackForwardList(Page* page)
, m_capacity(DefaultCapacity)
, m_closed(true)
, m_enabled(true)
- , m_currentItemFake(false)
- , m_previousItemFake(false)
{
}
@@ -63,8 +61,7 @@ void BackForwardList::addItem(PassRefPtr<HistoryItem> prpItem)
ASSERT(prpItem);
if (m_capacity == 0 || !m_enabled)
return;
-
- updateFakeState();
+
m_previousItem = m_currentItem;
m_currentItem = prpItem;
@@ -73,8 +70,6 @@ void BackForwardList::addItem(PassRefPtr<HistoryItem> prpItem)
void BackForwardList::goToItem(HistoryItem* item)
{
- updateFakeState();
-
m_previousItem = m_currentItem;
m_currentItem = item;
@@ -105,7 +100,6 @@ HistoryItem* BackForwardList::previousItem()
void BackForwardList::setCurrentItem(HistoryItem* item) {
m_currentItem = item;
- m_currentItemFake = false;
}
void BackForwardList::backListWithLimit(int limit, HistoryItemVector& list)
@@ -172,10 +166,4 @@ bool BackForwardList::closed()
return m_closed;
}
-void BackForwardList::updateFakeState()
-{
- m_previousItemFake = m_currentItemFake;
- m_currentItemFake = false;
-}
-
}; // namespace WebCore
diff --git a/webkit/port/history/BackForwardList.h b/webkit/port/history/BackForwardList.h
index ae93013..f7433a0 100644
--- a/webkit/port/history/BackForwardList.h
+++ b/webkit/port/history/BackForwardList.h
@@ -113,21 +113,9 @@ public:
void close();
bool closed();
- // Is the current/previous item fake? Webkit requires a previous item when
- // navigating to a specific HistoryItem. In certain situations we end up
- // creating a HistoryItem to satisfy webkit and mark it as fake. See
- // WebFrameImpl::InternalLoadRequest for more details.
- void setCurrentItemFake(bool value) { m_currentItemFake = value; }
- bool isPreviousItemFake() const { return m_previousItemFake; }
-
private:
BackForwardList(Page*);
- // Sets m_previousItemFake to the value of m_currentItemFake and
- // m_currentItemFake to false. This is called internally at various points
- // when m_currenItem is being updated.
- void updateFakeState();
-
Page* m_page;
BackForwardListClient* m_client;
RefPtr<HistoryItem> m_currentItem; // most recently visited item
@@ -138,10 +126,6 @@ private:
bool m_closed;
bool m_enabled;
- // See comment above setCurrentItemFake.
- bool m_currentItemFake;
- bool m_previousItemFake;
-
// Settings.cpp requires an entries() method that returns a
// HistoryItemVector reference, but we don't actually use it.
HistoryItemVector m_entries_not_used;