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

Unified Diff: content/browser/web_contents/navigation_controller_impl.cc

Issue 14985014: Introduce content::PageState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments to the top of page_state.h Created 7 years, 7 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: content/browser/web_contents/navigation_controller_impl.cc
diff --git a/content/browser/web_contents/navigation_controller_impl.cc b/content/browser/web_contents/navigation_controller_impl.cc
index 5488c6c8146b9ab76b1d4bd1d3e4efd06e9a614e..8bd29ee87dbbf48fe621b6de74eee40f6cf1544a 100644
--- a/content/browser/web_contents/navigation_controller_impl.cc
+++ b/content/browser/web_contents/navigation_controller_impl.cc
@@ -40,7 +40,6 @@
#include "net/base/mime_util.h"
#include "net/base/net_util.h"
#include "skia/ext/platform_canvas.h"
-#include "webkit/glue/glue_serialize.h"
namespace content {
namespace {
@@ -69,11 +68,9 @@ void NotifyPrunedEntries(NavigationControllerImpl* nav_controller,
// losing the navigation entries and generating a new navigation entry after
// this one. We don't want that. To avoid this we create a valid state which
// WebKit will not treat as a new navigation.
-void SetContentStateIfEmpty(NavigationEntryImpl* entry) {
- if (entry->GetContentState().empty()) {
- entry->SetContentState(
- webkit_glue::CreateHistoryStateForURL(entry->GetURL()));
- }
+void SetPageStateIfEmpty(NavigationEntryImpl* entry) {
+ if (!entry->GetPageState().IsValid())
+ entry->SetPageState(PageState::CreateFromURL(entry->GetURL()));
}
NavigationEntryImpl::RestoreType ControllerRestoreTypeToEntryType(
@@ -101,7 +98,7 @@ void ConfigureEntriesForRestore(
(*entries)[i]->SetTransitionType(PAGE_TRANSITION_RELOAD);
(*entries)[i]->set_restore_type(ControllerRestoreTypeToEntryType(type));
// NOTE(darin): This code is only needed for backwards compat.
- SetContentStateIfEmpty((*entries)[i].get());
+ SetPageStateIfEmpty((*entries)[i].get());
}
}
@@ -769,11 +766,11 @@ bool NavigationControllerImpl::RendererDidNavigate(
// All committed entries should have nonempty content state so WebKit doesn't
// get confused when we go back to them (see the function for details).
- DCHECK(!params.content_state.empty());
+ DCHECK(params.page_state.IsValid());
NavigationEntryImpl* active_entry =
NavigationEntryImpl::FromNavigationEntry(GetLastCommittedEntry());
active_entry->SetTimestamp(timestamp);
- active_entry->SetContentState(params.content_state);
+ active_entry->SetPageState(params.page_state);
// No longer needed since content state will hold the post data if any.
active_entry->SetBrowserInitiatedPostData(NULL);

Powered by Google App Engine
This is Rietveld 408576698