summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/browser/frame_host/navigation_controller_impl_unittest.cc15
-rw-r--r--content/browser/frame_host/navigator.h2
-rw-r--r--content/browser/frame_host/navigator_delegate.h2
-rw-r--r--content/browser/frame_host/navigator_impl.cc57
-rw-r--r--content/browser/frame_host/navigator_impl.h2
-rw-r--r--content/browser/frame_host/render_frame_host_impl.cc7
-rw-r--r--content/browser/frame_host/render_frame_host_impl.h2
-rw-r--r--content/browser/web_contents/web_contents_impl.cc49
-rw-r--r--content/browser/web_contents/web_contents_impl.h5
-rw-r--r--content/browser/web_contents/web_contents_impl_unittest.cc4
-rw-r--r--content/common/frame_messages.h13
-rw-r--r--content/renderer/render_frame_impl.cc8
-rw-r--r--content/test/test_render_frame_host.cc4
-rw-r--r--content/test/test_web_contents.cc8
-rw-r--r--content/test/test_web_contents.h3
15 files changed, 56 insertions, 125 deletions
diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc
index 91a69f8..e4218c2 100644
--- a/content/browser/frame_host/navigation_controller_impl_unittest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc
@@ -956,7 +956,6 @@ TEST_F(NavigationControllerTest, LoadURL_AbortDoesntCancelPending) {
// It may abort before committing, if it's a download or due to a stop or
// a new navigation from the user.
FrameHostMsg_DidFailProvisionalLoadWithError_Params params;
- params.is_main_frame = true;
params.error_code = net::ERR_ABORTED;
params.error_description = base::string16();
params.url = kNewURL;
@@ -1033,7 +1032,6 @@ TEST_F(NavigationControllerTest, LoadURL_RedirectAbortDoesntShowPendingURL) {
// It may abort before committing, if it's a download or due to a stop or
// a new navigation from the user.
FrameHostMsg_DidFailProvisionalLoadWithError_Params params;
- params.is_main_frame = true;
params.error_code = net::ERR_ABORTED;
params.error_description = base::string16();
params.url = kRedirectURL;
@@ -2427,7 +2425,6 @@ TEST_F(NavigationControllerTest, RestoreNavigateAfterFailure) {
// This pending navigation may have caused a different navigation to fail,
// which causes the pending entry to be cleared.
FrameHostMsg_DidFailProvisionalLoadWithError_Params fail_load_params;
- fail_load_params.is_main_frame = true;
fail_load_params.error_code = net::ERR_ABORTED;
fail_load_params.error_description = base::string16();
fail_load_params.url = url;
@@ -2745,7 +2742,7 @@ TEST_F(NavigationControllerTest, RendererInitiatedPendingEntries) {
// We create pending entries for renderer-initiated navigations so that we
// can show them in new tabs when it is safe.
- navigator->DidStartProvisionalLoad(main_test_rfh(), -1, true, url1);
+ navigator->DidStartProvisionalLoad(main_test_rfh(), -1, url1);
// Simulate what happens if a BrowserURLHandler rewrites the URL, causing
// the virtual URL to differ from the URL.
@@ -2759,7 +2756,7 @@ TEST_F(NavigationControllerTest, RendererInitiatedPendingEntries) {
is_renderer_initiated());
// If the user clicks another link, we should replace the pending entry.
- navigator->DidStartProvisionalLoad(main_test_rfh(), -1, true, url2);
+ navigator->DidStartProvisionalLoad(main_test_rfh(), -1, url2);
EXPECT_EQ(url2, controller.GetPendingEntry()->GetURL());
EXPECT_EQ(url2, controller.GetPendingEntry()->GetVirtualURL());
@@ -2769,18 +2766,18 @@ TEST_F(NavigationControllerTest, RendererInitiatedPendingEntries) {
EXPECT_EQ(url2, controller.GetLastCommittedEntry()->GetVirtualURL());
// We should not replace the pending entry for an error URL.
- navigator->DidStartProvisionalLoad(main_test_rfh(), -1, true, url1);
+ navigator->DidStartProvisionalLoad(main_test_rfh(), -1, url1);
EXPECT_EQ(url1, controller.GetPendingEntry()->GetURL());
navigator->DidStartProvisionalLoad(
- main_test_rfh(), -1, true, GURL(kUnreachableWebDataURL));
+ main_test_rfh(), -1, GURL(kUnreachableWebDataURL));
EXPECT_EQ(url1, controller.GetPendingEntry()->GetURL());
// We should remember if the pending entry will replace the current one.
// http://crbug.com/308444.
- navigator->DidStartProvisionalLoad(main_test_rfh(), -1, true, url1);
+ navigator->DidStartProvisionalLoad(main_test_rfh(), -1, url1);
NavigationEntryImpl::FromNavigationEntry(controller.GetPendingEntry())->
set_should_replace_entry(true);
- navigator->DidStartProvisionalLoad(main_test_rfh(), -1, true, url2);
+ navigator->DidStartProvisionalLoad(main_test_rfh(), -1, url2);
EXPECT_TRUE(
NavigationEntryImpl::FromNavigationEntry(controller.GetPendingEntry())->
should_replace_entry());
diff --git a/content/browser/frame_host/navigator.h b/content/browser/frame_host/navigator.h
index ef41e9d..5d7b904 100644
--- a/content/browser/frame_host/navigator.h
+++ b/content/browser/frame_host/navigator.h
@@ -37,7 +37,6 @@ class CONTENT_EXPORT Navigator : public base::RefCounted<Navigator> {
// The RenderFrameHostImpl started a provisional load.
virtual void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host,
int parent_routing_id,
- bool main_frame,
const GURL& url) {};
// The RenderFrameHostImpl has failed a provisional load.
@@ -49,7 +48,6 @@ class CONTENT_EXPORT Navigator : public base::RefCounted<Navigator> {
virtual void DidFailLoadWithError(
RenderFrameHostImpl* render_frame_host,
const GURL& url,
- bool is_main_frame,
int error_code,
const base::string16& error_description) {}
diff --git a/content/browser/frame_host/navigator_delegate.h b/content/browser/frame_host/navigator_delegate.h
index e6057ae..ab70aac 100644
--- a/content/browser/frame_host/navigator_delegate.h
+++ b/content/browser/frame_host/navigator_delegate.h
@@ -30,7 +30,6 @@ class CONTENT_EXPORT NavigatorDelegate {
virtual void DidStartProvisionalLoad(
RenderFrameHostImpl* render_frame_host,
int parent_routing_id,
- bool is_main_frame,
const GURL& validated_url,
bool is_error_page,
bool is_iframe_srcdoc) {}
@@ -44,7 +43,6 @@ class CONTENT_EXPORT NavigatorDelegate {
virtual void DidFailLoadWithError(
RenderFrameHostImpl* render_frame_host,
const GURL& url,
- bool is_main_frame,
int error_code,
const base::string16& error_description) {}
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 12cd287..a411b96 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -134,7 +134,6 @@ NavigatorImpl::NavigatorImpl(
void NavigatorImpl::DidStartProvisionalLoad(
RenderFrameHostImpl* render_frame_host,
int parent_routing_id,
- bool is_main_frame,
const GURL& url) {
bool is_error_page = (url.spec() == kUnreachableWebDataURL);
bool is_iframe_srcdoc = (url.spec() == kAboutSrcDocURL);
@@ -142,16 +141,9 @@ void NavigatorImpl::DidStartProvisionalLoad(
RenderProcessHost* render_process_host = render_frame_host->GetProcess();
render_process_host->FilterURL(false, &validated_url);
- // TODO(creis): This is a hack for now, until we mirror the frame tree and do
- // cross-process subframe navigations in actual subframes. As a result, we
- // can currently only support a single cross-process subframe per RVH.
+ bool is_main_frame = render_frame_host->frame_tree_node()->IsMainFrame();
NavigationEntryImpl* pending_entry =
NavigationEntryImpl::FromNavigationEntry(controller_->GetPendingEntry());
- if (pending_entry &&
- pending_entry->frame_tree_node_id() != -1 &&
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess))
- is_main_frame = false;
-
if (is_main_frame) {
// If there is no browser-initiated pending entry for this navigation and it
// is not for the error URL, create a pending entry using the current
@@ -188,7 +180,7 @@ void NavigatorImpl::DidStartProvisionalLoad(
if (delegate_) {
// Notify the observer about the start of the provisional load.
delegate_->DidStartProvisionalLoad(
- render_frame_host, parent_routing_id, is_main_frame,
+ render_frame_host, parent_routing_id,
validated_url, is_error_page, is_iframe_srcdoc);
}
}
@@ -200,7 +192,6 @@ void NavigatorImpl::DidFailProvisionalLoadWithError(
VLOG(1) << "Failed Provisional Load: " << params.url.possibly_invalid_spec()
<< ", error_code: " << params.error_code
<< ", error_description: " << params.error_description
- << ", is_main_frame: " << params.is_main_frame
<< ", showing_repost_interstitial: " <<
params.showing_repost_interstitial
<< ", frame_id: " << render_frame_host->GetRoutingID();
@@ -258,12 +249,11 @@ void NavigatorImpl::DidFailProvisionalLoadWithError(
void NavigatorImpl::DidFailLoadWithError(
RenderFrameHostImpl* render_frame_host,
const GURL& url,
- bool is_main_frame,
int error_code,
const base::string16& error_description) {
if (delegate_) {
delegate_->DidFailLoadWithError(
- render_frame_host, url, is_main_frame, error_code,
+ render_frame_host, url, error_code,
error_description);
}
}
@@ -311,17 +301,8 @@ bool NavigatorImpl::NavigateToEntry(
return false;
}
- // Use entry->frame_tree_node_id() to pick which RenderFrameHostManager to
- // use when --site-per-process is used.
RenderFrameHostManager* manager =
render_frame_host->frame_tree_node()->render_manager();
- if (entry.frame_tree_node_id() != -1 &&
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) {
- int64 frame_tree_node_id = entry.frame_tree_node_id();
- manager = render_frame_host->frame_tree_node()->frame_tree()->FindByID(
- frame_tree_node_id)->render_manager();
- }
-
RenderFrameHostImpl* dest_render_frame_host = manager->Navigate(entry);
if (!dest_render_frame_host)
return false; // Unable to create the desired RenderFrameHost.
@@ -351,9 +332,6 @@ bool NavigatorImpl::NavigateToEntry(
current_load_start_ = base::TimeTicks::Now();
// Navigate in the desired RenderFrameHost.
- // TODO(creis): As a temporary hack, we currently do cross-process subframe
- // navigations in a top-level frame of the new process. Thus, we don't yet
- // need to store the correct frame ID in FrameMsg_Navigate_Params.
FrameMsg_Navigate_Params navigate_params;
MakeNavigateParams(entry, *controller_, reload_type, &navigate_params);
dest_render_frame_host->Navigate(navigate_params);
@@ -403,31 +381,18 @@ void NavigatorImpl::DidNavigate(
bool use_site_per_process =
CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess);
- // When using --site-per-process, look up the FrameTreeNode ID that the
- // renderer-specific frame ID corresponds to.
- int64 frame_tree_node_id = frame_tree->root()->frame_tree_node_id();
if (use_site_per_process) {
- frame_tree_node_id =
- render_frame_host->frame_tree_node()->frame_tree_node_id();
-
- // TODO(creis): In the short term, cross-process subframe navigations are
- // happening in the pending RenderViewHost's top-level frame. (We need to
- // both mirror the frame tree and get the navigation to occur in the correct
- // subframe to fix this.) Until then, we should check whether we have a
- // pending NavigationEntry with a frame ID and if so, treat the
- // cross-process "main frame" navigation as a subframe navigation. This
- // limits us to a single cross-process subframe per RVH, and it affects
- // NavigateToEntry, NavigatorImpl::DidStartProvisionalLoad, and
- // OnDidFinishLoad.
+ // TODO(creis): Until we mirror the frame tree in the subframe's process,
+ // cross-process subframe navigations happen in a renderer's main frame.
+ // Correct the transition type here if we know it is for a subframe.
NavigationEntryImpl* pending_entry =
NavigationEntryImpl::FromNavigationEntry(
controller_->GetPendingEntry());
- int root_ftn_id = frame_tree->root()->frame_tree_node_id();
- if (pending_entry &&
- pending_entry->frame_tree_node_id() != -1 &&
- pending_entry->frame_tree_node_id() != root_ftn_id) {
+ if (!render_frame_host->frame_tree_node()->IsMainFrame() &&
+ pending_entry &&
+ pending_entry->frame_tree_node_id() ==
+ render_frame_host->frame_tree_node()->frame_tree_node_id()) {
params.transition = PAGE_TRANSITION_AUTO_SUBFRAME;
- frame_tree_node_id = pending_entry->frame_tree_node_id();
}
}
@@ -448,7 +413,7 @@ void NavigatorImpl::DidNavigate(
// When using --site-per-process, we notify the RFHM for all navigations,
// not just main frame navigations.
if (use_site_per_process) {
- FrameTreeNode* frame = frame_tree->FindByID(frame_tree_node_id);
+ FrameTreeNode* frame = render_frame_host->frame_tree_node();
// TODO(creis): Rename to DidNavigateFrame.
frame->render_manager()->DidNavigateMainFrame(rvh);
}
diff --git a/content/browser/frame_host/navigator_impl.h b/content/browser/frame_host/navigator_impl.h
index 6c3bee3..47c3f37 100644
--- a/content/browser/frame_host/navigator_impl.h
+++ b/content/browser/frame_host/navigator_impl.h
@@ -26,7 +26,6 @@ class CONTENT_EXPORT NavigatorImpl : public Navigator {
// Navigator implementation.
virtual void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host,
int parent_routing_id,
- bool main_frame,
const GURL& url) OVERRIDE;
virtual void DidFailProvisionalLoadWithError(
RenderFrameHostImpl* render_frame_host,
@@ -35,7 +34,6 @@ class CONTENT_EXPORT NavigatorImpl : public Navigator {
virtual void DidFailLoadWithError(
RenderFrameHostImpl* render_frame_host,
const GURL& url,
- bool is_main_frame,
int error_code,
const base::string16& error_description) OVERRIDE;
virtual void DidRedirectProvisionalLoad(
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 4ed8a4c..0aa458b 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -323,10 +323,9 @@ void RenderFrameHostImpl::OnOpenURL(
void RenderFrameHostImpl::OnDidStartProvisionalLoadForFrame(
int parent_routing_id,
- bool is_main_frame,
const GURL& url) {
frame_tree_node_->navigator()->DidStartProvisionalLoad(
- this, parent_routing_id, is_main_frame, url);
+ this, parent_routing_id, url);
}
void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
@@ -336,15 +335,13 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
void RenderFrameHostImpl::OnDidFailLoadWithError(
const GURL& url,
- bool is_main_frame,
int error_code,
const base::string16& error_description) {
GURL validated_url(url);
GetProcess()->FilterURL(false, &validated_url);
frame_tree_node_->navigator()->DidFailLoadWithError(
- this, validated_url, is_main_frame, error_code,
- error_description);
+ this, validated_url, error_code, error_description);
}
void RenderFrameHostImpl::OnDidRedirectProvisionalLoad(
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h
index c268416..919b07f 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -165,13 +165,11 @@ class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost {
void OnFrameFocused();
void OnOpenURL(const FrameHostMsg_OpenURL_Params& params);
void OnDidStartProvisionalLoadForFrame(int parent_routing_id,
- bool main_frame,
const GURL& url);
void OnDidFailProvisionalLoadWithError(
const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params);
void OnDidFailLoadWithError(
const GURL& url,
- bool is_main_frame,
int error_code,
const base::string16& error_description);
void OnDidRedirectProvisionalLoad(int32 page_id,
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 6eeef4b..2751984 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1668,8 +1668,19 @@ bool WebContentsImpl::Send(IPC::Message* message) {
bool WebContentsImpl::NavigateToPendingEntry(
NavigationController::ReloadType reload_type) {
- return frame_tree_.root()->navigator()->NavigateToPendingEntry(
- frame_tree_.GetMainFrame(), reload_type);
+ FrameTreeNode* node = frame_tree_.root();
+
+ // If we are using --site-per-process, we should navigate in the FrameTreeNode
+ // specified in the pending entry.
+ NavigationEntryImpl* pending_entry =
+ NavigationEntryImpl::FromNavigationEntry(controller_.GetPendingEntry());
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) &&
+ pending_entry->frame_tree_node_id() != -1) {
+ node = frame_tree_.FindByID(pending_entry->frame_tree_node_id());
+ }
+
+ return node->navigator()->NavigateToPendingEntry(
+ node->current_frame_host(), reload_type);
}
void WebContentsImpl::RenderFrameForInterstitialPageCreated(
@@ -2052,21 +2063,13 @@ void WebContentsImpl::SetFocusToLocationBar(bool select_all) {
void WebContentsImpl::DidStartProvisionalLoad(
RenderFrameHostImpl* render_frame_host,
int parent_routing_id,
- bool is_main_frame,
const GURL& validated_url,
bool is_error_page,
bool is_iframe_srcdoc) {
+ bool is_main_frame = render_frame_host->frame_tree_node()->IsMainFrame();
if (is_main_frame)
DidChangeLoadProgress(0);
- // --site-per-process mode has a short-term hack allowing cross-process
- // subframe pages to commit thinking they are top-level. Correct it here to
- // avoid confusing the observers.
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) &&
- render_frame_host != GetMainFrame()) {
- is_main_frame = false;
- }
-
// Notify observers about the start of the provisional load.
int render_frame_id = render_frame_host->GetRoutingID();
RenderViewHost* render_view_host = render_frame_host->render_view_host();
@@ -2090,13 +2093,14 @@ void WebContentsImpl::DidFailProvisionalLoadWithError(
const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) {
GURL validated_url(params.url);
int render_frame_id = render_frame_host->GetRoutingID();
+ bool is_main_frame = render_frame_host->frame_tree_node()->IsMainFrame();
RenderViewHost* render_view_host = render_frame_host->render_view_host();
FOR_EACH_OBSERVER(
WebContentsObserver,
observers_,
DidFailProvisionalLoad(render_frame_id,
params.frame_unique_name,
- params.is_main_frame,
+ is_main_frame,
validated_url,
params.error_code,
params.error_description,
@@ -2106,14 +2110,14 @@ void WebContentsImpl::DidFailProvisionalLoadWithError(
void WebContentsImpl::DidFailLoadWithError(
RenderFrameHostImpl* render_frame_host,
const GURL& url,
- bool is_main_frame,
int error_code,
const base::string16& error_description) {
int render_frame_id = render_frame_host->GetRoutingID();
+ bool is_main_frame = render_frame_host->frame_tree_node()->IsMainFrame();
RenderViewHost* render_view_host = render_frame_host->render_view_host();
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
DidFailLoad(render_frame_id, url, is_main_frame, error_code,
- error_description, render_view_host));;
+ error_description, render_view_host));
}
void WebContentsImpl::NotifyChangedNavigationState(
@@ -2321,32 +2325,23 @@ void WebContentsImpl::OnDocumentLoadedInFrame() {
}
void WebContentsImpl::OnDidFinishLoad(
- const GURL& url,
- bool is_main_frame) {
+ const GURL& url) {
if (!render_frame_message_source_) {
RecordAction(base::UserMetricsAction("BadMessageTerminate_RVD2"));
GetRenderProcessHost()->ReceivedBadMessage();
return;
}
- RenderFrameHostImpl* rfh =
- static_cast<RenderFrameHostImpl*>(render_frame_message_source_);
-
- // --site-per-process mode has a short-term hack allowing cross-process
- // subframe pages to commit thinking they are top-level. Correct it here to
- // avoid confusing the observers.
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) &&
- rfh != GetMainFrame()) {
- is_main_frame = false;
- }
-
GURL validated_url(url);
RenderProcessHost* render_process_host =
render_frame_message_source_->GetProcess();
render_process_host->FilterURL(false, &validated_url);
+ RenderFrameHostImpl* rfh =
+ static_cast<RenderFrameHostImpl*>(render_frame_message_source_);
int render_frame_id = rfh->GetRoutingID();
RenderViewHost* render_view_host = rfh->render_view_host();
+ bool is_main_frame = rfh->frame_tree_node()->IsMainFrame();
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
DidFinishLoad(render_frame_id, validated_url,
is_main_frame, render_view_host));
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 7bbbce8..e6135d1 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -432,7 +432,6 @@ class CONTENT_EXPORT WebContentsImpl
virtual void DidStartProvisionalLoad(
RenderFrameHostImpl* render_frame_host,
int parent_routing_id,
- bool is_main_frame,
const GURL& validated_url,
bool is_error_page,
bool is_iframe_srcdoc) OVERRIDE;
@@ -443,7 +442,6 @@ class CONTENT_EXPORT WebContentsImpl
virtual void DidFailLoadWithError(
RenderFrameHostImpl* render_frame_host,
const GURL& url,
- bool is_main_frame,
int error_code,
const base::string16& error_description) OVERRIDE;
virtual void DidRedirectProvisionalLoad(
@@ -666,8 +664,7 @@ class CONTENT_EXPORT WebContentsImpl
void OnDidRunInsecureContent(const std::string& security_origin,
const GURL& target_url);
void OnDocumentLoadedInFrame();
- void OnDidFinishLoad(const GURL& url,
- bool is_main_frame);
+ void OnDidFinishLoad(const GURL& url);
void OnGoToEntryAtOffset(int offset);
void OnUpdateZoomLimits(int minimum_percent,
int maximum_percent,
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc
index 35b29ee..0c8f70c 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -2256,7 +2256,7 @@ TEST_F(WebContentsImplTest, FilterURLs) {
contents()->NavigateAndCommit(url_normalized);
// Check that an IPC with about:whatever is correctly normalized.
- contents()->TestDidFinishLoad(url_from_ipc, true);
+ contents()->TestDidFinishLoad(url_from_ipc);
EXPECT_EQ(url_normalized, observer.last_url());
@@ -2268,7 +2268,7 @@ TEST_F(WebContentsImplTest, FilterURLs) {
// Check that an IPC with about:whatever is correctly normalized.
other_contents->TestDidFailLoadWithError(
- url_from_ipc, true, 1, base::string16());
+ url_from_ipc, 1, base::string16());
EXPECT_EQ(url_normalized, other_observer.last_url());
}
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h
index 25c760b..1113bcd 100644
--- a/content/common/frame_messages.h
+++ b/content/common/frame_messages.h
@@ -76,8 +76,6 @@ IPC_STRUCT_TRAITS_END()
IPC_STRUCT_BEGIN(FrameHostMsg_DidFailProvisionalLoadWithError_Params)
// The WebFrame's uniqueName().
IPC_STRUCT_MEMBER(base::string16, frame_unique_name)
- // True if this is the top-most frame.
- IPC_STRUCT_MEMBER(bool, is_main_frame)
// Error code as reported in the DidFailProvisionalLoad callback.
IPC_STRUCT_MEMBER(int, error_code)
// An error message generated from the error_code. This can be an empty
@@ -338,9 +336,8 @@ IPC_MESSAGE_ROUTED0(FrameHostMsg_Detach)
IPC_MESSAGE_ROUTED0(FrameHostMsg_FrameFocused)
// Sent when the renderer starts a provisional load for a frame.
-IPC_MESSAGE_ROUTED3(FrameHostMsg_DidStartProvisionalLoadForFrame,
+IPC_MESSAGE_ROUTED2(FrameHostMsg_DidStartProvisionalLoadForFrame,
int32 /* parent_routing_id */,
- bool /* true if it is the main frame */,
GURL /* url */)
// Sent when the renderer fails a provisional load with an error.
@@ -362,9 +359,8 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_DidCommitProvisionalLoad,
// Notifies the browser that a document has been loaded.
IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFinishDocumentLoad)
-IPC_MESSAGE_ROUTED4(FrameHostMsg_DidFailLoadWithError,
+IPC_MESSAGE_ROUTED3(FrameHostMsg_DidFailLoadWithError,
GURL /* validated_url */,
- bool /* is_main_frame */,
int /* error_code */,
base::string16 /* error_description */)
@@ -381,9 +377,8 @@ IPC_MESSAGE_ROUTED0(FrameHostMsg_DidStopLoading)
IPC_MESSAGE_ROUTED1(FrameHostMsg_OpenURL, FrameHostMsg_OpenURL_Params)
// Notifies the browser that a frame finished loading.
-IPC_MESSAGE_ROUTED2(FrameHostMsg_DidFinishLoad,
- GURL /* validated_url */,
- bool /* is_main_frame */)
+IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFinishLoad,
+ GURL /* validated_url */)
// Following message is used to communicate the values received by the
// callback binding the JS to Cpp.
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index c399451..396fcac 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -1379,8 +1379,7 @@ void RenderFrameImpl::didStartProvisionalLoad(blink::WebFrame* frame) {
int parent_routing_id = frame->parent() ?
FromWebFrame(frame->parent())->GetRoutingID() : -1;
Send(new FrameHostMsg_DidStartProvisionalLoadForFrame(
- routing_id_, parent_routing_id,
- is_top_most, ds->request().url()));
+ routing_id_, parent_routing_id, ds->request().url()));
}
void RenderFrameImpl::didReceiveServerRedirectForProvisionalLoad(
@@ -1427,7 +1426,6 @@ void RenderFrameImpl::didFailProvisionalLoad(
FrameHostMsg_DidFailProvisionalLoadWithError_Params params;
params.frame_unique_name = frame->uniqueName();
- params.is_main_frame = !frame->parent();
params.error_code = error.reason;
GetContentClient()->renderer()->GetNavigationErrorStrings(
render_view_.get(),
@@ -1699,7 +1697,6 @@ void RenderFrameImpl::didFailLoad(blink::WebFrame* frame,
&error_description);
Send(new FrameHostMsg_DidFailLoadWithError(routing_id_,
failed_request.url(),
- !frame->parent(),
error.reason,
error_description));
}
@@ -1724,8 +1721,7 @@ void RenderFrameImpl::didFinishLoad(blink::WebFrame* frame) {
return;
Send(new FrameHostMsg_DidFinishLoad(routing_id_,
- ds->request().url(),
- !frame->parent()));
+ ds->request().url()));
}
void RenderFrameImpl::didNavigateWithinPage(blink::WebFrame* frame,
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc
index 3e77c7f..305fc73 100644
--- a/content/test/test_render_frame_host.cc
+++ b/content/test/test_render_frame_host.cc
@@ -56,7 +56,7 @@ void TestRenderFrameHost::SendNavigateWithTransitionAndResponseCode(
// DidStartProvisionalLoad may delete the pending entry that holds |url|,
// so we keep a copy of it to use in SendNavigateWithParameters.
GURL url_copy(url);
- OnDidStartProvisionalLoadForFrame(-1, true, url_copy);
+ OnDidStartProvisionalLoadForFrame(-1, url_copy);
SendNavigateWithParameters(
page_id, url_copy, transition, url_copy, response_code, 0);
}
@@ -65,7 +65,7 @@ void TestRenderFrameHost::SendNavigateWithOriginalRequestURL(
int page_id,
const GURL& url,
const GURL& original_request_url) {
- OnDidStartProvisionalLoadForFrame(-1, true, url);
+ OnDidStartProvisionalLoadForFrame(-1, url);
SendNavigateWithParameters(
page_id, url, PAGE_TRANSITION_LINK, original_request_url, 200, 0);
}
diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc
index 260e209..900c850 100644
--- a/content/test/test_web_contents.cc
+++ b/content/test/test_web_contents.cc
@@ -207,19 +207,17 @@ void TestWebContents::SetHistoryLengthAndPrune(
EXPECT_EQ(expect_set_history_length_and_prune_min_page_id_, min_page_id);
}
-void TestWebContents::TestDidFinishLoad(const GURL& url,
- bool is_main_frame) {
- FrameHostMsg_DidFinishLoad msg(0, url, is_main_frame);
+void TestWebContents::TestDidFinishLoad(const GURL& url) {
+ FrameHostMsg_DidFinishLoad msg(0, url);
frame_tree_.root()->current_frame_host()->OnMessageReceived(msg);
}
void TestWebContents::TestDidFailLoadWithError(
const GURL& url,
- bool is_main_frame,
int error_code,
const base::string16& error_description) {
FrameHostMsg_DidFailLoadWithError msg(
- 0, url, is_main_frame, error_code, error_description);
+ 0, url, error_code, error_description);
frame_tree_.root()->current_frame_host()->OnMessageReceived(msg);
}
diff --git a/content/test/test_web_contents.h b/content/test/test_web_contents.h
index 18b70138..a0d6825 100644
--- a/content/test/test_web_contents.h
+++ b/content/test/test_web_contents.h
@@ -94,9 +94,8 @@ class TestWebContents : public WebContentsImpl, public WebContentsTester {
int history_length,
int32 min_page_id) OVERRIDE;
- void TestDidFinishLoad(const GURL& url, bool is_main_frame);
+ void TestDidFinishLoad(const GURL& url);
void TestDidFailLoadWithError(const GURL& url,
- bool is_main_frame,
int error_code,
const base::string16& error_description);