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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 instance->GetProcess(), | 199 instance->GetProcess(), |
200 routing_id, | 200 routing_id, |
201 hidden), | 201 hidden), |
202 frames_ref_count_(0), | 202 frames_ref_count_(0), |
203 delegate_(delegate), | 203 delegate_(delegate), |
204 instance_(static_cast<SiteInstanceImpl*>(instance)), | 204 instance_(static_cast<SiteInstanceImpl*>(instance)), |
205 waiting_for_drag_context_response_(false), | 205 waiting_for_drag_context_response_(false), |
206 enabled_bindings_(0), | 206 enabled_bindings_(0), |
207 navigations_suspended_(false), | 207 navigations_suspended_(false), |
208 has_accessed_initial_document_(false), | 208 has_accessed_initial_document_(false), |
209 main_frame_id_(-1), | |
210 main_frame_routing_id_(main_frame_routing_id), | 209 main_frame_routing_id_(main_frame_routing_id), |
211 run_modal_reply_msg_(NULL), | 210 run_modal_reply_msg_(NULL), |
212 run_modal_opener_id_(MSG_ROUTING_NONE), | 211 run_modal_opener_id_(MSG_ROUTING_NONE), |
213 is_waiting_for_beforeunload_ack_(false), | 212 is_waiting_for_beforeunload_ack_(false), |
214 unload_ack_is_for_cross_site_transition_(false), | 213 unload_ack_is_for_cross_site_transition_(false), |
215 are_javascript_messages_suppressed_(false), | 214 are_javascript_messages_suppressed_(false), |
216 sudden_termination_allowed_(false), | 215 sudden_termination_allowed_(false), |
217 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING), | 216 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING), |
218 virtual_keyboard_requested_(false), | 217 virtual_keyboard_requested_(false), |
219 weak_factory_(this) { | 218 weak_factory_(this) { |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 const GlobalRequestID& global_request_id, | 660 const GlobalRequestID& global_request_id, |
662 scoped_ptr<CrossSiteTransferringRequest> cross_site_transferring_request, | 661 scoped_ptr<CrossSiteTransferringRequest> cross_site_transferring_request, |
663 const std::vector<GURL>& transfer_url_chain, | 662 const std::vector<GURL>& transfer_url_chain, |
664 const Referrer& referrer, | 663 const Referrer& referrer, |
665 PageTransition page_transition, | 664 PageTransition page_transition, |
666 int64 frame_id, | 665 int64 frame_id, |
667 bool should_replace_current_entry) { | 666 bool should_replace_current_entry) { |
668 FrameTreeNode* node = NULL; | 667 FrameTreeNode* node = NULL; |
669 if (frame_id != -1 && | 668 if (frame_id != -1 && |
670 CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) { | 669 CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) { |
671 node = delegate_->GetFrameTree()->FindByFrameID(frame_id); | 670 node = delegate_->GetFrameTree()->FindByRoutingID(frame_id, |
| 671 GetProcess()->GetID()); |
672 } | 672 } |
673 | 673 |
674 // TODO(creis): We should always be able to get the RFHM for a frame_id, | 674 // TODO(creis): We should always be able to get the RFHM for a frame_id, |
675 // but today the frame_id is -1 for the main frame. | 675 // but today the frame_id is -1 for the main frame. |
676 RenderViewHostDelegate::RendererManagement* manager = node ? | 676 RenderViewHostDelegate::RendererManagement* manager = node ? |
677 node->render_manager() : delegate_->GetRendererManagementDelegate(); | 677 node->render_manager() : delegate_->GetRendererManagementDelegate(); |
678 manager->OnCrossSiteResponse(this, global_request_id, | 678 manager->OnCrossSiteResponse(this, global_request_id, |
679 cross_site_transferring_request.Pass(), | 679 cross_site_transferring_request.Pass(), |
680 transfer_url_chain, referrer, page_transition, | 680 transfer_url_chain, referrer, page_transition, |
681 frame_id, should_replace_current_entry); | 681 frame_id, should_replace_current_entry); |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1374 delegate_->RenderViewReady(this); | 1374 delegate_->RenderViewReady(this); |
1375 } | 1375 } |
1376 | 1376 |
1377 void RenderViewHostImpl::OnRenderProcessGone(int status, int exit_code) { | 1377 void RenderViewHostImpl::OnRenderProcessGone(int status, int exit_code) { |
1378 // Keep the termination status so we can get at it later when we | 1378 // Keep the termination status so we can get at it later when we |
1379 // need to know why it died. | 1379 // need to know why it died. |
1380 render_view_termination_status_ = | 1380 render_view_termination_status_ = |
1381 static_cast<base::TerminationStatus>(status); | 1381 static_cast<base::TerminationStatus>(status); |
1382 | 1382 |
1383 // Reset frame tree state associated with this process. | 1383 // Reset frame tree state associated with this process. |
1384 main_frame_id_ = -1; | |
1385 delegate_->GetFrameTree()->RenderProcessGone(this); | 1384 delegate_->GetFrameTree()->RenderProcessGone(this); |
1386 | 1385 |
1387 // Our base class RenderWidgetHost needs to reset some stuff. | 1386 // Our base class RenderWidgetHost needs to reset some stuff. |
1388 RendererExited(render_view_termination_status_, exit_code); | 1387 RendererExited(render_view_termination_status_, exit_code); |
1389 | 1388 |
1390 delegate_->RenderViewTerminated(this, | 1389 delegate_->RenderViewTerminated(this, |
1391 static_cast<base::TerminationStatus>(status), | 1390 static_cast<base::TerminationStatus>(status), |
1392 exit_code); | 1391 exit_code); |
1393 } | 1392 } |
1394 | 1393 |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2104 if (!policy->CanReadFile(GetProcess()->GetID(), *file)) | 2103 if (!policy->CanReadFile(GetProcess()->GetID(), *file)) |
2105 return false; | 2104 return false; |
2106 } | 2105 } |
2107 return true; | 2106 return true; |
2108 } | 2107 } |
2109 | 2108 |
2110 void RenderViewHostImpl::AttachToFrameTree() { | 2109 void RenderViewHostImpl::AttachToFrameTree() { |
2111 FrameTree* frame_tree = delegate_->GetFrameTree(); | 2110 FrameTree* frame_tree = delegate_->GetFrameTree(); |
2112 | 2111 |
2113 frame_tree->ResetForMainFrameSwap(); | 2112 frame_tree->ResetForMainFrameSwap(); |
2114 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { | |
2115 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); | |
2116 } | |
2117 } | 2113 } |
2118 | 2114 |
2119 } // namespace content | 2115 } // namespace content |
OLD | NEW |