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" |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 CHECK(result != NavigationThrottle::DEFER); | 443 CHECK(result != NavigationThrottle::DEFER); |
444 | 444 |
445 // Abort the request if needed. This will destroy the NavigationRequest. | 445 // Abort the request if needed. This will destroy the NavigationRequest. |
446 if (result == NavigationThrottle::CANCEL_AND_IGNORE || | 446 if (result == NavigationThrottle::CANCEL_AND_IGNORE || |
447 result == NavigationThrottle::CANCEL) { | 447 result == NavigationThrottle::CANCEL) { |
448 // TODO(clamy): distinguish between CANCEL and CANCEL_AND_IGNORE. | 448 // TODO(clamy): distinguish between CANCEL and CANCEL_AND_IGNORE. |
449 frame_tree_node_->ResetNavigationRequest(false); | 449 frame_tree_node_->ResetNavigationRequest(false); |
450 return; | 450 return; |
451 } | 451 } |
452 | 452 |
| 453 if (result == NavigationThrottle::BLOCK_REQUEST) { |
| 454 OnRequestFailed(false, net::ERR_BLOCKED_BY_CLIENT); |
| 455 return; |
| 456 } |
| 457 |
453 // Use the SiteInstance of the navigating RenderFrameHost to get access to | 458 // Use the SiteInstance of the navigating RenderFrameHost to get access to |
454 // the StoragePartition. Using the url of the navigation will result in a | 459 // the StoragePartition. Using the url of the navigation will result in a |
455 // wrong StoragePartition being picked when a WebView is navigating. | 460 // wrong StoragePartition being picked when a WebView is navigating. |
456 DCHECK_NE(AssociatedSiteInstanceType::NONE, associated_site_instance_type_); | 461 DCHECK_NE(AssociatedSiteInstanceType::NONE, associated_site_instance_type_); |
457 RenderFrameHostImpl* navigating_frame_host = | 462 RenderFrameHostImpl* navigating_frame_host = |
458 associated_site_instance_type_ == AssociatedSiteInstanceType::SPECULATIVE | 463 associated_site_instance_type_ == AssociatedSiteInstanceType::SPECULATIVE |
459 ? frame_tree_node_->render_manager()->speculative_frame_host() | 464 ? frame_tree_node_->render_manager()->speculative_frame_host() |
460 : frame_tree_node_->current_frame_host(); | 465 : frame_tree_node_->current_frame_host(); |
461 DCHECK(navigating_frame_host); | 466 DCHECK(navigating_frame_host); |
462 | 467 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); | 571 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); |
567 | 572 |
568 render_frame_host->CommitNavigation(response_.get(), std::move(body_), | 573 render_frame_host->CommitNavigation(response_.get(), std::move(body_), |
569 common_params_, request_params_, | 574 common_params_, request_params_, |
570 is_view_source_); | 575 is_view_source_); |
571 | 576 |
572 frame_tree_node_->ResetNavigationRequest(true); | 577 frame_tree_node_->ResetNavigationRequest(true); |
573 } | 578 } |
574 | 579 |
575 } // namespace content | 580 } // namespace content |
OLD | NEW |