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" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 navigation_start_(navigation_start), | 84 navigation_start_(navigation_start), |
85 pending_nav_entry_id_(pending_nav_entry_id), | 85 pending_nav_entry_id_(pending_nav_entry_id), |
86 request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED), | 86 request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED), |
87 should_replace_current_entry_(false), | 87 should_replace_current_entry_(false), |
88 is_download_(false), | 88 is_download_(false), |
89 is_stream_(false), | 89 is_stream_(false), |
90 started_from_context_menu_(started_from_context_menu), | 90 started_from_context_menu_(started_from_context_menu), |
91 weak_factory_(this) { | 91 weak_factory_(this) { |
92 DCHECK(!navigation_start.is_null()); | 92 DCHECK(!navigation_start.is_null()); |
93 redirect_chain_.push_back(url); | 93 redirect_chain_.push_back(url); |
| 94 |
| 95 starting_site_instance_ = |
| 96 frame_tree_node_->current_frame_host()->GetSiteInstance(); |
| 97 |
94 GetDelegate()->DidStartNavigation(this); | 98 GetDelegate()->DidStartNavigation(this); |
95 | 99 |
96 if (IsInMainFrame()) { | 100 if (IsInMainFrame()) { |
97 TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( | 101 TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( |
98 "navigation", "Navigation StartToCommit", this, | 102 "navigation", "Navigation StartToCommit", this, |
99 navigation_start, "Initial URL", url_.spec()); | 103 navigation_start, "Initial URL", url_.spec()); |
100 } | 104 } |
101 } | 105 } |
102 | 106 |
103 NavigationHandleImpl::~NavigationHandleImpl() { | 107 NavigationHandleImpl::~NavigationHandleImpl() { |
(...skipping 17 matching lines...) Expand all Loading... |
121 | 125 |
122 RequestContextType NavigationHandleImpl::GetRequestContextType() const { | 126 RequestContextType NavigationHandleImpl::GetRequestContextType() const { |
123 DCHECK_GE(state_, WILL_SEND_REQUEST); | 127 DCHECK_GE(state_, WILL_SEND_REQUEST); |
124 return request_context_type_; | 128 return request_context_type_; |
125 } | 129 } |
126 | 130 |
127 const GURL& NavigationHandleImpl::GetURL() { | 131 const GURL& NavigationHandleImpl::GetURL() { |
128 return url_; | 132 return url_; |
129 } | 133 } |
130 | 134 |
| 135 SiteInstance* NavigationHandleImpl::GetStartingSiteInstance() { |
| 136 return starting_site_instance_.get(); |
| 137 } |
| 138 |
131 bool NavigationHandleImpl::IsInMainFrame() { | 139 bool NavigationHandleImpl::IsInMainFrame() { |
132 return frame_tree_node_->IsMainFrame(); | 140 return frame_tree_node_->IsMainFrame(); |
133 } | 141 } |
134 | 142 |
135 bool NavigationHandleImpl::IsParentMainFrame() { | 143 bool NavigationHandleImpl::IsParentMainFrame() { |
136 if (frame_tree_node_->parent()) | 144 if (frame_tree_node_->parent()) |
137 return frame_tree_node_->parent()->IsMainFrame(); | 145 return frame_tree_node_->parent()->IsMainFrame(); |
138 | 146 |
139 return false; | 147 return false; |
140 } | 148 } |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 throttles_to_register.end()); | 753 throttles_to_register.end()); |
746 throttles_to_register.weak_clear(); | 754 throttles_to_register.weak_clear(); |
747 } | 755 } |
748 } | 756 } |
749 | 757 |
750 bool NavigationHandleImpl::WasStartedFromContextMenu() const { | 758 bool NavigationHandleImpl::WasStartedFromContextMenu() const { |
751 return started_from_context_menu_; | 759 return started_from_context_menu_; |
752 } | 760 } |
753 | 761 |
754 } // namespace content | 762 } // namespace content |
OLD | NEW |