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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 1425303002: OOPIF: Stop using HistoryController and refactor UpdateState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nit Created 5 years, 1 month 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/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index d54b02b2e93dc888640494649d1c8ad802b3f729..ee82e33f195490207548a25f0733bc6e57927de6 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -459,6 +459,7 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
IPC_MESSAGE_HANDLER_GENERIC(FrameHostMsg_DidCommitProvisionalLoad,
OnDidCommitProvisionalLoad(msg))
IPC_MESSAGE_HANDLER(FrameHostMsg_DidDropNavigation, OnDidDropNavigation)
+ IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateState, OnUpdateState)
IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL)
IPC_MESSAGE_HANDLER(FrameHostMsg_DocumentOnLoadCompleted,
OnDocumentOnLoadCompleted)
@@ -973,6 +974,21 @@ void RenderFrameHostImpl::OnDidDropNavigation() {
navigation_handle_.reset();
}
+void RenderFrameHostImpl::OnUpdateState(const PageState& state) {
+ // TODO(creis): Verify the state's ISN matches the last committed FNE.
+
+ // Without this check, the renderer can trick the browser into using
+ // filenames it can't access in a future session restore.
+ // TODO(creis): Move CanAccessFilesOfPageState to RenderFrameHostImpl.
+ if (!render_view_host_->CanAccessFilesOfPageState(state)) {
+ bad_message::ReceivedBadMessage(
+ GetProcess(), bad_message::RFH_CAN_ACCESS_FILES_OF_PAGE_STATE);
+ return;
+ }
+
+ delegate_->UpdateStateForFrame(this, state);
+}
+
RenderWidgetHostImpl* RenderFrameHostImpl::GetRenderWidgetHost() {
return render_widget_host_;
}
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698