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/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 is_loading_(false), | 205 is_loading_(false), |
206 pending_commit_(false), | 206 pending_commit_(false), |
207 nav_entry_id_(0), | 207 nav_entry_id_(0), |
208 accessibility_reset_token_(0), | 208 accessibility_reset_token_(0), |
209 accessibility_reset_count_(0), | 209 accessibility_reset_count_(0), |
210 browser_plugin_embedder_ax_tree_id_(AXTreeIDRegistry::kNoAXTreeID), | 210 browser_plugin_embedder_ax_tree_id_(AXTreeIDRegistry::kNoAXTreeID), |
211 no_create_browser_accessibility_manager_for_testing_(false), | 211 no_create_browser_accessibility_manager_for_testing_(false), |
212 web_ui_type_(WebUI::kNoWebUI), | 212 web_ui_type_(WebUI::kNoWebUI), |
213 pending_web_ui_type_(WebUI::kNoWebUI), | 213 pending_web_ui_type_(WebUI::kNoWebUI), |
214 should_reuse_web_ui_(false), | 214 should_reuse_web_ui_(false), |
215 is_in_commit_(false), | |
216 last_navigation_lofi_state_(LOFI_UNSPECIFIED), | 215 last_navigation_lofi_state_(LOFI_UNSPECIFIED), |
217 weak_ptr_factory_(this) { | 216 weak_ptr_factory_(this) { |
218 frame_tree_->AddRenderViewHostRef(render_view_host_); | 217 frame_tree_->AddRenderViewHostRef(render_view_host_); |
219 GetProcess()->AddRoute(routing_id_, this); | 218 GetProcess()->AddRoute(routing_id_, this); |
220 g_routing_id_frame_map.Get().insert(std::make_pair( | 219 g_routing_id_frame_map.Get().insert(std::make_pair( |
221 RenderFrameHostID(GetProcess()->GetID(), routing_id_), | 220 RenderFrameHostID(GetProcess()->GetID(), routing_id_), |
222 this)); | 221 this)); |
223 site_instance_->AddObserver(this); | 222 site_instance_->AddObserver(this); |
224 GetSiteInstance()->IncrementActiveFrameCount(); | 223 GetSiteInstance()->IncrementActiveFrameCount(); |
225 | 224 |
(...skipping 26 matching lines...) Expand all Loading... |
252 static_cast<InputRouterImpl*>(render_widget_host_->input_router()); | 251 static_cast<InputRouterImpl*>(render_widget_host_->input_router()); |
253 ir->SetFrameTreeNodeId(frame_tree_node_->frame_tree_node_id()); | 252 ir->SetFrameTreeNodeId(frame_tree_node_->frame_tree_node_id()); |
254 } | 253 } |
255 } | 254 } |
256 | 255 |
257 RenderFrameHostImpl::~RenderFrameHostImpl() { | 256 RenderFrameHostImpl::~RenderFrameHostImpl() { |
258 // Release the WebUI instances before all else as the WebUI may accesses the | 257 // Release the WebUI instances before all else as the WebUI may accesses the |
259 // RenderFrameHost during cleanup. | 258 // RenderFrameHost during cleanup. |
260 ClearAllWebUI(); | 259 ClearAllWebUI(); |
261 | 260 |
262 CHECK(!is_in_commit_); | |
263 | |
264 GetProcess()->RemoveRoute(routing_id_); | 261 GetProcess()->RemoveRoute(routing_id_); |
265 g_routing_id_frame_map.Get().erase( | 262 g_routing_id_frame_map.Get().erase( |
266 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); | 263 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); |
267 | 264 |
268 site_instance_->RemoveObserver(this); | 265 site_instance_->RemoveObserver(this); |
269 | 266 |
270 if (delegate_ && render_frame_created_) | 267 if (delegate_ && render_frame_created_) |
271 delegate_->RenderFrameDeleted(this); | 268 delegate_->RenderFrameDeleted(this); |
272 | 269 |
273 bool is_active = IsRFHStateActive(rfh_state_); | 270 bool is_active = IsRFHStateActive(rfh_state_); |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 // has not been notified about the start of the load yet. Do it now. | 1081 // has not been notified about the start of the load yet. Do it now. |
1085 if (!is_loading()) { | 1082 if (!is_loading()) { |
1086 bool was_loading = frame_tree_node()->frame_tree()->IsLoading(); | 1083 bool was_loading = frame_tree_node()->frame_tree()->IsLoading(); |
1087 is_loading_ = true; | 1084 is_loading_ = true; |
1088 frame_tree_node()->DidStartLoading(true, was_loading); | 1085 frame_tree_node()->DidStartLoading(true, was_loading); |
1089 } | 1086 } |
1090 pending_commit_ = false; | 1087 pending_commit_ = false; |
1091 } | 1088 } |
1092 } | 1089 } |
1093 | 1090 |
1094 // TODO(clamy): Remove this once enough data has been gathered for | |
1095 // crbug.com/589365. | |
1096 is_in_commit_ = true; | |
1097 navigation_handle_->set_is_in_commit(true); | |
1098 | |
1099 accessibility_reset_count_ = 0; | 1091 accessibility_reset_count_ = 0; |
1100 frame_tree_node()->navigator()->DidNavigate(this, validated_params); | 1092 frame_tree_node()->navigator()->DidNavigate(this, validated_params); |
1101 | 1093 |
1102 // TODO(clamy): Remove this once enough data has been gathered for | |
1103 // crbug.com/589365. | |
1104 is_in_commit_ = false; | |
1105 if (navigation_handle_.get()) | |
1106 navigation_handle_->set_is_in_commit(false); | |
1107 | |
1108 // For a top-level frame, there are potential security concerns associated | 1094 // For a top-level frame, there are potential security concerns associated |
1109 // with displaying graphics from a previously loaded page after the URL in | 1095 // with displaying graphics from a previously loaded page after the URL in |
1110 // the omnibar has been changed. It is unappealing to clear the page | 1096 // the omnibar has been changed. It is unappealing to clear the page |
1111 // immediately, but if the renderer is taking a long time to issue any | 1097 // immediately, but if the renderer is taking a long time to issue any |
1112 // compositor output (possibly because of script deliberately creating this | 1098 // compositor output (possibly because of script deliberately creating this |
1113 // situation) then we clear it after a while anyway. | 1099 // situation) then we clear it after a while anyway. |
1114 // See https://crbug.com/497588. | 1100 // See https://crbug.com/497588. |
1115 if (frame_tree_node_->IsMainFrame() && GetView() && | 1101 if (frame_tree_node_->IsMainFrame() && GetView() && |
1116 !validated_params.was_within_same_page) { | 1102 !validated_params.was_within_same_page) { |
1117 RenderWidgetHostImpl::From(GetView()->GetRenderWidgetHost()) | 1103 RenderWidgetHostImpl::From(GetView()->GetRenderWidgetHost()) |
(...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2758 } | 2744 } |
2759 | 2745 |
2760 void RenderFrameHostImpl::CreateWebBluetoothService( | 2746 void RenderFrameHostImpl::CreateWebBluetoothService( |
2761 blink::mojom::WebBluetoothServiceRequest request) { | 2747 blink::mojom::WebBluetoothServiceRequest request) { |
2762 DCHECK(!web_bluetooth_service_); | 2748 DCHECK(!web_bluetooth_service_); |
2763 web_bluetooth_service_.reset( | 2749 web_bluetooth_service_.reset( |
2764 new WebBluetoothServiceImpl(this, std::move(request))); | 2750 new WebBluetoothServiceImpl(this, std::move(request))); |
2765 } | 2751 } |
2766 | 2752 |
2767 } // namespace content | 2753 } // namespace content |
OLD | NEW |