OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 are_javascript_messages_suppressed_(false), | 187 are_javascript_messages_suppressed_(false), |
188 sudden_termination_allowed_(false), | 188 sudden_termination_allowed_(false), |
189 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { | 189 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { |
190 DCHECK(instance_.get()); | 190 DCHECK(instance_.get()); |
191 CHECK(delegate_); // http://crbug.com/82827 | 191 CHECK(delegate_); // http://crbug.com/82827 |
192 | 192 |
193 if (main_frame_routing_id == MSG_ROUTING_NONE) | 193 if (main_frame_routing_id == MSG_ROUTING_NONE) |
194 main_frame_routing_id = GetProcess()->GetNextRoutingID(); | 194 main_frame_routing_id = GetProcess()->GetNextRoutingID(); |
195 | 195 |
196 main_render_frame_host_ = RenderFrameHostFactory::Create( | 196 main_render_frame_host_ = RenderFrameHostFactory::Create( |
197 this, frame_delegate, delegate_->GetFrameTree(), main_frame_routing_id, | 197 this, frame_delegate, delegate_->GetFrameTree(), |
198 is_swapped_out_); | 198 delegate_->GetFrameTree()->root(), |
| 199 main_frame_routing_id, is_swapped_out_); |
| 200 delegate_->GetFrameTree()->root()->set_render_frame_host( |
| 201 main_render_frame_host_.get(), false); |
199 | 202 |
200 GetProcess()->EnableSendQueue(); | 203 GetProcess()->EnableSendQueue(); |
201 | 204 |
202 if (!swapped_out) | 205 if (!swapped_out) |
203 instance_->increment_active_view_count(); | 206 instance_->increment_active_view_count(); |
204 | 207 |
205 if (ResourceDispatcherHostImpl::Get()) { | 208 if (ResourceDispatcherHostImpl::Get()) { |
206 BrowserThread::PostTask( | 209 BrowserThread::PostTask( |
207 BrowserThread::IO, FROM_HERE, | 210 BrowserThread::IO, FROM_HERE, |
208 base::Bind(&ResourceDispatcherHostImpl::OnRenderViewHostCreated, | 211 base::Bind(&ResourceDispatcherHostImpl::OnRenderViewHostCreated, |
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 delegate_->RenderViewTerminated(this, | 1412 delegate_->RenderViewTerminated(this, |
1410 static_cast<base::TerminationStatus>(status), | 1413 static_cast<base::TerminationStatus>(status), |
1411 exit_code); | 1414 exit_code); |
1412 } | 1415 } |
1413 | 1416 |
1414 void RenderViewHostImpl::OnDidStartProvisionalLoadForFrame( | 1417 void RenderViewHostImpl::OnDidStartProvisionalLoadForFrame( |
1415 int64 frame_id, | 1418 int64 frame_id, |
1416 int64 parent_frame_id, | 1419 int64 parent_frame_id, |
1417 bool is_main_frame, | 1420 bool is_main_frame, |
1418 const GURL& url) { | 1421 const GURL& url) { |
1419 delegate_->DidStartProvisionalLoadForFrame( | 1422 NOTREACHED(); |
1420 this, frame_id, parent_frame_id, is_main_frame, url); | |
1421 } | 1423 } |
1422 | 1424 |
1423 void RenderViewHostImpl::OnDidRedirectProvisionalLoad( | 1425 void RenderViewHostImpl::OnDidRedirectProvisionalLoad( |
1424 int32 page_id, | 1426 int32 page_id, |
1425 const GURL& source_url, | 1427 const GURL& source_url, |
1426 const GURL& target_url) { | 1428 const GURL& target_url) { |
1427 delegate_->DidRedirectProvisionalLoad( | 1429 delegate_->DidRedirectProvisionalLoad( |
1428 this, page_id, source_url, target_url); | 1430 this, page_id, source_url, target_url); |
1429 } | 1431 } |
1430 | 1432 |
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2297 void RenderViewHostImpl::AttachToFrameTree() { | 2299 void RenderViewHostImpl::AttachToFrameTree() { |
2298 FrameTree* frame_tree = delegate_->GetFrameTree(); | 2300 FrameTree* frame_tree = delegate_->GetFrameTree(); |
2299 | 2301 |
2300 frame_tree->SwapMainFrame(main_render_frame_host_.get()); | 2302 frame_tree->SwapMainFrame(main_render_frame_host_.get()); |
2301 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { | 2303 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { |
2302 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); | 2304 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); |
2303 } | 2305 } |
2304 } | 2306 } |
2305 | 2307 |
2306 } // namespace content | 2308 } // namespace content |
OLD | NEW |