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

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 8142032: Add error description to the DidFailProvisionalLoad callback. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 2 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/tab_contents/tab_contents.cc
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 21350104467a07555f48576a1848825f3b59ddfe..262d6f6fa6fc6a57be990f08ace08c2178b23ae4 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -912,21 +912,20 @@ void TabContents::OnDidRedirectProvisionalLoad(int32 page_id,
}
void TabContents::OnDidFailProvisionalLoadWithError(
- int64 frame_id,
- bool is_main_frame,
- int error_code,
- const GURL& url,
- bool showing_repost_interstitial) {
- VLOG(1) << "Failed Provisional Load: " << url.possibly_invalid_spec()
- << ", error_code: " << error_code
- << " is_main_frame: " << is_main_frame
- << " showing_repost_interstitial: " << showing_repost_interstitial
- << " frame_id: " << frame_id;
- GURL validated_url(url);
+ const ViewHostMsg_DidFailProvisionalLoadWithError_Params& ipc_params) {
jam 2011/10/05 17:12:06 nit: here and elsewhere, we usually just call this
mkosiba (inactive) 2011/10/05 17:53:18 Done.
+ VLOG(1) << "Failed Provisional Load: " <<
+ ipc_params.url.possibly_invalid_spec()
+ << ", error_code: " << ipc_params.error_code
+ << ", error_description: " << ipc_params.error_description
+ << ", is_main_frame: " << ipc_params.is_main_frame
+ << ", showing_repost_interstitial: " <<
+ ipc_params.showing_repost_interstitial
+ << ", frame_id: " << ipc_params.frame_id;
+ GURL validated_url(ipc_params.url);
render_view_host()->FilterURL(ChildProcessSecurityPolicy::GetInstance(),
GetRenderProcessHost()->id(), &validated_url);
- if (net::ERR_ABORTED == error_code) {
+ if (net::ERR_ABORTED == ipc_params.error_code) {
// EVIL HACK ALERT! Ignore failed loads when we're showing interstitials.
// This means that the interstitial won't be torn down properly, which is
// bad. But if we have an interstitial, go back to another tab type, and
@@ -967,18 +966,26 @@ void TabContents::OnDidFailProvisionalLoadWithError(
// Send out a notification that we failed a provisional load with an error.
ProvisionalLoadDetails details(
- is_main_frame, controller_.IsURLInPageNavigation(validated_url),
- validated_url, std::string(), false, frame_id);
- details.set_error_code(error_code);
+ ipc_params.is_main_frame,
+ controller_.IsURLInPageNavigation(validated_url),
+ validated_url,
+ std::string(),
+ false,
+ ipc_params.frame_id);
+ details.set_error_code(ipc_params.error_code);
NotificationService::current()->Notify(
content::NOTIFICATION_FAIL_PROVISIONAL_LOAD_WITH_ERROR,
Source<NavigationController>(&controller_),
Details<ProvisionalLoadDetails>(&details));
- FOR_EACH_OBSERVER(TabContentsObserver, observers_,
- DidFailProvisionalLoad(frame_id, is_main_frame,
- validated_url, error_code));
+ FOR_EACH_OBSERVER(TabContentsObserver,
+ observers_,
+ DidFailProvisionalLoad(ipc_params.frame_id,
+ ipc_params.is_main_frame,
+ validated_url,
+ ipc_params.error_code,
+ ipc_params.error_description));
}
void TabContents::OnDidLoadResourceFromMemoryCache(

Powered by Google App Engine
This is Rietveld 408576698