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

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

Issue 2661643002: PlzNavigate: handle reload bypassing cache from the renderer (Closed)
Patch Set: Rebase + addressed comments Created 3 years, 10 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 | « no previous file | third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation » ('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 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 // stack. 611 // stack.
612 base::TimeTicks SanitizeNavigationTiming( 612 base::TimeTicks SanitizeNavigationTiming(
613 const base::TimeTicks& browser_navigation_start, 613 const base::TimeTicks& browser_navigation_start,
614 const base::TimeTicks& renderer_navigation_start) { 614 const base::TimeTicks& renderer_navigation_start) {
615 DCHECK(!browser_navigation_start.is_null()); 615 DCHECK(!browser_navigation_start.is_null());
616 return std::min(browser_navigation_start, renderer_navigation_start); 616 return std::min(browser_navigation_start, renderer_navigation_start);
617 } 617 }
618 618
619 // PlzNavigate 619 // PlzNavigate
620 CommonNavigationParams MakeCommonNavigationParams( 620 CommonNavigationParams MakeCommonNavigationParams(
621 const blink::WebFrameClient::NavigationPolicyInfo& info) { 621 const blink::WebFrameClient::NavigationPolicyInfo& info,
622 int load_flags) {
622 Referrer referrer( 623 Referrer referrer(
623 GURL(info.urlRequest.httpHeaderField( 624 GURL(info.urlRequest.httpHeaderField(
624 WebString::fromUTF8("Referer")).latin1()), 625 WebString::fromUTF8("Referer")).latin1()),
625 info.urlRequest.getReferrerPolicy()); 626 info.urlRequest.getReferrerPolicy());
626 627
627 // Set the ui timestamp for this navigation. Currently the timestamp here is 628 // Set the ui timestamp for this navigation. Currently the timestamp here is
628 // only non empty when the navigation was triggered by an Android intent, or 629 // only non empty when the navigation was triggered by an Android intent, or
629 // by the user clicking on a link. The timestamp is converted from a double 630 // by the user clicking on a link. The timestamp is converted from a double
630 // version supported by blink. It will be passed back to the renderer in the 631 // version supported by blink. It will be passed back to the renderer in the
631 // CommitNavigation IPC, and then back to the browser again in the 632 // CommitNavigation IPC, and then back to the browser again in the
632 // DidCommitProvisionalLoad and the DocumentLoadComplete IPCs. 633 // DidCommitProvisionalLoad and the DocumentLoadComplete IPCs.
633 base::TimeTicks ui_timestamp = 634 base::TimeTicks ui_timestamp =
634 base::TimeTicks() + 635 base::TimeTicks() +
635 base::TimeDelta::FromSecondsD(info.urlRequest.uiStartTime()); 636 base::TimeDelta::FromSecondsD(info.urlRequest.uiStartTime());
636 FrameMsg_UILoadMetricsReportType::Value report_type = 637 FrameMsg_UILoadMetricsReportType::Value report_type =
637 static_cast<FrameMsg_UILoadMetricsReportType::Value>( 638 static_cast<FrameMsg_UILoadMetricsReportType::Value>(
638 info.urlRequest.inputPerfMetricReportPolicy()); 639 info.urlRequest.inputPerfMetricReportPolicy());
639 640
641 // Determine the navigation type.
640 FrameMsg_Navigate_Type::Value navigation_type = 642 FrameMsg_Navigate_Type::Value navigation_type =
641 info.navigationType == blink::WebNavigationTypeReload 643 FrameMsg_Navigate_Type::NORMAL;
642 ? FrameMsg_Navigate_Type::RELOAD 644 if (info.navigationType == blink::WebNavigationTypeReload) {
643 : FrameMsg_Navigate_Type::NORMAL; 645 if (load_flags & net::LOAD_BYPASS_CACHE)
646 navigation_type = FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE;
647 else
648 navigation_type = FrameMsg_Navigate_Type::RELOAD;
649 }
644 650
645 const RequestExtraData* extra_data = 651 const RequestExtraData* extra_data =
646 static_cast<RequestExtraData*>(info.urlRequest.getExtraData()); 652 static_cast<RequestExtraData*>(info.urlRequest.getExtraData());
647 DCHECK(extra_data); 653 DCHECK(extra_data);
648 return CommonNavigationParams( 654 return CommonNavigationParams(
649 info.urlRequest.url(), referrer, extra_data->transition_type(), 655 info.urlRequest.url(), referrer, extra_data->transition_type(),
650 navigation_type, true, info.replacesCurrentHistoryItem, ui_timestamp, 656 navigation_type, true, info.replacesCurrentHistoryItem, ui_timestamp,
651 report_type, GURL(), GURL(), 657 report_type, GURL(), GURL(),
652 static_cast<PreviewsState>(info.urlRequest.getPreviewsState()), 658 static_cast<PreviewsState>(info.urlRequest.getPreviewsState()),
653 base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(), 659 base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(),
(...skipping 5599 matching lines...) Expand 10 before | Expand all | Expand 10 after
6253 begin_navigation_params.searchable_form_url = 6259 begin_navigation_params.searchable_form_url =
6254 web_searchable_form_data.url(); 6260 web_searchable_form_data.url();
6255 begin_navigation_params.searchable_form_encoding = 6261 begin_navigation_params.searchable_form_encoding =
6256 web_searchable_form_data.encoding().utf8(); 6262 web_searchable_form_data.encoding().utf8();
6257 } 6263 }
6258 6264
6259 if (info.isClientRedirect) 6265 if (info.isClientRedirect)
6260 begin_navigation_params.client_side_redirect_url = frame_->document().url(); 6266 begin_navigation_params.client_side_redirect_url = frame_->document().url();
6261 6267
6262 Send(new FrameHostMsg_BeginNavigation( 6268 Send(new FrameHostMsg_BeginNavigation(
6263 routing_id_, MakeCommonNavigationParams(info), begin_navigation_params)); 6269 routing_id_, MakeCommonNavigationParams(info, load_flags),
6270 begin_navigation_params));
6264 } 6271 }
6265 6272
6266 void RenderFrameImpl::LoadDataURL( 6273 void RenderFrameImpl::LoadDataURL(
6267 const CommonNavigationParams& params, 6274 const CommonNavigationParams& params,
6268 const RequestNavigationParams& request_params, 6275 const RequestNavigationParams& request_params,
6269 WebLocalFrame* frame, 6276 WebLocalFrame* frame,
6270 blink::WebFrameLoadType load_type, 6277 blink::WebFrameLoadType load_type,
6271 blink::WebHistoryItem item_for_history_navigation, 6278 blink::WebHistoryItem item_for_history_navigation,
6272 blink::WebHistoryLoadType history_load_type, 6279 blink::WebHistoryLoadType history_load_type,
6273 bool is_client_redirect) { 6280 bool is_client_redirect) {
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
6808 // event target. Potentially a Pepper plugin will receive the event. 6815 // event target. Potentially a Pepper plugin will receive the event.
6809 // In order to tell whether a plugin gets the last mouse event and which it 6816 // In order to tell whether a plugin gets the last mouse event and which it
6810 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6817 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6811 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6818 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6812 // |pepper_last_mouse_event_target_|. 6819 // |pepper_last_mouse_event_target_|.
6813 pepper_last_mouse_event_target_ = nullptr; 6820 pepper_last_mouse_event_target_ = nullptr;
6814 #endif 6821 #endif
6815 } 6822 }
6816 6823
6817 } // namespace content 6824 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698