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

Side by Side Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 1956383003: Forwarding POST body into renderer after a cross-site transfer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/browser/frame_host/render_frame_host_manager.h" 5 #include "content/browser/frame_host/render_frame_host_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 } 422 }
423 423
424 void RenderFrameHostManager::OnCrossSiteResponse( 424 void RenderFrameHostManager::OnCrossSiteResponse(
425 RenderFrameHostImpl* transferring_render_frame_host, 425 RenderFrameHostImpl* transferring_render_frame_host,
426 const GlobalRequestID& global_request_id, 426 const GlobalRequestID& global_request_id,
427 std::unique_ptr<CrossSiteTransferringRequest> 427 std::unique_ptr<CrossSiteTransferringRequest>
428 cross_site_transferring_request, 428 cross_site_transferring_request,
429 const std::vector<GURL>& transfer_url_chain, 429 const std::vector<GURL>& transfer_url_chain,
430 const Referrer& referrer, 430 const Referrer& referrer,
431 ui::PageTransition page_transition, 431 ui::PageTransition page_transition,
432 bool should_replace_current_entry) { 432 bool should_replace_current_entry,
433 const scoped_refptr<ResourceRequestBody>& resource_request_body) {
433 // We should only get here for transfer navigations. Most cross-process 434 // We should only get here for transfer navigations. Most cross-process
434 // navigations can just continue and wait to run the unload handler (by 435 // navigations can just continue and wait to run the unload handler (by
435 // swapping out) when the new navigation commits. 436 // swapping out) when the new navigation commits.
436 CHECK(cross_site_transferring_request); 437 CHECK(cross_site_transferring_request);
437 438
438 // A transfer should only have come from our pending or current RFH. If it 439 // A transfer should only have come from our pending or current RFH. If it
439 // started as a cross-process navigation via OpenURL, this is the pending 440 // started as a cross-process navigation via OpenURL, this is the pending
440 // one. If it wasn't cross-process until the transfer, this is the current 441 // one. If it wasn't cross-process until the transfer, this is the current
441 // one. 442 // one.
442 // 443 //
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 // the redirect chain. 477 // the redirect chain.
477 CHECK(transfer_url_chain.size()); 478 CHECK(transfer_url_chain.size());
478 GURL transfer_url = transfer_url_chain.back(); 479 GURL transfer_url = transfer_url_chain.back();
479 std::vector<GURL> rest_of_chain = transfer_url_chain; 480 std::vector<GURL> rest_of_chain = transfer_url_chain;
480 rest_of_chain.pop_back(); 481 rest_of_chain.pop_back();
481 482
482 transferring_render_frame_host->frame_tree_node() 483 transferring_render_frame_host->frame_tree_node()
483 ->navigator() 484 ->navigator()
484 ->RequestTransferURL(transferring_render_frame_host, transfer_url, 485 ->RequestTransferURL(transferring_render_frame_host, transfer_url,
485 nullptr, rest_of_chain, referrer, page_transition, 486 nullptr, rest_of_chain, referrer, page_transition,
486 global_request_id, should_replace_current_entry); 487 global_request_id, should_replace_current_entry,
488 resource_request_body);
487 489
488 // The transferring request was only needed during the RequestTransferURL 490 // The transferring request was only needed during the RequestTransferURL
489 // call, so it is safe to clear at this point. 491 // call, so it is safe to clear at this point.
490 cross_site_transferring_request_.reset(); 492 cross_site_transferring_request_.reset();
491 493
492 // If the navigation continued, the NavigationHandle should have been 494 // If the navigation continued, the NavigationHandle should have been
493 // transfered to a RenderFrameHost. In the other cases, it should be cleared. 495 // transfered to a RenderFrameHost. In the other cases, it should be cleared.
494 transfer_navigation_handle_.reset(); 496 transfer_navigation_handle_.reset();
495 497
496 // If the navigation in the new renderer did not start, inform the 498 // If the navigation in the new renderer did not start, inform the
(...skipping 2054 matching lines...) Expand 10 before | Expand all | Expand 10 after
2551 resolved_url)) { 2553 resolved_url)) {
2552 DCHECK(!dest_instance || 2554 DCHECK(!dest_instance ||
2553 dest_instance == render_frame_host_->GetSiteInstance()); 2555 dest_instance == render_frame_host_->GetSiteInstance());
2554 return false; 2556 return false;
2555 } 2557 }
2556 2558
2557 return true; 2559 return true;
2558 } 2560 }
2559 2561
2560 } // namespace content 2562 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698