Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_handle_impl.h" | 5 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/debug/dump_without_crashing.h" | 9 #include "base/debug/dump_without_crashing.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "content/browser/browsing_data/clear_site_data_throttle.h" | 11 #include "content/browser/browsing_data/clear_site_data_throttle.h" |
| 12 #include "content/browser/child_process_security_policy_impl.h" | 12 #include "content/browser/child_process_security_policy_impl.h" |
| 13 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 13 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| 14 #include "content/browser/frame_host/frame_tree_node.h" | 14 #include "content/browser/frame_host/frame_tree_node.h" |
| 15 #include "content/browser/frame_host/navigator.h" | 15 #include "content/browser/frame_host/navigator.h" |
| 16 #include "content/browser/frame_host/navigator_delegate.h" | 16 #include "content/browser/frame_host/navigator_delegate.h" |
| 17 #include "content/browser/frame_host/render_frame_host_manager.h" | |
|
alexmos
2016/10/13 00:46:27
nit: is this still necessary?
jam
2016/10/13 03:12:28
Done.
| |
| 17 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 18 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| 18 #include "content/browser/service_worker/service_worker_navigation_handle.h" | 19 #include "content/browser/service_worker/service_worker_navigation_handle.h" |
| 19 #include "content/common/frame_messages.h" | 20 #include "content/common/frame_messages.h" |
| 20 #include "content/common/resource_request_body_impl.h" | 21 #include "content/common/resource_request_body_impl.h" |
| 21 #include "content/common/site_isolation_policy.h" | 22 #include "content/common/site_isolation_policy.h" |
| 22 #include "content/public/browser/content_browser_client.h" | 23 #include "content/public/browser/content_browser_client.h" |
| 23 #include "content/public/browser/navigation_ui_data.h" | 24 #include "content/public/browser/navigation_ui_data.h" |
| 24 #include "content/public/browser/site_instance.h" | 25 #include "content/public/browser/site_instance.h" |
| 25 #include "content/public/common/browser_side_navigation_policy.h" | 26 #include "content/public/common/browser_side_navigation_policy.h" |
| 26 #include "content/public/common/content_client.h" | 27 #include "content/public/common/content_client.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 navigation_start_(navigation_start), | 85 navigation_start_(navigation_start), |
| 85 pending_nav_entry_id_(pending_nav_entry_id), | 86 pending_nav_entry_id_(pending_nav_entry_id), |
| 86 request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED), | 87 request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED), |
| 87 should_replace_current_entry_(false), | 88 should_replace_current_entry_(false), |
| 88 is_download_(false), | 89 is_download_(false), |
| 89 is_stream_(false), | 90 is_stream_(false), |
| 90 started_from_context_menu_(started_from_context_menu), | 91 started_from_context_menu_(started_from_context_menu), |
| 91 weak_factory_(this) { | 92 weak_factory_(this) { |
| 92 DCHECK(!navigation_start.is_null()); | 93 DCHECK(!navigation_start.is_null()); |
| 93 redirect_chain_.push_back(url); | 94 redirect_chain_.push_back(url); |
| 95 | |
| 96 starting_site_instance_ = | |
| 97 frame_tree_node_->current_frame_host()->GetSiteInstance(); | |
| 98 | |
| 94 GetDelegate()->DidStartNavigation(this); | 99 GetDelegate()->DidStartNavigation(this); |
| 95 | 100 |
| 96 if (IsInMainFrame()) { | 101 if (IsInMainFrame()) { |
| 97 TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( | 102 TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( |
| 98 "navigation", "Navigation StartToCommit", this, | 103 "navigation", "Navigation StartToCommit", this, |
| 99 navigation_start, "Initial URL", url_.spec()); | 104 navigation_start, "Initial URL", url_.spec()); |
| 100 } | 105 } |
| 101 } | 106 } |
| 102 | 107 |
| 103 NavigationHandleImpl::~NavigationHandleImpl() { | 108 NavigationHandleImpl::~NavigationHandleImpl() { |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 121 | 126 |
| 122 RequestContextType NavigationHandleImpl::GetRequestContextType() const { | 127 RequestContextType NavigationHandleImpl::GetRequestContextType() const { |
| 123 DCHECK_GE(state_, WILL_SEND_REQUEST); | 128 DCHECK_GE(state_, WILL_SEND_REQUEST); |
| 124 return request_context_type_; | 129 return request_context_type_; |
| 125 } | 130 } |
| 126 | 131 |
| 127 const GURL& NavigationHandleImpl::GetURL() { | 132 const GURL& NavigationHandleImpl::GetURL() { |
| 128 return url_; | 133 return url_; |
| 129 } | 134 } |
| 130 | 135 |
| 136 SiteInstance* NavigationHandleImpl::GetStartingSiteInstance() { | |
| 137 return starting_site_instance_.get(); | |
| 138 } | |
| 139 | |
| 131 bool NavigationHandleImpl::IsInMainFrame() { | 140 bool NavigationHandleImpl::IsInMainFrame() { |
| 132 return frame_tree_node_->IsMainFrame(); | 141 return frame_tree_node_->IsMainFrame(); |
| 133 } | 142 } |
| 134 | 143 |
| 135 bool NavigationHandleImpl::IsParentMainFrame() { | 144 bool NavigationHandleImpl::IsParentMainFrame() { |
| 136 if (frame_tree_node_->parent()) | 145 if (frame_tree_node_->parent()) |
| 137 return frame_tree_node_->parent()->IsMainFrame(); | 146 return frame_tree_node_->parent()->IsMainFrame(); |
| 138 | 147 |
| 139 return false; | 148 return false; |
| 140 } | 149 } |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 745 throttles_to_register.end()); | 754 throttles_to_register.end()); |
| 746 throttles_to_register.weak_clear(); | 755 throttles_to_register.weak_clear(); |
| 747 } | 756 } |
| 748 } | 757 } |
| 749 | 758 |
| 750 bool NavigationHandleImpl::WasStartedFromContextMenu() const { | 759 bool NavigationHandleImpl::WasStartedFromContextMenu() const { |
| 751 return started_from_context_menu_; | 760 return started_from_context_menu_; |
| 752 } | 761 } |
| 753 | 762 |
| 754 } // namespace content | 763 } // namespace content |
| OLD | NEW |