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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2406053002: PlzNavigate: Fix the failing ContinueWhereILeftOffTest.PostWithPassword test. (Closed)
Patch Set: Fix test failures Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 7e7150a8ca705096263967837976c5518e719a52..1136a45de2e4e96b0eba15aedf36932af8c489ca 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -630,6 +630,8 @@ CommonNavigationParams MakeCommonNavigationParams(
report_type, GURL(), GURL(),
static_cast<LoFiState>(info.urlRequest.getLoFiState()),
base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(),
+ (!info.urlRequest.httpBody().isNull() ?
jam 2016/10/13 04:34:30 nit: this would be more readable without the doubl
+ info.urlRequest.httpBody().containsPasswordData() : false),
GetRequestBodyForWebURLRequest(info.urlRequest));
}
@@ -5597,9 +5599,16 @@ void RenderFrameImpl::NavigateInternal(
? blink::WebURLRequest::FrameTypeTopLevel
: blink::WebURLRequest::FrameTypeNested);
- if (IsBrowserSideNavigationEnabled() && common_params.post_data)
- request.setHTTPBody(GetWebHTTPBodyForRequestBody(common_params.post_data));
-
+ if (IsBrowserSideNavigationEnabled() && common_params.post_data) {
+ WebHTTPBody http_body =
+ GetWebHTTPBodyForRequestBody(common_params.post_data);
+ // We need to preserve the fact that the HTTP body contains passwords. This
+ // ensures that the page state is updated correctly in the browser. This
+ // eventually ensures that the page state is stripped of password data
+ // before being serialized to disk.
+ http_body.setContainsPasswordData(common_params.post_contains_passwords);
+ request.setHTTPBody(http_body);
+ }
// Used to determine whether this frame is actually loading a request as part
// of a history navigation.
bool has_history_navigation_in_frame = false;

Powered by Google App Engine
This is Rietveld 408576698