Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "content/browser/child_process_security_policy_impl.h" | |
| 13 #include "content/browser/frame_host/debug_urls.h" | 14 #include "content/browser/frame_host/debug_urls.h" |
| 14 #include "content/browser/frame_host/frame_tree.h" | 15 #include "content/browser/frame_host/frame_tree.h" |
| 15 #include "content/browser/frame_host/frame_tree_node.h" | 16 #include "content/browser/frame_host/frame_tree_node.h" |
| 16 #include "content/browser/frame_host/navigation_controller_impl.h" | 17 #include "content/browser/frame_host/navigation_controller_impl.h" |
| 17 #include "content/browser/frame_host/navigation_entry_impl.h" | 18 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 18 #include "content/browser/frame_host/navigation_handle_impl.h" | 19 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 19 #include "content/browser/frame_host/navigation_request.h" | 20 #include "content/browser/frame_host/navigation_request.h" |
| 20 #include "content/browser/frame_host/navigation_request_info.h" | 21 #include "content/browser/frame_host/navigation_request_info.h" |
| 21 #include "content/browser/frame_host/navigator_delegate.h" | 22 #include "content/browser/frame_host/navigator_delegate.h" |
| 22 #include "content/browser/frame_host/render_frame_host_impl.h" | 23 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 24 #include "content/browser/renderer_host/render_process_host_impl.h" | |
| 23 #include "content/browser/renderer_host/render_view_host_impl.h" | 25 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 24 #include "content/browser/site_instance_impl.h" | 26 #include "content/browser/site_instance_impl.h" |
| 25 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 27 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
| 26 #include "content/browser/webui/web_ui_impl.h" | 28 #include "content/browser/webui/web_ui_impl.h" |
| 27 #include "content/common/frame_messages.h" | 29 #include "content/common/frame_messages.h" |
| 28 #include "content/common/navigation_params.h" | 30 #include "content/common/navigation_params.h" |
| 29 #include "content/common/page_messages.h" | 31 #include "content/common/page_messages.h" |
| 30 #include "content/common/site_isolation_policy.h" | 32 #include "content/common/site_isolation_policy.h" |
| 31 #include "content/common/view_messages.h" | 33 #include "content/common/view_messages.h" |
| 32 #include "content/public/browser/browser_context.h" | 34 #include "content/public/browser/browser_context.h" |
| (...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1126 nullptr, // body | 1128 nullptr, // body |
| 1127 navigation_request->common_params(), | 1129 navigation_request->common_params(), |
| 1128 navigation_request->request_params(), | 1130 navigation_request->request_params(), |
| 1129 navigation_request->is_view_source()); | 1131 navigation_request->is_view_source()); |
| 1130 return; | 1132 return; |
| 1131 } | 1133 } |
| 1132 | 1134 |
| 1133 frame_tree_node->CreatedNavigationRequest(std::move(scoped_request)); | 1135 frame_tree_node->CreatedNavigationRequest(std::move(scoped_request)); |
| 1134 navigation_request->CreateNavigationHandle(entry.GetUniqueID()); | 1136 navigation_request->CreateNavigationHandle(entry.GetUniqueID()); |
| 1135 | 1137 |
| 1138 // Grant access to the process associated with the RFH to ensure that the | |
| 1139 // navigation completes. | |
| 1140 if (frame_tree_node->current_frame_host()->GetProcess()) { | |
| 1141 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( | |
|
nasko
2016/10/21 21:21:07
Why are we doing this grant here? The process is e
ananta
2016/10/21 21:53:01
If we don't grant access here(e.g. file://), it fa
| |
| 1142 frame_tree_node->current_frame_host()->GetProcess()->GetID(), | |
| 1143 dest_url); | |
| 1144 } | |
| 1145 | |
| 1136 // Have the current renderer execute its beforeunload event if needed. If it | 1146 // Have the current renderer execute its beforeunload event if needed. If it |
| 1137 // is not needed then NavigationRequest::BeginNavigation should be directly | 1147 // is not needed then NavigationRequest::BeginNavigation should be directly |
| 1138 // called instead. | 1148 // called instead. |
| 1139 if (should_dispatch_beforeunload && !IsRendererDebugURL(dest_url)) { | 1149 if (should_dispatch_beforeunload && !IsRendererDebugURL(dest_url)) { |
| 1140 navigation_request->SetWaitingForRendererResponse(); | 1150 navigation_request->SetWaitingForRendererResponse(); |
| 1141 frame_tree_node->current_frame_host()->DispatchBeforeUnload( | 1151 frame_tree_node->current_frame_host()->DispatchBeforeUnload( |
| 1142 true, reload_type != ReloadType::NONE); | 1152 true, reload_type != ReloadType::NONE); |
| 1143 } else { | 1153 } else { |
| 1144 navigation_request->BeginNavigation(); | 1154 navigation_request->BeginNavigation(); |
| 1145 } | 1155 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1237 if (navigation_handle) | 1247 if (navigation_handle) |
| 1238 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); | 1248 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); |
| 1239 | 1249 |
| 1240 controller_->SetPendingEntry(std::move(entry)); | 1250 controller_->SetPendingEntry(std::move(entry)); |
| 1241 if (delegate_) | 1251 if (delegate_) |
| 1242 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 1252 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
| 1243 } | 1253 } |
| 1244 } | 1254 } |
| 1245 | 1255 |
| 1246 } // namespace content | 1256 } // namespace content |
| OLD | NEW |