| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 | 558 |
| 559 BrowserAccessibilityManager* manager = | 559 BrowserAccessibilityManager* manager = |
| 560 parent_frame->browser_accessibility_manager(); | 560 parent_frame->browser_accessibility_manager(); |
| 561 if (!manager) | 561 if (!manager) |
| 562 return NULL; | 562 return NULL; |
| 563 | 563 |
| 564 return manager->GetFromID(parent_node_id); | 564 return manager->GetFromID(parent_node_id); |
| 565 } | 565 } |
| 566 | 566 |
| 567 bool RenderFrameHostImpl::CreateRenderFrame(int parent_routing_id, | 567 bool RenderFrameHostImpl::CreateRenderFrame(int parent_routing_id, |
| 568 int previous_sibling_routing_id, | |
| 569 int proxy_routing_id) { | 568 int proxy_routing_id) { |
| 570 TRACE_EVENT0("navigation", "RenderFrameHostImpl::CreateRenderFrame"); | 569 TRACE_EVENT0("navigation", "RenderFrameHostImpl::CreateRenderFrame"); |
| 571 DCHECK(!IsRenderFrameLive()) << "Creating frame twice"; | 570 DCHECK(!IsRenderFrameLive()) << "Creating frame twice"; |
| 572 | 571 |
| 573 // The process may (if we're sharing a process with another host that already | 572 // The process may (if we're sharing a process with another host that already |
| 574 // initialized it) or may not (we have our own process or the old process | 573 // initialized it) or may not (we have our own process or the old process |
| 575 // crashed) have been initialized. Calling Init multiple times will be | 574 // crashed) have been initialized. Calling Init multiple times will be |
| 576 // ignored, so this is safe. | 575 // ignored, so this is safe. |
| 577 if (!GetProcess()->Init()) | 576 if (!GetProcess()->Init()) |
| 578 return false; | 577 return false; |
| 579 | 578 |
| 580 DCHECK(GetProcess()->HasConnection()); | 579 DCHECK(GetProcess()->HasConnection()); |
| 581 | 580 |
| 582 FrameMsg_NewFrame_Params params; | 581 FrameMsg_NewFrame_WidgetParams widget_params; |
| 583 params.routing_id = routing_id_; | |
| 584 params.parent_routing_id = parent_routing_id; | |
| 585 params.proxy_routing_id = proxy_routing_id; | |
| 586 params.previous_sibling_routing_id = previous_sibling_routing_id; | |
| 587 params.replication_state = frame_tree_node()->current_replication_state(); | |
| 588 | |
| 589 if (render_widget_host_) { | 582 if (render_widget_host_) { |
| 590 params.widget_params.routing_id = render_widget_host_->GetRoutingID(); | 583 widget_params.routing_id = render_widget_host_->GetRoutingID(); |
| 591 params.widget_params.surface_id = render_widget_host_->surface_id(); | 584 widget_params.surface_id = render_widget_host_->surface_id(); |
| 592 params.widget_params.hidden = render_widget_host_->is_hidden(); | 585 widget_params.hidden = render_widget_host_->is_hidden(); |
| 593 } else { | 586 } else { |
| 594 // MSG_ROUTING_NONE will prevent a new RenderWidget from being created in | 587 // MSG_ROUTING_NONE will prevent a new RenderWidget from being created in |
| 595 // the renderer process. | 588 // the renderer process. |
| 596 params.widget_params.routing_id = MSG_ROUTING_NONE; | 589 widget_params.routing_id = MSG_ROUTING_NONE; |
| 597 params.widget_params.surface_id = 0; | 590 widget_params.surface_id = 0; |
| 598 params.widget_params.hidden = true; | 591 widget_params.hidden = true; |
| 599 } | 592 } |
| 600 | 593 |
| 601 Send(new FrameMsg_NewFrame(params)); | 594 Send(new FrameMsg_NewFrame(routing_id_, parent_routing_id, proxy_routing_id, |
| 595 frame_tree_node()->current_replication_state(), |
| 596 widget_params)); |
| 602 | 597 |
| 603 // The RenderWidgetHost takes ownership of its view. It is tied to the | 598 // The RenderWidgetHost takes ownership of its view. It is tied to the |
| 604 // lifetime of the current RenderProcessHost for this RenderFrameHost. | 599 // lifetime of the current RenderProcessHost for this RenderFrameHost. |
| 605 if (render_widget_host_) { | 600 if (render_widget_host_) { |
| 606 RenderWidgetHostView* rwhv = | 601 RenderWidgetHostView* rwhv = |
| 607 new RenderWidgetHostViewChildFrame(render_widget_host_); | 602 new RenderWidgetHostViewChildFrame(render_widget_host_); |
| 608 rwhv->Hide(); | 603 rwhv->Hide(); |
| 609 } | 604 } |
| 610 | 605 |
| 611 if (proxy_routing_id != MSG_ROUTING_NONE) { | 606 if (proxy_routing_id != MSG_ROUTING_NONE) { |
| (...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2074 // We may be returning to an existing NavigationEntry that had been granted | 2069 // We may be returning to an existing NavigationEntry that had been granted |
| 2075 // file access. If this is a different process, we will need to grant the | 2070 // file access. If this is a different process, we will need to grant the |
| 2076 // access again. The files listed in the page state are validated when they | 2071 // access again. The files listed in the page state are validated when they |
| 2077 // are received from the renderer to prevent abuse. | 2072 // are received from the renderer to prevent abuse. |
| 2078 if (request_params.page_state.IsValid()) { | 2073 if (request_params.page_state.IsValid()) { |
| 2079 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); | 2074 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); |
| 2080 } | 2075 } |
| 2081 } | 2076 } |
| 2082 | 2077 |
| 2083 } // namespace content | 2078 } // namespace content |
| OLD | NEW |