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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 1044923003: Add the WebHistoryCommitType to didFailProvisionalLoad, part 3. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@committype1
Patch Set: fix Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 2459 matching lines...) Expand 10 before | Expand all | Expand 10 after
2470 Send(new FrameHostMsg_DidStartProvisionalLoadForFrame( 2470 Send(new FrameHostMsg_DidStartProvisionalLoadForFrame(
2471 routing_id_, ds->request().url(), is_transition_navigation)); 2471 routing_id_, ds->request().url(), is_transition_navigation));
2472 } 2472 }
2473 2473
2474 void RenderFrameImpl::didReceiveServerRedirectForProvisionalLoad( 2474 void RenderFrameImpl::didReceiveServerRedirectForProvisionalLoad(
2475 blink::WebLocalFrame* frame) { 2475 blink::WebLocalFrame* frame) {
2476 DCHECK(!frame_ || frame_ == frame); 2476 DCHECK(!frame_ || frame_ == frame);
2477 render_view_->history_controller()->RemoveChildrenForRedirect(this); 2477 render_view_->history_controller()->RemoveChildrenForRedirect(this);
2478 } 2478 }
2479 2479
2480 void RenderFrameImpl::didFailProvisionalLoad(blink::WebLocalFrame* frame, 2480 void RenderFrameImpl::didFailProvisionalLoad(
2481 const blink::WebURLError& error) { 2481 blink::WebLocalFrame* frame,
2482 const blink::WebURLError& error,
2483 blink::WebHistoryCommitType commit_type) {
2482 TRACE_EVENT1("navigation", "RenderFrameImpl::didFailProvisionalLoad", 2484 TRACE_EVENT1("navigation", "RenderFrameImpl::didFailProvisionalLoad",
2483 "id", routing_id_); 2485 "id", routing_id_);
2484 DCHECK(!frame_ || frame_ == frame); 2486 DCHECK(!frame_ || frame_ == frame);
2485 WebDataSource* ds = frame->provisionalDataSource(); 2487 WebDataSource* ds = frame->provisionalDataSource();
2486 DCHECK(ds); 2488 DCHECK(ds);
2487 2489
2488 const WebURLRequest& failed_request = ds->request(); 2490 const WebURLRequest& failed_request = ds->request();
2489 2491
2490 // Notify the browser that we failed a provisional load with an error. 2492 // Notify the browser that we failed a provisional load with an error.
2491 // 2493 //
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
2567 navigation_state->common_params(), navigation_state->start_params(), 2569 navigation_state->common_params(), navigation_state->start_params(),
2568 navigation_state->request_params())); 2570 navigation_state->request_params()));
2569 pending_navigation_params_->request_params.request_time = 2571 pending_navigation_params_->request_params.request_time =
2570 document_state->request_time(); 2572 document_state->request_time();
2571 } 2573 }
2572 2574
2573 // Load an error page. 2575 // Load an error page.
2574 LoadNavigationErrorPage(failed_request, error, replace); 2576 LoadNavigationErrorPage(failed_request, error, replace);
2575 } 2577 }
2576 2578
2577 void RenderFrameImpl::didFailProvisionalLoad(
2578 blink::WebLocalFrame* frame,
2579 const blink::WebURLError& error,
2580 blink::WebHistoryCommitType commit_type) {
2581 didFailProvisionalLoad(frame, error);
2582 }
2583
2584 void RenderFrameImpl::didCommitProvisionalLoad( 2579 void RenderFrameImpl::didCommitProvisionalLoad(
2585 blink::WebLocalFrame* frame, 2580 blink::WebLocalFrame* frame,
2586 const blink::WebHistoryItem& item, 2581 const blink::WebHistoryItem& item,
2587 blink::WebHistoryCommitType commit_type) { 2582 blink::WebHistoryCommitType commit_type) {
2588 TRACE_EVENT2("navigation", "RenderFrameImpl::didCommitProvisionalLoad", 2583 TRACE_EVENT2("navigation", "RenderFrameImpl::didCommitProvisionalLoad",
2589 "id", routing_id_, 2584 "id", routing_id_,
2590 "url", GetLoadingUrl().possibly_invalid_spec()); 2585 "url", GetLoadingUrl().possibly_invalid_spec());
2591 DCHECK(!frame_ || frame_ == frame); 2586 DCHECK(!frame_ || frame_ == frame);
2592 DocumentState* document_state = 2587 DocumentState* document_state =
2593 DocumentState::FromDataSource(frame->dataSource()); 2588 DocumentState::FromDataSource(frame->dataSource());
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
2814 base::TimeTicks ui_timestamp = base::TimeTicks() + 2809 base::TimeTicks ui_timestamp = base::TimeTicks() +
2815 base::TimeDelta::FromSecondsD( 2810 base::TimeDelta::FromSecondsD(
2816 frame->dataSource()->request().uiStartTime()); 2811 frame->dataSource()->request().uiStartTime());
2817 2812
2818 Send(new FrameHostMsg_DocumentOnLoadCompleted( 2813 Send(new FrameHostMsg_DocumentOnLoadCompleted(
2819 routing_id_, report_type, ui_timestamp)); 2814 routing_id_, report_type, ui_timestamp));
2820 } 2815 }
2821 } 2816 }
2822 2817
2823 void RenderFrameImpl::didFailLoad(blink::WebLocalFrame* frame, 2818 void RenderFrameImpl::didFailLoad(blink::WebLocalFrame* frame,
2824 const blink::WebURLError& error) { 2819 const blink::WebURLError& error,
2820 blink::WebHistoryCommitType commit_type) {
2825 TRACE_EVENT1("navigation", "RenderFrameImpl::didFailLoad", 2821 TRACE_EVENT1("navigation", "RenderFrameImpl::didFailLoad",
2826 "id", routing_id_); 2822 "id", routing_id_);
2827 DCHECK(!frame_ || frame_ == frame); 2823 DCHECK(!frame_ || frame_ == frame);
2828 // TODO(nasko): Move implementation here. No state needed. 2824 // TODO(nasko): Move implementation here. No state needed.
2829 WebDataSource* ds = frame->dataSource(); 2825 WebDataSource* ds = frame->dataSource();
2830 DCHECK(ds); 2826 DCHECK(ds);
2831 2827
2832 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), 2828 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(),
2833 DidFailLoad(frame, error)); 2829 DidFailLoad(frame, error));
2834 2830
2835 const WebURLRequest& failed_request = ds->request(); 2831 const WebURLRequest& failed_request = ds->request();
2836 base::string16 error_description; 2832 base::string16 error_description;
2837 GetContentClient()->renderer()->GetNavigationErrorStrings( 2833 GetContentClient()->renderer()->GetNavigationErrorStrings(
2838 render_view_.get(), 2834 render_view_.get(),
2839 frame, 2835 frame,
2840 failed_request, 2836 failed_request,
2841 error, 2837 error,
2842 NULL, 2838 NULL,
2843 &error_description); 2839 &error_description);
2844 Send(new FrameHostMsg_DidFailLoadWithError(routing_id_, 2840 Send(new FrameHostMsg_DidFailLoadWithError(routing_id_,
2845 failed_request.url(), 2841 failed_request.url(),
2846 error.reason, 2842 error.reason,
2847 error_description)); 2843 error_description));
2848 } 2844 }
2849 2845
2850 void RenderFrameImpl::didFailLoad(blink::WebLocalFrame* frame,
2851 const blink::WebURLError& error,
2852 blink::WebHistoryCommitType commit_type) {
2853 didFailLoad(frame, error);
2854 }
2855
2856 void RenderFrameImpl::didFinishLoad(blink::WebLocalFrame* frame) { 2846 void RenderFrameImpl::didFinishLoad(blink::WebLocalFrame* frame) {
2857 TRACE_EVENT1("navigation", "RenderFrameImpl::didFinishLoad", 2847 TRACE_EVENT1("navigation", "RenderFrameImpl::didFinishLoad",
2858 "id", routing_id_); 2848 "id", routing_id_);
2859 DCHECK(!frame_ || frame_ == frame); 2849 DCHECK(!frame_ || frame_ == frame);
2860 WebDataSource* ds = frame->dataSource(); 2850 WebDataSource* ds = frame->dataSource();
2861 DocumentState* document_state = DocumentState::FromDataSource(ds); 2851 DocumentState* document_state = DocumentState::FromDataSource(ds);
2862 if (document_state->finish_load_time().is_null()) { 2852 if (document_state->finish_load_time().is_null()) {
2863 if (!frame->parent()) { 2853 if (!frame->parent()) {
2864 TRACE_EVENT_INSTANT0("WebCore", "LoadFinished", 2854 TRACE_EVENT_INSTANT0("WebCore", "LoadFinished",
2865 TRACE_EVENT_SCOPE_PROCESS); 2855 TRACE_EVENT_SCOPE_PROCESS);
(...skipping 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after
4701 4691
4702 #if defined(ENABLE_BROWSER_CDMS) 4692 #if defined(ENABLE_BROWSER_CDMS)
4703 RendererCdmManager* RenderFrameImpl::GetCdmManager() { 4693 RendererCdmManager* RenderFrameImpl::GetCdmManager() {
4704 if (!cdm_manager_) 4694 if (!cdm_manager_)
4705 cdm_manager_ = new RendererCdmManager(this); 4695 cdm_manager_ = new RendererCdmManager(this);
4706 return cdm_manager_; 4696 return cdm_manager_;
4707 } 4697 }
4708 #endif // defined(ENABLE_BROWSER_CDMS) 4698 #endif // defined(ENABLE_BROWSER_CDMS)
4709 4699
4710 } // namespace content 4700 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698