summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-02 19:08:56 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-02 19:08:56 +0000
commit606843faf131685e7802df12f2ee97efc7cf2f3b (patch)
treef4d494147c9190ba22c370148ab5aab2020f6d1a /chrome
parent63e78057b6ae2685ed3525d832fed48b7c85ee1e (diff)
downloadchromium_src-606843faf131685e7802df12f2ee97efc7cf2f3b.zip
chromium_src-606843faf131685e7802df12f2ee97efc7cf2f3b.tar.gz
chromium_src-606843faf131685e7802df12f2ee97efc7cf2f3b.tar.bz2
Remove the URL and title from the state getting functions and IPC messages.
If the title or URL changes, we'll be updated in other ways, so this extra processing is wasted. Review URL: http://codereview.chromium.org/12859 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6225 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/render_view_host.cc8
-rw-r--r--chrome/browser/render_view_host.h2
-rw-r--r--chrome/browser/render_view_host_delegate.h2
-rw-r--r--chrome/browser/web_contents.cc23
-rw-r--r--chrome/browser/web_contents.h2
-rw-r--r--chrome/common/render_messages_internal.h4
-rw-r--r--chrome/renderer/render_view.cc16
7 files changed, 10 insertions, 47 deletions
diff --git a/chrome/browser/render_view_host.cc b/chrome/browser/render_view_host.cc
index 38bbe9e..77512b6 100644
--- a/chrome/browser/render_view_host.cc
+++ b/chrome/browser/render_view_host.cc
@@ -832,14 +832,8 @@ void RenderViewHost::OnMsgNavigate(const IPC::Message& msg) {
}
void RenderViewHost::OnMsgUpdateState(int32 page_id,
- const GURL& url,
- const std::wstring& title,
const std::string& state) {
- GURL validated_url(url);
- FilterURL(RendererSecurityPolicy::GetInstance(),
- process()->host_id(), &validated_url);
-
- delegate_->UpdateState(this, page_id, validated_url, title, state);
+ delegate_->UpdateState(this, page_id, state);
}
void RenderViewHost::OnMsgUpdateTitle(int32 page_id,
diff --git a/chrome/browser/render_view_host.h b/chrome/browser/render_view_host.h
index b7d1ae2..5ccd88f 100644
--- a/chrome/browser/render_view_host.h
+++ b/chrome/browser/render_view_host.h
@@ -420,8 +420,6 @@ class RenderViewHost : public RenderWidgetHost {
void OnMsgRendererGone();
void OnMsgNavigate(const IPC::Message& msg);
void OnMsgUpdateState(int32 page_id,
- const GURL& url,
- const std::wstring& title,
const std::string& state);
void OnMsgUpdateTitle(int32 page_id, const std::wstring& title);
void OnMsgUpdateEncoding(const std::wstring& encoding);
diff --git a/chrome/browser/render_view_host_delegate.h b/chrome/browser/render_view_host_delegate.h
index 63e2eaa..f0c4b0e 100644
--- a/chrome/browser/render_view_host_delegate.h
+++ b/chrome/browser/render_view_host_delegate.h
@@ -160,8 +160,6 @@ class RenderViewHostDelegate {
// The state for the page changed and should be updated.
virtual void UpdateState(RenderViewHost* render_view_host,
int32 page_id,
- const GURL& url,
- const std::wstring& title,
const std::string& state) { }
// The page's title was changed and should be updated.
diff --git a/chrome/browser/web_contents.cc b/chrome/browser/web_contents.cc
index 4afc290..1191d5d 100644
--- a/chrome/browser/web_contents.cc
+++ b/chrome/browser/web_contents.cc
@@ -745,8 +745,6 @@ void WebContents::DidNavigate(RenderViewHost* rvh,
void WebContents::UpdateState(RenderViewHost* rvh,
int32 page_id,
- const GURL& url,
- const std::wstring& title,
const std::string& state) {
if (rvh != render_view_host() ||
render_manager_.showing_interstitial_page()) {
@@ -774,27 +772,12 @@ void WebContents::UpdateState(RenderViewHost* rvh,
if (entry_index < 0)
return;
NavigationEntry* entry = controller()->GetEntryAtIndex(entry_index);
- unsigned changed_flags = 0;
-
- // Update the URL.
- if (url != entry->url()) {
- changed_flags |= INVALIDATE_URL;
- if (entry == controller()->GetActiveEntry())
- fav_icon_helper_.FetchFavIcon(url);
- entry->set_url(url);
- }
-
- // Save the new title if it changed.
- if (UpdateTitleForEntry(entry, title))
- changed_flags |= INVALIDATE_TITLE;
- // Update the state (forms, etc.).
- if (state != entry->content_state())
- entry->set_content_state(state);
+ if (state == entry->content_state())
+ return; // Nothing to update.
+ entry->set_content_state(state);
// Notify everybody of the changes (only when the current page changed).
- if (changed_flags && entry == controller()->GetActiveEntry())
- NotifyNavigationStateChanged(changed_flags);
controller()->NotifyEntryChanged(entry, entry_index);
}
diff --git a/chrome/browser/web_contents.h b/chrome/browser/web_contents.h
index efe7a10..f7ed61e 100644
--- a/chrome/browser/web_contents.h
+++ b/chrome/browser/web_contents.h
@@ -231,8 +231,6 @@ class WebContents : public TabContents,
const ViewHostMsg_FrameNavigate_Params& params);
virtual void UpdateState(RenderViewHost* render_view_host,
int32 page_id,
- const GURL& url,
- const std::wstring& title,
const std::string& state);
virtual void UpdateTitle(RenderViewHost* render_view_host,
int32 page_id,
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index 8cc598a..96d7d89 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -565,10 +565,8 @@ IPC_BEGIN_MESSAGES(ViewHost, 2)
// Notifies the browser that we have session history information.
// page_id: unique ID that allows us to distinguish between history entries.
- IPC_MESSAGE_ROUTED4(ViewHostMsg_UpdateState,
+ IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateState,
int32 /* page_id */,
- GURL /* url */,
- std::wstring /* title */,
std::string /* state */)
// Changes the title for the page in the UI when the page is navigated or the
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index e571ace..23fab18 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -830,7 +830,7 @@ void RenderView::OnNavigate(const ViewMsg_Navigate_Params& params) {
bool is_reload = params.reload;
WebFrame* main_frame = webview()->GetMainFrame();
- if (is_reload && !main_frame->HasCurrentState()) {
+ if (is_reload && !main_frame->HasCurrentHistoryState()) {
// We cannot reload if we do not have any history state. This happens, for
// example, when recovering from a crash. Our workaround here is a bit of
// a hack since it means that reload after a crashed tab does not cause an
@@ -1162,13 +1162,10 @@ void RenderView::UpdateSessionHistory(WebFrame* frame) {
if (page_id_ == -1)
return;
- GURL url;
- std::wstring title;
std::string state;
- if (!webview()->GetMainFrame()->GetPreviousState(&url, &title, &state))
+ if (!webview()->GetMainFrame()->GetPreviousHistoryState(&state))
return;
-
- Send(new ViewHostMsg_UpdateState(routing_id_, page_id_, url, title, state));
+ Send(new ViewHostMsg_UpdateState(routing_id_, page_id_, state));
}
///////////////////////////////////////////////////////////////////////////////
@@ -1926,13 +1923,10 @@ void RenderView::SyncNavigationState() {
if (!webview())
return;
- GURL url;
- std::wstring title;
std::string state;
- if (!webview()->GetMainFrame()->GetCurrentState(&url, &title, &state))
+ if (!webview()->GetMainFrame()->GetCurrentHistoryState(&state))
return;
-
- Send(new ViewHostMsg_UpdateState(routing_id_, page_id_, url, title, state));
+ Send(new ViewHostMsg_UpdateState(routing_id_, page_id_, state));
}
void RenderView::ShowContextMenu(WebView* webview,