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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 248013003: Remove WebHistoryItem child usage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 31db21434bb8a0e69d9721a63603c39a334d6305..630d2a949f4f92fecbe4eb390642ef077f4e6259 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -700,9 +700,7 @@ void RenderFrameImpl::OnNavigate(const FrameMsg_Navigate_Params& params) {
CHECK(frame) << "Invalid frame name passed: " << params.frame_to_navigate;
}
- WebHistoryItem item =
- render_view_->history_controller()->GetCurrentItemForExport();
- if (is_reload && item.isNull()) {
+ if (is_reload && !render_view_->history_controller()->GetCurrentEntry()) {
// We cannot reload if we do not have any history state. This happens, for
// example, when recovering from a crash.
is_reload = false;
@@ -730,12 +728,13 @@ void RenderFrameImpl::OnNavigate(const FrameMsg_Navigate_Params& params) {
} else if (params.page_state.IsValid()) {
// We must know the page ID of the page we are navigating back to.
DCHECK_NE(params.page_id, -1);
- WebHistoryItem item = PageStateToHistoryItem(params.page_state);
- if (!item.isNull()) {
+ HistoryEntry* entry =
+ PageStateToHistoryEntry(params.page_state, routing_id_);
+ if (entry) {
// Ensure we didn't save the swapped out URL in UpdateState, since the
// browser should never be telling us to navigate to swappedout://.
- CHECK(item.urlString() != WebString::fromUTF8(kSwappedOutURL));
- render_view_->history_controller()->GoToItem(item, cache_policy);
+ CHECK(entry->root().urlString() != WebString::fromUTF8(kSwappedOutURL));
+ render_view_->history_controller()->GoToEntry(entry, cache_policy);
}
} else if (!params.base_url_for_data_url.is_empty()) {
// A loadData request with a specified base URL.
@@ -2123,7 +2122,9 @@ bool RenderFrameImpl::runModalBeforeUnloadDialog(
}
void RenderFrameImpl::showContextMenu(const blink::WebContextMenuData& data) {
- ContextMenuParams params = ContextMenuParamsBuilder::Build(data);
+ PageState state = HistoryEntryToPageState(
+ render_view_->history_controller()->GetCurrentEntry());
+ ContextMenuParams params = ContextMenuParamsBuilder::Build(data, state);
Charlie Reis 2014/04/28 16:29:00 Yeah, somehow we'll need to PageState for the fram
params.source_type = GetRenderWidget()->context_menu_source_type();
if (params.source_type == ui::MENU_SOURCE_TOUCH_EDIT_MENU) {
params.x = GetRenderWidget()->touch_editing_context_menu_location().x();
@@ -2698,13 +2699,11 @@ void RenderFrameImpl::UpdateURL(blink::WebFrame* frame) {
// Make navigation state a part of the DidCommitProvisionalLoad message so
// that commited entry has it at all times.
- WebHistoryItem item =
- render_view_->history_controller()->GetCurrentItemForExport();
- if (item.isNull()) {
- item.initialize();
- item.setURLString(request.url().spec().utf16());
- }
- params.page_state = HistoryItemToPageState(item);
+ HistoryEntry* entry = render_view_->history_controller()->GetCurrentEntry();
+ if (entry)
+ params.page_state = HistoryEntryToPageState(entry);
+ else
+ params.page_state = PageState::CreateFromURL(request.url());
if (!frame->parent()) {
// Top-level navigation.
@@ -2769,7 +2768,7 @@ void RenderFrameImpl::UpdateURL(blink::WebFrame* frame) {
base::string16 method = request.httpMethod();
if (EqualsASCII(method, "POST")) {
params.is_post = true;
- params.post_id = ExtractPostId(item);
+ params.post_id = ExtractPostId(entry->root());
}
// Send the user agent override back.

Powered by Google App Engine
This is Rietveld 408576698