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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 : render_view_host_(render_view_host), | 188 : render_view_host_(render_view_host), |
189 delegate_(delegate), | 189 delegate_(delegate), |
190 site_instance_(static_cast<SiteInstanceImpl*>(site_instance)), | 190 site_instance_(static_cast<SiteInstanceImpl*>(site_instance)), |
191 process_(site_instance->GetProcess()), | 191 process_(site_instance->GetProcess()), |
192 cross_process_frame_connector_(NULL), | 192 cross_process_frame_connector_(NULL), |
193 render_frame_proxy_host_(NULL), | 193 render_frame_proxy_host_(NULL), |
194 frame_tree_(frame_tree), | 194 frame_tree_(frame_tree), |
195 frame_tree_node_(frame_tree_node), | 195 frame_tree_node_(frame_tree_node), |
196 render_widget_host_(nullptr), | 196 render_widget_host_(nullptr), |
197 routing_id_(routing_id), | 197 routing_id_(routing_id), |
| 198 rfh_state_(STATE_DEFAULT), |
198 render_frame_created_(false), | 199 render_frame_created_(false), |
199 navigations_suspended_(false), | 200 navigations_suspended_(false), |
200 is_waiting_for_beforeunload_ack_(false), | 201 is_waiting_for_beforeunload_ack_(false), |
201 unload_ack_is_for_navigation_(false), | 202 unload_ack_is_for_navigation_(false), |
202 is_loading_(false), | 203 is_loading_(false), |
203 pending_commit_(false), | 204 pending_commit_(false), |
204 nav_entry_id_(0), | 205 nav_entry_id_(0), |
205 accessibility_reset_token_(0), | 206 accessibility_reset_token_(0), |
206 accessibility_reset_count_(0), | 207 accessibility_reset_count_(0), |
207 no_create_browser_accessibility_manager_for_testing_(false), | 208 no_create_browser_accessibility_manager_for_testing_(false), |
208 web_ui_type_(WebUI::kNoWebUI), | 209 web_ui_type_(WebUI::kNoWebUI), |
209 pending_web_ui_type_(WebUI::kNoWebUI), | 210 pending_web_ui_type_(WebUI::kNoWebUI), |
210 should_reuse_web_ui_(false), | 211 should_reuse_web_ui_(false), |
211 weak_ptr_factory_(this) { | 212 weak_ptr_factory_(this) { |
212 bool is_swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT); | |
213 bool hidden = !!(flags & CREATE_RF_HIDDEN); | 213 bool hidden = !!(flags & CREATE_RF_HIDDEN); |
214 frame_tree_->AddRenderViewHostRef(render_view_host_); | 214 frame_tree_->AddRenderViewHostRef(render_view_host_); |
215 GetProcess()->AddRoute(routing_id_, this); | 215 GetProcess()->AddRoute(routing_id_, this); |
216 g_routing_id_frame_map.Get().insert(std::make_pair( | 216 g_routing_id_frame_map.Get().insert(std::make_pair( |
217 RenderFrameHostID(GetProcess()->GetID(), routing_id_), | 217 RenderFrameHostID(GetProcess()->GetID(), routing_id_), |
218 this)); | 218 this)); |
219 site_instance_->AddObserver(this); | 219 site_instance_->AddObserver(this); |
220 | 220 GetSiteInstance()->IncrementActiveFrameCount(); |
221 if (is_swapped_out) { | |
222 rfh_state_ = STATE_SWAPPED_OUT; | |
223 } else { | |
224 rfh_state_ = STATE_DEFAULT; | |
225 GetSiteInstance()->IncrementActiveFrameCount(); | |
226 } | |
227 | 221 |
228 // New child frames should inherit the nav_entry_id of their parent. | 222 // New child frames should inherit the nav_entry_id of their parent. |
229 if (frame_tree_node_->parent()) { | 223 if (frame_tree_node_->parent()) { |
230 set_nav_entry_id( | 224 set_nav_entry_id( |
231 frame_tree_node_->parent()->current_frame_host()->nav_entry_id()); | 225 frame_tree_node_->parent()->current_frame_host()->nav_entry_id()); |
232 } | 226 } |
233 | 227 |
234 SetUpMojoIfNeeded(); | 228 SetUpMojoIfNeeded(); |
235 swapout_event_monitor_timeout_.reset(new TimeoutMonitor(base::Bind( | 229 swapout_event_monitor_timeout_.reset(new TimeoutMonitor(base::Bind( |
236 &RenderFrameHostImpl::OnSwappedOut, weak_ptr_factory_.GetWeakPtr()))); | 230 &RenderFrameHostImpl::OnSwappedOut, weak_ptr_factory_.GetWeakPtr()))); |
(...skipping 2475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2712 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame(); | 2706 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame(); |
2713 if (!focused_frame_tree_node) | 2707 if (!focused_frame_tree_node) |
2714 return; | 2708 return; |
2715 RenderFrameHostImpl* focused_frame = | 2709 RenderFrameHostImpl* focused_frame = |
2716 focused_frame_tree_node->current_frame_host(); | 2710 focused_frame_tree_node->current_frame_host(); |
2717 DCHECK(focused_frame); | 2711 DCHECK(focused_frame); |
2718 dst->focused_tree_id = focused_frame->GetAXTreeID(); | 2712 dst->focused_tree_id = focused_frame->GetAXTreeID(); |
2719 } | 2713 } |
2720 | 2714 |
2721 } // namespace content | 2715 } // namespace content |
OLD | NEW |