| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 are_javascript_messages_suppressed_(false), | 184 are_javascript_messages_suppressed_(false), |
| 185 sudden_termination_allowed_(false), | 185 sudden_termination_allowed_(false), |
| 186 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { | 186 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { |
| 187 DCHECK(instance_.get()); | 187 DCHECK(instance_.get()); |
| 188 CHECK(delegate_); // http://crbug.com/82827 | 188 CHECK(delegate_); // http://crbug.com/82827 |
| 189 | 189 |
| 190 if (main_frame_routing_id == MSG_ROUTING_NONE) | 190 if (main_frame_routing_id == MSG_ROUTING_NONE) |
| 191 main_frame_routing_id = GetProcess()->GetNextRoutingID(); | 191 main_frame_routing_id = GetProcess()->GetNextRoutingID(); |
| 192 | 192 |
| 193 main_render_frame_host_ = RenderFrameHostFactory::Create( | 193 main_render_frame_host_ = RenderFrameHostFactory::Create( |
| 194 this, delegate_->GetFrameTree(), main_frame_routing_id, is_swapped_out_); | 194 this, delegate_->GetFrameTree(), delegate_->GetFrameTree()->root(), |
| 195 main_frame_routing_id, is_swapped_out_); |
| 196 delegate_->GetFrameTree()->root()->set_render_frame_host( |
| 197 main_render_frame_host_.get(), false); |
| 195 | 198 |
| 196 GetProcess()->EnableSendQueue(); | 199 GetProcess()->EnableSendQueue(); |
| 197 | 200 |
| 198 if (!swapped_out) | 201 if (!swapped_out) |
| 199 instance_->increment_active_view_count(); | 202 instance_->increment_active_view_count(); |
| 200 | 203 |
| 201 if (ResourceDispatcherHostImpl::Get()) { | 204 if (ResourceDispatcherHostImpl::Get()) { |
| 202 BrowserThread::PostTask( | 205 BrowserThread::PostTask( |
| 203 BrowserThread::IO, FROM_HERE, | 206 BrowserThread::IO, FROM_HERE, |
| 204 base::Bind(&ResourceDispatcherHostImpl::OnRenderViewHostCreated, | 207 base::Bind(&ResourceDispatcherHostImpl::OnRenderViewHostCreated, |
| (...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1391 delegate_->RenderViewTerminated(this, | 1394 delegate_->RenderViewTerminated(this, |
| 1392 static_cast<base::TerminationStatus>(status), | 1395 static_cast<base::TerminationStatus>(status), |
| 1393 exit_code); | 1396 exit_code); |
| 1394 } | 1397 } |
| 1395 | 1398 |
| 1396 void RenderViewHostImpl::OnDidStartProvisionalLoadForFrame( | 1399 void RenderViewHostImpl::OnDidStartProvisionalLoadForFrame( |
| 1397 int64 frame_id, | 1400 int64 frame_id, |
| 1398 int64 parent_frame_id, | 1401 int64 parent_frame_id, |
| 1399 bool is_main_frame, | 1402 bool is_main_frame, |
| 1400 const GURL& url) { | 1403 const GURL& url) { |
| 1401 delegate_->DidStartProvisionalLoadForFrame( | 1404 NOTREACHED(); |
| 1402 this, frame_id, parent_frame_id, is_main_frame, url); | |
| 1403 } | 1405 } |
| 1404 | 1406 |
| 1405 void RenderViewHostImpl::OnDidRedirectProvisionalLoad( | 1407 void RenderViewHostImpl::OnDidRedirectProvisionalLoad( |
| 1406 int32 page_id, | 1408 int32 page_id, |
| 1407 const GURL& source_url, | 1409 const GURL& source_url, |
| 1408 const GURL& target_url) { | 1410 const GURL& target_url) { |
| 1409 delegate_->DidRedirectProvisionalLoad( | 1411 delegate_->DidRedirectProvisionalLoad( |
| 1410 this, page_id, source_url, target_url); | 1412 this, page_id, source_url, target_url); |
| 1411 } | 1413 } |
| 1412 | 1414 |
| (...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2278 void RenderViewHostImpl::AttachToFrameTree() { | 2280 void RenderViewHostImpl::AttachToFrameTree() { |
| 2279 FrameTree* frame_tree = delegate_->GetFrameTree(); | 2281 FrameTree* frame_tree = delegate_->GetFrameTree(); |
| 2280 | 2282 |
| 2281 frame_tree->SwapMainFrame(main_render_frame_host_.get()); | 2283 frame_tree->SwapMainFrame(main_render_frame_host_.get()); |
| 2282 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { | 2284 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { |
| 2283 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); | 2285 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); |
| 2284 } | 2286 } |
| 2285 } | 2287 } |
| 2286 | 2288 |
| 2287 } // namespace content | 2289 } // namespace content |
| OLD | NEW |