OLD | NEW |
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 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 // use the unreachable URL as the original URL. | 385 // use the unreachable URL as the original URL. |
386 if (ds->hasUnreachableURL()) { | 386 if (ds->hasUnreachableURL()) { |
387 *output = ds->unreachableURL(); | 387 *output = ds->unreachableURL(); |
388 return true; | 388 return true; |
389 } | 389 } |
390 | 390 |
391 return false; | 391 return false; |
392 } | 392 } |
393 | 393 |
394 // Returns the original request url. If there is no redirect, the original | 394 // Returns the original request url. If there is no redirect, the original |
395 // url is the same as ds->request()->url(). If the WebDataSource belongs to a | 395 // url is the same as ds->getRequest()->url(). If the WebDataSource belongs to a |
396 // frame was loaded by loadData, the original url will be ds->unreachableURL() | 396 // frame was loaded by loadData, the original url will be ds->unreachableURL() |
397 GURL GetOriginalRequestURL(WebDataSource* ds) { | 397 GURL GetOriginalRequestURL(WebDataSource* ds) { |
398 GURL overriden_url; | 398 GURL overriden_url; |
399 if (MaybeGetOverriddenURL(ds, &overriden_url)) | 399 if (MaybeGetOverriddenURL(ds, &overriden_url)) |
400 return overriden_url; | 400 return overriden_url; |
401 | 401 |
402 std::vector<GURL> redirects; | 402 std::vector<GURL> redirects; |
403 GetRedirectChain(ds, &redirects); | 403 GetRedirectChain(ds, &redirects); |
404 if (!redirects.empty()) | 404 if (!redirects.empty()) |
405 return redirects.at(0); | 405 return redirects.at(0); |
(...skipping 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2485 } | 2485 } |
2486 | 2486 |
2487 void RenderFrameImpl::loadErrorPage(int reason) { | 2487 void RenderFrameImpl::loadErrorPage(int reason) { |
2488 blink::WebURLError error; | 2488 blink::WebURLError error; |
2489 error.unreachableURL = frame_->document().url(); | 2489 error.unreachableURL = frame_->document().url(); |
2490 error.domain = WebString::fromUTF8(net::kErrorDomain); | 2490 error.domain = WebString::fromUTF8(net::kErrorDomain); |
2491 error.reason = reason; | 2491 error.reason = reason; |
2492 | 2492 |
2493 std::string error_html; | 2493 std::string error_html; |
2494 GetContentClient()->renderer()->GetNavigationErrorStrings( | 2494 GetContentClient()->renderer()->GetNavigationErrorStrings( |
2495 this, frame_->dataSource()->request(), error, &error_html, nullptr); | 2495 this, frame_->dataSource()->getRequest(), error, &error_html, nullptr); |
2496 | 2496 |
2497 frame_->loadData(error_html, WebString::fromUTF8("text/html"), | 2497 frame_->loadData(error_html, WebString::fromUTF8("text/html"), |
2498 WebString::fromUTF8("UTF-8"), GURL(kUnreachableWebDataURL), | 2498 WebString::fromUTF8("UTF-8"), GURL(kUnreachableWebDataURL), |
2499 error.unreachableURL, true, | 2499 error.unreachableURL, true, |
2500 blink::WebFrameLoadType::Standard, blink::WebHistoryItem(), | 2500 blink::WebFrameLoadType::Standard, blink::WebHistoryItem(), |
2501 blink::WebHistoryDifferentDocumentLoad, true); | 2501 blink::WebHistoryDifferentDocumentLoad, true); |
2502 } | 2502 } |
2503 | 2503 |
2504 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) { | 2504 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) { |
2505 OnJavaScriptExecuteRequest(javascript, 0, false); | 2505 OnJavaScriptExecuteRequest(javascript, 0, false); |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3376 DCHECK_EQ(frame_, frame); | 3376 DCHECK_EQ(frame_, frame); |
3377 WebDataSource* ds = frame->provisionalDataSource(); | 3377 WebDataSource* ds = frame->provisionalDataSource(); |
3378 | 3378 |
3379 // In fast/loader/stop-provisional-loads.html, we abort the load before this | 3379 // In fast/loader/stop-provisional-loads.html, we abort the load before this |
3380 // callback is invoked. | 3380 // callback is invoked. |
3381 if (!ds) | 3381 if (!ds) |
3382 return; | 3382 return; |
3383 | 3383 |
3384 TRACE_EVENT2("navigation,benchmark,rail", | 3384 TRACE_EVENT2("navigation,benchmark,rail", |
3385 "RenderFrameImpl::didStartProvisionalLoad", "id", routing_id_, | 3385 "RenderFrameImpl::didStartProvisionalLoad", "id", routing_id_, |
3386 "url", ds->request().url().string().utf8()); | 3386 "url", ds->getRequest().url().string().utf8()); |
3387 DocumentState* document_state = DocumentState::FromDataSource(ds); | 3387 DocumentState* document_state = DocumentState::FromDataSource(ds); |
3388 NavigationStateImpl* navigation_state = static_cast<NavigationStateImpl*>( | 3388 NavigationStateImpl* navigation_state = static_cast<NavigationStateImpl*>( |
3389 document_state->navigation_state()); | 3389 document_state->navigation_state()); |
3390 bool is_top_most = !frame->parent(); | 3390 bool is_top_most = !frame->parent(); |
3391 if (is_top_most) { | 3391 if (is_top_most) { |
3392 render_view_->set_navigation_gesture( | 3392 render_view_->set_navigation_gesture( |
3393 WebUserGestureIndicator::isProcessingUserGesture() ? | 3393 WebUserGestureIndicator::isProcessingUserGesture() ? |
3394 NavigationGestureUser : NavigationGestureAuto); | 3394 NavigationGestureUser : NavigationGestureAuto); |
3395 } else if (ds->replacesCurrentHistoryItem()) { | 3395 } else if (ds->replacesCurrentHistoryItem()) { |
3396 // Subframe navigations that don't add session history items must be | 3396 // Subframe navigations that don't add session history items must be |
3397 // marked with AUTO_SUBFRAME. See also didFailProvisionalLoad for how we | 3397 // marked with AUTO_SUBFRAME. See also didFailProvisionalLoad for how we |
3398 // handle loading of error pages. | 3398 // handle loading of error pages. |
3399 navigation_state->set_transition_type(ui::PAGE_TRANSITION_AUTO_SUBFRAME); | 3399 navigation_state->set_transition_type(ui::PAGE_TRANSITION_AUTO_SUBFRAME); |
3400 } | 3400 } |
3401 | 3401 |
3402 base::TimeTicks navigation_start = | 3402 base::TimeTicks navigation_start = |
3403 navigation_state->common_params().navigation_start; | 3403 navigation_state->common_params().navigation_start; |
3404 DCHECK(!navigation_start.is_null()); | 3404 DCHECK(!navigation_start.is_null()); |
3405 | 3405 |
3406 for (auto& observer : render_view_->observers()) | 3406 for (auto& observer : render_view_->observers()) |
3407 observer.DidStartProvisionalLoad(frame); | 3407 observer.DidStartProvisionalLoad(frame); |
3408 for (auto& observer : observers_) | 3408 for (auto& observer : observers_) |
3409 observer.DidStartProvisionalLoad(); | 3409 observer.DidStartProvisionalLoad(); |
3410 | 3410 |
3411 Send(new FrameHostMsg_DidStartProvisionalLoad( | 3411 Send(new FrameHostMsg_DidStartProvisionalLoad( |
3412 routing_id_, ds->request().url(), navigation_start)); | 3412 routing_id_, ds->getRequest().url(), navigation_start)); |
3413 } | 3413 } |
3414 | 3414 |
3415 void RenderFrameImpl::didReceiveServerRedirectForProvisionalLoad( | 3415 void RenderFrameImpl::didReceiveServerRedirectForProvisionalLoad( |
3416 blink::WebLocalFrame* frame) { | 3416 blink::WebLocalFrame* frame) { |
3417 DCHECK_EQ(frame_, frame); | 3417 DCHECK_EQ(frame_, frame); |
3418 | 3418 |
3419 // We don't use HistoryController in OOPIF enabled modes. | 3419 // We don't use HistoryController in OOPIF enabled modes. |
3420 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) | 3420 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) |
3421 return; | 3421 return; |
3422 | 3422 |
3423 render_view_->history_controller()->RemoveChildrenForRedirect(this); | 3423 render_view_->history_controller()->RemoveChildrenForRedirect(this); |
3424 } | 3424 } |
3425 | 3425 |
3426 void RenderFrameImpl::didFailProvisionalLoad( | 3426 void RenderFrameImpl::didFailProvisionalLoad( |
3427 blink::WebLocalFrame* frame, | 3427 blink::WebLocalFrame* frame, |
3428 const blink::WebURLError& error, | 3428 const blink::WebURLError& error, |
3429 blink::WebHistoryCommitType commit_type) { | 3429 blink::WebHistoryCommitType commit_type) { |
3430 TRACE_EVENT1("navigation,benchmark,rail", | 3430 TRACE_EVENT1("navigation,benchmark,rail", |
3431 "RenderFrameImpl::didFailProvisionalLoad", "id", routing_id_); | 3431 "RenderFrameImpl::didFailProvisionalLoad", "id", routing_id_); |
3432 DCHECK_EQ(frame_, frame); | 3432 DCHECK_EQ(frame_, frame); |
3433 WebDataSource* ds = frame->provisionalDataSource(); | 3433 WebDataSource* ds = frame->provisionalDataSource(); |
3434 DCHECK(ds); | 3434 DCHECK(ds); |
3435 | 3435 |
3436 const WebURLRequest& failed_request = ds->request(); | 3436 const WebURLRequest& failed_request = ds->getRequest(); |
3437 | 3437 |
3438 // Notify the browser that we failed a provisional load with an error. | 3438 // Notify the browser that we failed a provisional load with an error. |
3439 // | 3439 // |
3440 // Note: It is important this notification occur before DidStopLoading so the | 3440 // Note: It is important this notification occur before DidStopLoading so the |
3441 // SSL manager can react to the provisional load failure before being | 3441 // SSL manager can react to the provisional load failure before being |
3442 // notified the load stopped. | 3442 // notified the load stopped. |
3443 // | 3443 // |
3444 for (auto& observer : render_view_->observers()) | 3444 for (auto& observer : render_view_->observers()) |
3445 observer.DidFailProvisionalLoad(frame, error); | 3445 observer.DidFailProvisionalLoad(frame, error); |
3446 for (auto& observer : observers_) | 3446 for (auto& observer : observers_) |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3830 InternalDocumentStateData* internal_data = | 3830 InternalDocumentStateData* internal_data = |
3831 InternalDocumentStateData::FromDataSource(frame->dataSource()); | 3831 InternalDocumentStateData::FromDataSource(frame->dataSource()); |
3832 int http_status_code = internal_data->http_status_code(); | 3832 int http_status_code = internal_data->http_status_code(); |
3833 if (GetContentClient()->renderer()->HasErrorPage(http_status_code, | 3833 if (GetContentClient()->renderer()->HasErrorPage(http_status_code, |
3834 &error_domain)) { | 3834 &error_domain)) { |
3835 WebURLError error; | 3835 WebURLError error; |
3836 error.unreachableURL = frame->document().url(); | 3836 error.unreachableURL = frame->document().url(); |
3837 error.domain = WebString::fromUTF8(error_domain); | 3837 error.domain = WebString::fromUTF8(error_domain); |
3838 error.reason = http_status_code; | 3838 error.reason = http_status_code; |
3839 // This call may run scripts, e.g. via the beforeunload event. | 3839 // This call may run scripts, e.g. via the beforeunload event. |
3840 LoadNavigationErrorPage(frame->dataSource()->request(), error, true, | 3840 LoadNavigationErrorPage(frame->dataSource()->getRequest(), error, true, |
3841 nullptr); | 3841 nullptr); |
3842 } | 3842 } |
3843 // Do not use |this| or |frame| here without checking |weak_self|. | 3843 // Do not use |this| or |frame| here without checking |weak_self|. |
3844 } | 3844 } |
3845 | 3845 |
3846 void RenderFrameImpl::didHandleOnloadEvents(blink::WebLocalFrame* frame) { | 3846 void RenderFrameImpl::didHandleOnloadEvents(blink::WebLocalFrame* frame) { |
3847 DCHECK_EQ(frame_, frame); | 3847 DCHECK_EQ(frame_, frame); |
3848 if (!frame->parent()) { | 3848 if (!frame->parent()) { |
3849 FrameMsg_UILoadMetricsReportType::Value report_type = | 3849 FrameMsg_UILoadMetricsReportType::Value report_type = |
3850 static_cast<FrameMsg_UILoadMetricsReportType::Value>( | 3850 static_cast<FrameMsg_UILoadMetricsReportType::Value>( |
3851 frame->dataSource()->request().inputPerfMetricReportPolicy()); | 3851 frame->dataSource()->getRequest().inputPerfMetricReportPolicy()); |
3852 base::TimeTicks ui_timestamp = base::TimeTicks() + | 3852 base::TimeTicks ui_timestamp = |
| 3853 base::TimeTicks() + |
3853 base::TimeDelta::FromSecondsD( | 3854 base::TimeDelta::FromSecondsD( |
3854 frame->dataSource()->request().uiStartTime()); | 3855 frame->dataSource()->getRequest().uiStartTime()); |
3855 | 3856 |
3856 Send(new FrameHostMsg_DocumentOnLoadCompleted( | 3857 Send(new FrameHostMsg_DocumentOnLoadCompleted( |
3857 routing_id_, report_type, ui_timestamp)); | 3858 routing_id_, report_type, ui_timestamp)); |
3858 } | 3859 } |
3859 } | 3860 } |
3860 | 3861 |
3861 void RenderFrameImpl::didFailLoad(blink::WebLocalFrame* frame, | 3862 void RenderFrameImpl::didFailLoad(blink::WebLocalFrame* frame, |
3862 const blink::WebURLError& error, | 3863 const blink::WebURLError& error, |
3863 blink::WebHistoryCommitType commit_type) { | 3864 blink::WebHistoryCommitType commit_type) { |
3864 TRACE_EVENT1("navigation,rail", "RenderFrameImpl::didFailLoad", | 3865 TRACE_EVENT1("navigation,rail", "RenderFrameImpl::didFailLoad", |
3865 "id", routing_id_); | 3866 "id", routing_id_); |
3866 DCHECK_EQ(frame_, frame); | 3867 DCHECK_EQ(frame_, frame); |
3867 // TODO(nasko): Move implementation here. No state needed. | 3868 // TODO(nasko): Move implementation here. No state needed. |
3868 WebDataSource* ds = frame->dataSource(); | 3869 WebDataSource* ds = frame->dataSource(); |
3869 DCHECK(ds); | 3870 DCHECK(ds); |
3870 | 3871 |
3871 for (auto& observer : render_view_->observers()) | 3872 for (auto& observer : render_view_->observers()) |
3872 observer.DidFailLoad(frame, error); | 3873 observer.DidFailLoad(frame, error); |
3873 | 3874 |
3874 const WebURLRequest& failed_request = ds->request(); | 3875 const WebURLRequest& failed_request = ds->getRequest(); |
3875 base::string16 error_description; | 3876 base::string16 error_description; |
3876 GetContentClient()->renderer()->GetNavigationErrorStrings( | 3877 GetContentClient()->renderer()->GetNavigationErrorStrings( |
3877 this, | 3878 this, |
3878 failed_request, | 3879 failed_request, |
3879 error, | 3880 error, |
3880 nullptr, | 3881 nullptr, |
3881 &error_description); | 3882 &error_description); |
3882 Send(new FrameHostMsg_DidFailLoadWithError(routing_id_, | 3883 Send(new FrameHostMsg_DidFailLoadWithError(routing_id_, |
3883 failed_request.url(), | 3884 failed_request.url(), |
3884 error.reason, | 3885 error.reason, |
3885 error_description, | 3886 error_description, |
3886 error.wasIgnoredByHandler)); | 3887 error.wasIgnoredByHandler)); |
3887 } | 3888 } |
3888 | 3889 |
3889 void RenderFrameImpl::didFinishLoad(blink::WebLocalFrame* frame) { | 3890 void RenderFrameImpl::didFinishLoad(blink::WebLocalFrame* frame) { |
3890 TRACE_EVENT1("navigation,benchmark,rail", | 3891 TRACE_EVENT1("navigation,benchmark,rail", |
3891 "RenderFrameImpl::didFinishLoad", "id", routing_id_); | 3892 "RenderFrameImpl::didFinishLoad", "id", routing_id_); |
3892 DCHECK_EQ(frame_, frame); | 3893 DCHECK_EQ(frame_, frame); |
3893 if (!frame->parent()) { | 3894 if (!frame->parent()) { |
3894 TRACE_EVENT_INSTANT0("WebCore,benchmark,rail", "LoadFinished", | 3895 TRACE_EVENT_INSTANT0("WebCore,benchmark,rail", "LoadFinished", |
3895 TRACE_EVENT_SCOPE_PROCESS); | 3896 TRACE_EVENT_SCOPE_PROCESS); |
3896 } | 3897 } |
3897 | 3898 |
3898 for (auto& observer : render_view_->observers()) | 3899 for (auto& observer : render_view_->observers()) |
3899 observer.DidFinishLoad(frame); | 3900 observer.DidFinishLoad(frame); |
3900 for (auto& observer : observers_) | 3901 for (auto& observer : observers_) |
3901 observer.DidFinishLoad(); | 3902 observer.DidFinishLoad(); |
3902 | 3903 |
3903 WebDataSource* ds = frame->dataSource(); | 3904 WebDataSource* ds = frame->dataSource(); |
3904 Send(new FrameHostMsg_DidFinishLoad(routing_id_, | 3905 Send(new FrameHostMsg_DidFinishLoad(routing_id_, ds->getRequest().url())); |
3905 ds->request().url())); | |
3906 } | 3906 } |
3907 | 3907 |
3908 void RenderFrameImpl::didNavigateWithinPage( | 3908 void RenderFrameImpl::didNavigateWithinPage( |
3909 blink::WebLocalFrame* frame, | 3909 blink::WebLocalFrame* frame, |
3910 const blink::WebHistoryItem& item, | 3910 const blink::WebHistoryItem& item, |
3911 blink::WebHistoryCommitType commit_type, | 3911 blink::WebHistoryCommitType commit_type, |
3912 bool content_initiated) { | 3912 bool content_initiated) { |
3913 TRACE_EVENT1("navigation,rail", "RenderFrameImpl::didNavigateWithinPage", | 3913 TRACE_EVENT1("navigation,rail", "RenderFrameImpl::didNavigateWithinPage", |
3914 "id", routing_id_); | 3914 "id", routing_id_); |
3915 DCHECK_EQ(frame_, frame); | 3915 DCHECK_EQ(frame_, frame); |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4726 | 4726 |
4727 // Tell the embedding application that the URL of the active page has changed. | 4727 // Tell the embedding application that the URL of the active page has changed. |
4728 void RenderFrameImpl::SendDidCommitProvisionalLoad( | 4728 void RenderFrameImpl::SendDidCommitProvisionalLoad( |
4729 blink::WebFrame* frame, | 4729 blink::WebFrame* frame, |
4730 blink::WebHistoryCommitType commit_type, | 4730 blink::WebHistoryCommitType commit_type, |
4731 const blink::WebHistoryItem& item) { | 4731 const blink::WebHistoryItem& item) { |
4732 DCHECK_EQ(frame_, frame); | 4732 DCHECK_EQ(frame_, frame); |
4733 WebDataSource* ds = frame->dataSource(); | 4733 WebDataSource* ds = frame->dataSource(); |
4734 DCHECK(ds); | 4734 DCHECK(ds); |
4735 | 4735 |
4736 const WebURLRequest& request = ds->request(); | 4736 const WebURLRequest& request = ds->getRequest(); |
4737 const WebURLResponse& response = ds->response(); | 4737 const WebURLResponse& response = ds->response(); |
4738 | 4738 |
4739 DocumentState* document_state = DocumentState::FromDataSource(ds); | 4739 DocumentState* document_state = DocumentState::FromDataSource(ds); |
4740 NavigationStateImpl* navigation_state = | 4740 NavigationStateImpl* navigation_state = |
4741 static_cast<NavigationStateImpl*>(document_state->navigation_state()); | 4741 static_cast<NavigationStateImpl*>(document_state->navigation_state()); |
4742 InternalDocumentStateData* internal_data = | 4742 InternalDocumentStateData* internal_data = |
4743 InternalDocumentStateData::FromDocumentState(document_state); | 4743 InternalDocumentStateData::FromDocumentState(document_state); |
4744 | 4744 |
4745 FrameHostMsg_DidCommitProvisionalLoad_Params params; | 4745 FrameHostMsg_DidCommitProvisionalLoad_Params params; |
4746 params.http_status_code = response.httpStatusCode(); | 4746 params.http_status_code = response.httpStatusCode(); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4817 } | 4817 } |
4818 | 4818 |
4819 params.frame_unique_name = item.target().utf8(); | 4819 params.frame_unique_name = item.target().utf8(); |
4820 params.item_sequence_number = item.itemSequenceNumber(); | 4820 params.item_sequence_number = item.itemSequenceNumber(); |
4821 params.document_sequence_number = item.documentSequenceNumber(); | 4821 params.document_sequence_number = item.documentSequenceNumber(); |
4822 | 4822 |
4823 // If the page contained a client redirect (meta refresh, document.loc...), | 4823 // If the page contained a client redirect (meta refresh, document.loc...), |
4824 // set the referrer appropriately. | 4824 // set the referrer appropriately. |
4825 if (ds->isClientRedirect()) { | 4825 if (ds->isClientRedirect()) { |
4826 params.referrer = | 4826 params.referrer = |
4827 Referrer(params.redirects[0], ds->request().getReferrerPolicy()); | 4827 Referrer(params.redirects[0], ds->getRequest().getReferrerPolicy()); |
4828 } else { | 4828 } else { |
4829 params.referrer = | 4829 params.referrer = |
4830 RenderViewImpl::GetReferrerFromRequest(frame, ds->request()); | 4830 RenderViewImpl::GetReferrerFromRequest(frame, ds->getRequest()); |
4831 } | 4831 } |
4832 | 4832 |
4833 if (!frame->parent()) { | 4833 if (!frame->parent()) { |
4834 // Top-level navigation. | 4834 // Top-level navigation. |
4835 | 4835 |
4836 // Reset the zoom limits in case a plugin had changed them previously. This | 4836 // Reset the zoom limits in case a plugin had changed them previously. This |
4837 // will also call us back which will cause us to send a message to | 4837 // will also call us back which will cause us to send a message to |
4838 // update WebContentsImpl. | 4838 // update WebContentsImpl. |
4839 render_view_->webview()->zoomLimitsChanged( | 4839 render_view_->webview()->zoomLimitsChanged( |
4840 ZoomFactorToZoomLevel(kMinimumZoomFactor), | 4840 ZoomFactorToZoomLevel(kMinimumZoomFactor), |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4901 | 4901 |
4902 // Track the URL of the original request. We use the first entry of the | 4902 // Track the URL of the original request. We use the first entry of the |
4903 // redirect chain if it exists because the chain may have started in another | 4903 // redirect chain if it exists because the chain may have started in another |
4904 // process. | 4904 // process. |
4905 params.original_request_url = GetOriginalRequestURL(ds); | 4905 params.original_request_url = GetOriginalRequestURL(ds); |
4906 | 4906 |
4907 params.history_list_was_cleared = | 4907 params.history_list_was_cleared = |
4908 navigation_state->request_params().should_clear_history_list; | 4908 navigation_state->request_params().should_clear_history_list; |
4909 | 4909 |
4910 params.report_type = static_cast<FrameMsg_UILoadMetricsReportType::Value>( | 4910 params.report_type = static_cast<FrameMsg_UILoadMetricsReportType::Value>( |
4911 frame->dataSource()->request().inputPerfMetricReportPolicy()); | 4911 frame->dataSource()->getRequest().inputPerfMetricReportPolicy()); |
4912 params.ui_timestamp = base::TimeTicks() + base::TimeDelta::FromSecondsD( | 4912 params.ui_timestamp = base::TimeTicks() + |
4913 frame->dataSource()->request().uiStartTime()); | 4913 base::TimeDelta::FromSecondsD( |
| 4914 frame->dataSource()->getRequest().uiStartTime()); |
4914 } else { | 4915 } else { |
4915 // Subframe navigation: the type depends on whether this navigation | 4916 // Subframe navigation: the type depends on whether this navigation |
4916 // generated a new session history entry. When they do generate a session | 4917 // generated a new session history entry. When they do generate a session |
4917 // history entry, it means the user initiated the navigation and we should | 4918 // history entry, it means the user initiated the navigation and we should |
4918 // mark it as such. | 4919 // mark it as such. |
4919 if (commit_type == blink::WebStandardCommit) | 4920 if (commit_type == blink::WebStandardCommit) |
4920 params.transition = ui::PAGE_TRANSITION_MANUAL_SUBFRAME; | 4921 params.transition = ui::PAGE_TRANSITION_MANUAL_SUBFRAME; |
4921 else | 4922 else |
4922 params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME; | 4923 params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME; |
4923 | 4924 |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5190 // history load. | 5191 // history load. |
5191 Send(new FrameHostMsg_CancelInitialHistoryLoad(routing_id_)); | 5192 Send(new FrameHostMsg_CancelInitialHistoryLoad(routing_id_)); |
5192 } | 5193 } |
5193 } | 5194 } |
5194 } | 5195 } |
5195 | 5196 |
5196 // Use the frame's original request's URL rather than the document's URL for | 5197 // Use the frame's original request's URL rather than the document's URL for |
5197 // subsequent checks. For a popup, the document's URL may become the opener | 5198 // subsequent checks. For a popup, the document's URL may become the opener |
5198 // window's URL if the opener has called document.write(). | 5199 // window's URL if the opener has called document.write(). |
5199 // See http://crbug.com/93517. | 5200 // See http://crbug.com/93517. |
5200 GURL old_url(frame_->dataSource()->request().url()); | 5201 GURL old_url(frame_->dataSource()->getRequest().url()); |
5201 | 5202 |
5202 // Detect when we're crossing a permission-based boundary (e.g. into or out of | 5203 // Detect when we're crossing a permission-based boundary (e.g. into or out of |
5203 // an extension or app origin, leaving a WebUI page, etc). We only care about | 5204 // an extension or app origin, leaving a WebUI page, etc). We only care about |
5204 // top-level navigations (not iframes). But we sometimes navigate to | 5205 // top-level navigations (not iframes). But we sometimes navigate to |
5205 // about:blank to clear a tab, and we want to still allow that. | 5206 // about:blank to clear a tab, and we want to still allow that. |
5206 if (!frame_->parent() && is_content_initiated && | 5207 if (!frame_->parent() && is_content_initiated && |
5207 !url.SchemeIs(url::kAboutScheme)) { | 5208 !url.SchemeIs(url::kAboutScheme)) { |
5208 bool send_referrer = false; | 5209 bool send_referrer = false; |
5209 | 5210 |
5210 // All navigations to or from WebUI URLs or within WebUI-enabled | 5211 // All navigations to or from WebUI URLs or within WebUI-enabled |
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6267 return true; | 6268 return true; |
6268 } | 6269 } |
6269 | 6270 |
6270 GURL RenderFrameImpl::GetLoadingUrl() const { | 6271 GURL RenderFrameImpl::GetLoadingUrl() const { |
6271 WebDataSource* ds = frame_->dataSource(); | 6272 WebDataSource* ds = frame_->dataSource(); |
6272 | 6273 |
6273 GURL overriden_url; | 6274 GURL overriden_url; |
6274 if (MaybeGetOverriddenURL(ds, &overriden_url)) | 6275 if (MaybeGetOverriddenURL(ds, &overriden_url)) |
6275 return overriden_url; | 6276 return overriden_url; |
6276 | 6277 |
6277 const WebURLRequest& request = ds->request(); | 6278 const WebURLRequest& request = ds->getRequest(); |
6278 return request.url(); | 6279 return request.url(); |
6279 } | 6280 } |
6280 | 6281 |
6281 void RenderFrameImpl::PopulateDocumentStateFromPending( | 6282 void RenderFrameImpl::PopulateDocumentStateFromPending( |
6282 DocumentState* document_state) { | 6283 DocumentState* document_state) { |
6283 InternalDocumentStateData* internal_data = | 6284 InternalDocumentStateData* internal_data = |
6284 InternalDocumentStateData::FromDocumentState(document_state); | 6285 InternalDocumentStateData::FromDocumentState(document_state); |
6285 | 6286 |
6286 if (!pending_navigation_params_->common_params.url.SchemeIs( | 6287 if (!pending_navigation_params_->common_params.url.SchemeIs( |
6287 url::kJavaScriptScheme) && | 6288 url::kJavaScriptScheme) && |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6676 // event target. Potentially a Pepper plugin will receive the event. | 6677 // event target. Potentially a Pepper plugin will receive the event. |
6677 // In order to tell whether a plugin gets the last mouse event and which it | 6678 // In order to tell whether a plugin gets the last mouse event and which it |
6678 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6679 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6679 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6680 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6680 // |pepper_last_mouse_event_target_|. | 6681 // |pepper_last_mouse_event_target_|. |
6681 pepper_last_mouse_event_target_ = nullptr; | 6682 pepper_last_mouse_event_target_ = nullptr; |
6682 #endif | 6683 #endif |
6683 } | 6684 } |
6684 | 6685 |
6685 } // namespace content | 6686 } // namespace content |
OLD | NEW |