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

Side by Side Diff: content/test/test_render_frame_host.cc

Issue 1678303004: PlzNavigate: inform the renderer that a navigation is a POST (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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/test/test_render_frame_host.h" 5 #include "content/test/test_render_frame_host.h"
6 6
7 #include "content/browser/frame_host/frame_tree.h" 7 #include "content/browser/frame_host/frame_tree.h"
8 #include "content/browser/frame_host/navigation_handle_impl.h" 8 #include "content/browser/frame_host/navigation_handle_impl.h"
9 #include "content/browser/frame_host/navigation_request.h" 9 #include "content/browser/frame_host/navigation_request.h"
10 #include "content/browser/frame_host/navigator.h" 10 #include "content/browser/frame_host/navigator.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 } 336 }
337 337
338 void TestRenderFrameHost::SendRendererInitiatedNavigationRequest( 338 void TestRenderFrameHost::SendRendererInitiatedNavigationRequest(
339 const GURL& url, 339 const GURL& url,
340 bool has_user_gesture) { 340 bool has_user_gesture) {
341 // Since this is renderer-initiated navigation, the RenderFrame must be 341 // Since this is renderer-initiated navigation, the RenderFrame must be
342 // initialized. Do it if it hasn't happened yet. 342 // initialized. Do it if it hasn't happened yet.
343 InitializeRenderFrameIfNeeded(); 343 InitializeRenderFrameIfNeeded();
344 344
345 if (IsBrowserSideNavigationEnabled()) { 345 if (IsBrowserSideNavigationEnabled()) {
346 BeginNavigationParams begin_params("GET", std::string(), net::LOAD_NORMAL, 346 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL,
347 has_user_gesture, false, 347 has_user_gesture, false,
348 REQUEST_CONTEXT_TYPE_HYPERLINK); 348 REQUEST_CONTEXT_TYPE_HYPERLINK);
349 CommonNavigationParams common_params; 349 CommonNavigationParams common_params;
350 common_params.url = url; 350 common_params.url = url;
351 common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault); 351 common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault);
352 common_params.transition = ui::PAGE_TRANSITION_LINK; 352 common_params.transition = ui::PAGE_TRANSITION_LINK;
353 OnBeginNavigation(common_params, begin_params, 353 OnBeginNavigation(common_params, begin_params,
354 scoped_refptr<ResourceRequestBody>()); 354 scoped_refptr<ResourceRequestBody>());
355 } 355 }
356 } 356 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 // cleared during DidFailProvisionalLoad). 413 // cleared during DidFailProvisionalLoad).
414 int page_id = entry ? entry->GetPageID() : -1; 414 int page_id = entry ? entry->GetPageID() : -1;
415 if (page_id == -1) { 415 if (page_id == -1) {
416 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); 416 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate());
417 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; 417 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1;
418 } 418 }
419 return page_id; 419 return page_id;
420 } 420 }
421 421
422 } // namespace content 422 } // namespace content
OLDNEW
« content/common/navigation_params.h ('K') | « content/renderer/render_view_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698