Chromium Code Reviews| 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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 607 // stack. | 607 // stack. |
| 608 base::TimeTicks SanitizeNavigationTiming( | 608 base::TimeTicks SanitizeNavigationTiming( |
| 609 const base::TimeTicks& browser_navigation_start, | 609 const base::TimeTicks& browser_navigation_start, |
| 610 const base::TimeTicks& renderer_navigation_start) { | 610 const base::TimeTicks& renderer_navigation_start) { |
| 611 DCHECK(!browser_navigation_start.is_null()); | 611 DCHECK(!browser_navigation_start.is_null()); |
| 612 return std::min(browser_navigation_start, renderer_navigation_start); | 612 return std::min(browser_navigation_start, renderer_navigation_start); |
| 613 } | 613 } |
| 614 | 614 |
| 615 // PlzNavigate | 615 // PlzNavigate |
| 616 CommonNavigationParams MakeCommonNavigationParams( | 616 CommonNavigationParams MakeCommonNavigationParams( |
| 617 const blink::WebFrameClient::NavigationPolicyInfo& info) { | 617 const blink::WebFrameClient::NavigationPolicyInfo& info, |
| 618 int load_flags) { | |
| 618 Referrer referrer( | 619 Referrer referrer( |
| 619 GURL(info.urlRequest.httpHeaderField( | 620 GURL(info.urlRequest.httpHeaderField( |
| 620 WebString::fromUTF8("Referer")).latin1()), | 621 WebString::fromUTF8("Referer")).latin1()), |
| 621 info.urlRequest.getReferrerPolicy()); | 622 info.urlRequest.getReferrerPolicy()); |
| 622 | 623 |
| 623 // Set the ui timestamp for this navigation. Currently the timestamp here is | 624 // Set the ui timestamp for this navigation. Currently the timestamp here is |
| 624 // only non empty when the navigation was triggered by an Android intent, or | 625 // only non empty when the navigation was triggered by an Android intent, or |
| 625 // by the user clicking on a link. The timestamp is converted from a double | 626 // by the user clicking on a link. The timestamp is converted from a double |
| 626 // version supported by blink. It will be passed back to the renderer in the | 627 // version supported by blink. It will be passed back to the renderer in the |
| 627 // CommitNavigation IPC, and then back to the browser again in the | 628 // CommitNavigation IPC, and then back to the browser again in the |
| 628 // DidCommitProvisionalLoad and the DocumentLoadComplete IPCs. | 629 // DidCommitProvisionalLoad and the DocumentLoadComplete IPCs. |
| 629 base::TimeTicks ui_timestamp = | 630 base::TimeTicks ui_timestamp = |
| 630 base::TimeTicks() + | 631 base::TimeTicks() + |
| 631 base::TimeDelta::FromSecondsD(info.urlRequest.uiStartTime()); | 632 base::TimeDelta::FromSecondsD(info.urlRequest.uiStartTime()); |
| 632 FrameMsg_UILoadMetricsReportType::Value report_type = | 633 FrameMsg_UILoadMetricsReportType::Value report_type = |
| 633 static_cast<FrameMsg_UILoadMetricsReportType::Value>( | 634 static_cast<FrameMsg_UILoadMetricsReportType::Value>( |
| 634 info.urlRequest.inputPerfMetricReportPolicy()); | 635 info.urlRequest.inputPerfMetricReportPolicy()); |
| 635 | 636 |
| 637 // Determine the navigation type. | |
| 636 FrameMsg_Navigate_Type::Value navigation_type = | 638 FrameMsg_Navigate_Type::Value navigation_type = |
| 637 info.navigationType == blink::WebNavigationTypeReload | 639 FrameMsg_Navigate_Type::NORMAL; |
| 638 ? FrameMsg_Navigate_Type::RELOAD | 640 if (info.navigationType == blink::WebNavigationTypeReload) { |
| 639 : FrameMsg_Navigate_Type::NORMAL; | 641 if (load_flags & net::LOAD_BYPASS_CACHE) |
| 642 navigation_type = FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE; | |
|
dgozman
2017/01/31 04:26:42
nit: extra space after '=' here and below
clamy
2017/02/07 09:29:06
Done.
| |
| 643 else | |
| 644 navigation_type = FrameMsg_Navigate_Type::RELOAD; | |
| 645 } | |
| 640 | 646 |
| 641 const RequestExtraData* extra_data = | 647 const RequestExtraData* extra_data = |
| 642 static_cast<RequestExtraData*>(info.urlRequest.getExtraData()); | 648 static_cast<RequestExtraData*>(info.urlRequest.getExtraData()); |
| 643 DCHECK(extra_data); | 649 DCHECK(extra_data); |
| 644 return CommonNavigationParams( | 650 return CommonNavigationParams( |
| 645 info.urlRequest.url(), referrer, extra_data->transition_type(), | 651 info.urlRequest.url(), referrer, extra_data->transition_type(), |
| 646 navigation_type, true, info.replacesCurrentHistoryItem, ui_timestamp, | 652 navigation_type, true, info.replacesCurrentHistoryItem, ui_timestamp, |
| 647 report_type, GURL(), GURL(), | 653 report_type, GURL(), GURL(), |
| 648 static_cast<PreviewsState>(info.urlRequest.getPreviewsState()), | 654 static_cast<PreviewsState>(info.urlRequest.getPreviewsState()), |
| 649 base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(), | 655 base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(), |
| (...skipping 5579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6229 | 6235 |
| 6230 if (!info.form.isNull()) { | 6236 if (!info.form.isNull()) { |
| 6231 WebSearchableFormData web_searchable_form_data(info.form); | 6237 WebSearchableFormData web_searchable_form_data(info.form); |
| 6232 begin_navigation_params.searchable_form_url = | 6238 begin_navigation_params.searchable_form_url = |
| 6233 web_searchable_form_data.url(); | 6239 web_searchable_form_data.url(); |
| 6234 begin_navigation_params.searchable_form_encoding = | 6240 begin_navigation_params.searchable_form_encoding = |
| 6235 web_searchable_form_data.encoding().utf8(); | 6241 web_searchable_form_data.encoding().utf8(); |
| 6236 } | 6242 } |
| 6237 | 6243 |
| 6238 Send(new FrameHostMsg_BeginNavigation( | 6244 Send(new FrameHostMsg_BeginNavigation( |
| 6239 routing_id_, MakeCommonNavigationParams(info), begin_navigation_params)); | 6245 routing_id_, MakeCommonNavigationParams(info, load_flags), |
| 6246 begin_navigation_params)); | |
| 6240 } | 6247 } |
| 6241 | 6248 |
| 6242 void RenderFrameImpl::LoadDataURL( | 6249 void RenderFrameImpl::LoadDataURL( |
| 6243 const CommonNavigationParams& params, | 6250 const CommonNavigationParams& params, |
| 6244 const RequestNavigationParams& request_params, | 6251 const RequestNavigationParams& request_params, |
| 6245 WebLocalFrame* frame, | 6252 WebLocalFrame* frame, |
| 6246 blink::WebFrameLoadType load_type, | 6253 blink::WebFrameLoadType load_type, |
| 6247 blink::WebHistoryItem item_for_history_navigation, | 6254 blink::WebHistoryItem item_for_history_navigation, |
| 6248 blink::WebHistoryLoadType history_load_type, | 6255 blink::WebHistoryLoadType history_load_type, |
| 6249 bool is_client_redirect) { | 6256 bool is_client_redirect) { |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6796 // event target. Potentially a Pepper plugin will receive the event. | 6803 // event target. Potentially a Pepper plugin will receive the event. |
| 6797 // In order to tell whether a plugin gets the last mouse event and which it | 6804 // In order to tell whether a plugin gets the last mouse event and which it |
| 6798 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6805 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6799 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6806 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6800 // |pepper_last_mouse_event_target_|. | 6807 // |pepper_last_mouse_event_target_|. |
| 6801 pepper_last_mouse_event_target_ = nullptr; | 6808 pepper_last_mouse_event_target_ = nullptr; |
| 6802 #endif | 6809 #endif |
| 6803 } | 6810 } |
| 6804 | 6811 |
| 6805 } // namespace content | 6812 } // namespace content |
| OLD | NEW |