| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/navigation_request.h" | 5 #include "content/browser/frame_host/navigation_request.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 9 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| 10 #include "content/browser/frame_host/frame_tree.h" | 10 #include "content/browser/frame_host/frame_tree.h" |
| 11 #include "content/browser/frame_host/frame_tree_node.h" | 11 #include "content/browser/frame_host/frame_tree_node.h" |
| 12 #include "content/browser/frame_host/navigation_controller_impl.h" | 12 #include "content/browser/frame_host/navigation_controller_impl.h" |
| 13 #include "content/browser/frame_host/navigation_handle_impl.h" | 13 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 14 #include "content/browser/frame_host/navigation_request_info.h" | 14 #include "content/browser/frame_host/navigation_request_info.h" |
| 15 #include "content/browser/frame_host/navigator.h" | 15 #include "content/browser/frame_host/navigator.h" |
| 16 #include "content/browser/frame_host/navigator_impl.h" | 16 #include "content/browser/frame_host/navigator_impl.h" |
| 17 #include "content/browser/loader/navigation_url_loader.h" | 17 #include "content/browser/loader/navigation_url_loader.h" |
| 18 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 18 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| 19 #include "content/browser/service_worker/service_worker_navigation_handle.h" | 19 #include "content/browser/service_worker/service_worker_navigation_handle.h" |
| 20 #include "content/browser/site_instance_impl.h" | 20 #include "content/browser/site_instance_impl.h" |
| 21 #include "content/common/resource_request_body_impl.h" | 21 #include "content/common/resource_request_body_impl.h" |
| 22 #include "content/public/browser/browser_context.h" | 22 #include "content/public/browser/browser_context.h" |
| 23 #include "content/public/browser/navigation_controller.h" | 23 #include "content/public/browser/navigation_controller.h" |
| 24 #include "content/public/browser/navigation_data.h" | 24 #include "content/public/browser/navigation_data.h" |
| 25 #include "content/public/browser/navigation_ui_data.h" |
| 25 #include "content/public/browser/storage_partition.h" | 26 #include "content/public/browser/storage_partition.h" |
| 26 #include "content/public/browser/stream_handle.h" | 27 #include "content/public/browser/stream_handle.h" |
| 27 #include "content/public/common/content_client.h" | 28 #include "content/public/common/content_client.h" |
| 28 #include "content/public/common/request_context_type.h" | 29 #include "content/public/common/request_context_type.h" |
| 29 #include "content/public/common/resource_response.h" | 30 #include "content/public/common/resource_response.h" |
| 30 #include "net/base/load_flags.h" | 31 #include "net/base/load_flags.h" |
| 31 #include "net/base/url_util.h" | 32 #include "net/base/url_util.h" |
| 32 #include "net/http/http_request_headers.h" | 33 #include "net/http/http_request_headers.h" |
| 33 #include "net/url_request/redirect_info.h" | 34 #include "net/url_request/redirect_info.h" |
| 34 #include "third_party/WebKit/public/web/WebSandboxFlags.h" | 35 #include "third_party/WebKit/public/web/WebSandboxFlags.h" |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 // and verifies that all origins are PSL-matches (and special-cases extension | 451 // and verifies that all origins are PSL-matches (and special-cases extension |
| 451 // URLs). | 452 // URLs). |
| 452 const GURL& first_party_for_cookies = | 453 const GURL& first_party_for_cookies = |
| 453 frame_tree_node_->IsMainFrame() | 454 frame_tree_node_->IsMainFrame() |
| 454 ? common_params_.url | 455 ? common_params_.url |
| 455 : frame_tree_node_->frame_tree()->root()->current_url(); | 456 : frame_tree_node_->frame_tree()->root()->current_url(); |
| 456 bool parent_is_main_frame = !frame_tree_node_->parent() | 457 bool parent_is_main_frame = !frame_tree_node_->parent() |
| 457 ? false | 458 ? false |
| 458 : frame_tree_node_->parent()->IsMainFrame(); | 459 : frame_tree_node_->parent()->IsMainFrame(); |
| 459 | 460 |
| 461 std::unique_ptr<NavigationUIData> navigation_ui_data; |
| 462 if (navigation_handle_->navigation_ui_data()) |
| 463 navigation_ui_data = navigation_handle_->navigation_ui_data()->Clone(); |
| 464 |
| 460 loader_ = NavigationURLLoader::Create( | 465 loader_ = NavigationURLLoader::Create( |
| 461 frame_tree_node_->navigator()->GetController()->GetBrowserContext(), | 466 frame_tree_node_->navigator()->GetController()->GetBrowserContext(), |
| 462 base::MakeUnique<NavigationRequestInfo>( | 467 base::MakeUnique<NavigationRequestInfo>( |
| 463 common_params_, begin_params_, first_party_for_cookies, | 468 common_params_, begin_params_, first_party_for_cookies, |
| 464 frame_tree_node_->current_origin(), frame_tree_node_->IsMainFrame(), | 469 frame_tree_node_->current_origin(), frame_tree_node_->IsMainFrame(), |
| 465 parent_is_main_frame, IsSecureFrame(frame_tree_node_->parent()), | 470 parent_is_main_frame, IsSecureFrame(frame_tree_node_->parent()), |
| 466 frame_tree_node_->frame_tree_node_id()), | 471 frame_tree_node_->frame_tree_node_id()), |
| 472 std::move(navigation_ui_data), |
| 467 navigation_handle_->service_worker_handle(), this); | 473 navigation_handle_->service_worker_handle(), this); |
| 468 } | 474 } |
| 469 | 475 |
| 470 void NavigationRequest::OnRedirectChecksComplete( | 476 void NavigationRequest::OnRedirectChecksComplete( |
| 471 NavigationThrottle::ThrottleCheckResult result) { | 477 NavigationThrottle::ThrottleCheckResult result) { |
| 472 CHECK(result != NavigationThrottle::DEFER); | 478 CHECK(result != NavigationThrottle::DEFER); |
| 473 | 479 |
| 474 // Abort the request if needed. This will destroy the NavigationRequest. | 480 // Abort the request if needed. This will destroy the NavigationRequest. |
| 475 if (result == NavigationThrottle::CANCEL_AND_IGNORE || | 481 if (result == NavigationThrottle::CANCEL_AND_IGNORE || |
| 476 result == NavigationThrottle::CANCEL) { | 482 result == NavigationThrottle::CANCEL) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 | 523 |
| 518 TransferNavigationHandleOwnership(render_frame_host); | 524 TransferNavigationHandleOwnership(render_frame_host); |
| 519 render_frame_host->CommitNavigation(response_.get(), std::move(body_), | 525 render_frame_host->CommitNavigation(response_.get(), std::move(body_), |
| 520 common_params_, request_params_, | 526 common_params_, request_params_, |
| 521 is_view_source_); | 527 is_view_source_); |
| 522 | 528 |
| 523 frame_tree_node_->ResetNavigationRequest(true); | 529 frame_tree_node_->ResetNavigationRequest(true); |
| 524 } | 530 } |
| 525 | 531 |
| 526 } // namespace content | 532 } // namespace content |
| OLD | NEW |