Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/render_view.h" | 5 #include "content/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 2322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2333 DCHECK(ds); | 2333 DCHECK(ds); |
| 2334 | 2334 |
| 2335 const WebURLRequest& failed_request = ds->request(); | 2335 const WebURLRequest& failed_request = ds->request(); |
| 2336 | 2336 |
| 2337 FOR_EACH_OBSERVER( | 2337 FOR_EACH_OBSERVER( |
| 2338 RenderViewObserver, observers_, DidFailProvisionalLoad(frame, error)); | 2338 RenderViewObserver, observers_, DidFailProvisionalLoad(frame, error)); |
| 2339 | 2339 |
| 2340 bool show_repost_interstitial = | 2340 bool show_repost_interstitial = |
| 2341 (error.reason == net::ERR_CACHE_MISS && | 2341 (error.reason == net::ERR_CACHE_MISS && |
| 2342 EqualsASCII(failed_request.httpMethod(), "POST")); | 2342 EqualsASCII(failed_request.httpMethod(), "POST")); |
| 2343 Send(new ViewHostMsg_DidFailProvisionalLoadWithError( | 2343 |
| 2344 routing_id_, frame->identifier(), !frame->parent(), error.reason, | 2344 { |
|
jam
2011/10/05 17:12:06
nit: adding an extra scope here is unnecessary. we
mkosiba (inactive)
2011/10/05 17:53:18
Done.
| |
| 2345 error.unreachableURL, show_repost_interstitial)); | 2345 ViewHostMsg_DidFailProvisionalLoadWithError_Params ipc_params; |
| 2346 ipc_params.frame_id = frame->identifier(); | |
| 2347 ipc_params.is_main_frame = !frame->parent(); | |
| 2348 ipc_params.error_code = error.reason; | |
| 2349 ipc_params.error_description = content::GetContentClient()->renderer()-> | |
| 2350 GetNavigationErrorDescription(failed_request, error); | |
| 2351 ipc_params.url = error.unreachableURL; | |
| 2352 ipc_params.showing_repost_interstitial = show_repost_interstitial; | |
| 2353 Send(new ViewHostMsg_DidFailProvisionalLoadWithError( | |
| 2354 routing_id_, ipc_params)); | |
| 2355 } | |
| 2346 | 2356 |
| 2347 // Don't display an error page if this is simply a cancelled load. Aside | 2357 // Don't display an error page if this is simply a cancelled load. Aside |
| 2348 // from being dumb, WebCore doesn't expect it and it will cause a crash. | 2358 // from being dumb, WebCore doesn't expect it and it will cause a crash. |
| 2349 if (error.reason == net::ERR_ABORTED) | 2359 if (error.reason == net::ERR_ABORTED) |
| 2350 return; | 2360 return; |
| 2351 | 2361 |
| 2352 // Make sure we never show errors in view source mode. | 2362 // Make sure we never show errors in view source mode. |
| 2353 frame->enableViewSourceMode(false); | 2363 frame->enableViewSourceMode(false); |
| 2354 | 2364 |
| 2355 NavigationState* navigation_state = NavigationState::FromDataSource(ds); | 2365 NavigationState* navigation_state = NavigationState::FromDataSource(ds); |
| (...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4401 main_frame->enableViewSourceMode(true); | 4411 main_frame->enableViewSourceMode(true); |
| 4402 } | 4412 } |
| 4403 | 4413 |
| 4404 void RenderView::OnLockMouseACK(bool succeeded) { | 4414 void RenderView::OnLockMouseACK(bool succeeded) { |
| 4405 pepper_delegate_.OnLockMouseACK(succeeded); | 4415 pepper_delegate_.OnLockMouseACK(succeeded); |
| 4406 } | 4416 } |
| 4407 | 4417 |
| 4408 void RenderView::OnMouseLockLost() { | 4418 void RenderView::OnMouseLockLost() { |
| 4409 pepper_delegate_.OnMouseLockLost(); | 4419 pepper_delegate_.OnMouseLockLost(); |
| 4410 } | 4420 } |
| 4411 | |
| OLD | NEW |