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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 instance_(static_cast<SiteInstanceImpl*>(instance)), | 176 instance_(static_cast<SiteInstanceImpl*>(instance)), |
177 waiting_for_drag_context_response_(false), | 177 waiting_for_drag_context_response_(false), |
178 enabled_bindings_(0), | 178 enabled_bindings_(0), |
179 page_id_(-1), | 179 page_id_(-1), |
180 is_active_(!swapped_out), | 180 is_active_(!swapped_out), |
181 is_swapped_out_(swapped_out), | 181 is_swapped_out_(swapped_out), |
182 main_frame_routing_id_(main_frame_routing_id), | 182 main_frame_routing_id_(main_frame_routing_id), |
183 run_modal_reply_msg_(NULL), | 183 run_modal_reply_msg_(NULL), |
184 run_modal_opener_id_(MSG_ROUTING_NONE), | 184 run_modal_opener_id_(MSG_ROUTING_NONE), |
185 is_waiting_for_close_ack_(false), | 185 is_waiting_for_close_ack_(false), |
186 sudden_termination_allowed_(false), | |
187 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING), | 186 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING), |
188 virtual_keyboard_requested_(false), | 187 virtual_keyboard_requested_(false), |
189 is_focused_element_editable_(false), | 188 is_focused_element_editable_(false), |
190 updating_web_preferences_(false), | 189 updating_web_preferences_(false), |
191 weak_factory_(this) { | 190 weak_factory_(this) { |
192 DCHECK(instance_.get()); | 191 DCHECK(instance_.get()); |
193 CHECK(delegate_); // http://crbug.com/82827 | 192 CHECK(delegate_); // http://crbug.com/82827 |
194 | 193 |
195 GetProcess()->EnableSendQueue(); | 194 GetProcess()->EnableSendQueue(); |
196 | 195 |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 // This RenderViewHost doesn't have a live renderer, so just skip the unload | 539 // This RenderViewHost doesn't have a live renderer, so just skip the unload |
541 // event and close the page. | 540 // event and close the page. |
542 ClosePageIgnoringUnloadEvents(); | 541 ClosePageIgnoringUnloadEvents(); |
543 } | 542 } |
544 } | 543 } |
545 | 544 |
546 void RenderViewHostImpl::ClosePageIgnoringUnloadEvents() { | 545 void RenderViewHostImpl::ClosePageIgnoringUnloadEvents() { |
547 StopHangMonitorTimeout(); | 546 StopHangMonitorTimeout(); |
548 is_waiting_for_close_ack_ = false; | 547 is_waiting_for_close_ack_ = false; |
549 | 548 |
550 sudden_termination_allowed_ = true; | |
551 delegate_->Close(this); | 549 delegate_->Close(this); |
552 } | 550 } |
553 | 551 |
554 #if defined(OS_ANDROID) | 552 #if defined(OS_ANDROID) |
555 void RenderViewHostImpl::ActivateNearestFindResult(int request_id, | 553 void RenderViewHostImpl::ActivateNearestFindResult(int request_id, |
556 float x, | 554 float x, |
557 float y) { | 555 float y) { |
558 Send(new InputMsg_ActivateNearestFindResult(GetRoutingID(), | 556 Send(new InputMsg_ActivateNearestFindResult(GetRoutingID(), |
559 request_id, x, y)); | 557 request_id, x, y)); |
560 } | 558 } |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 } | 829 } |
832 | 830 |
833 void RenderViewHostImpl::LoadStateChanged( | 831 void RenderViewHostImpl::LoadStateChanged( |
834 const GURL& url, | 832 const GURL& url, |
835 const net::LoadStateWithParam& load_state, | 833 const net::LoadStateWithParam& load_state, |
836 uint64 upload_position, | 834 uint64 upload_position, |
837 uint64 upload_size) { | 835 uint64 upload_size) { |
838 delegate_->LoadStateChanged(url, load_state, upload_position, upload_size); | 836 delegate_->LoadStateChanged(url, load_state, upload_position, upload_size); |
839 } | 837 } |
840 | 838 |
841 bool RenderViewHostImpl::SuddenTerminationAllowed() const { | |
842 return sudden_termination_allowed_ || | |
843 GetProcess()->SuddenTerminationAllowed(); | |
844 } | |
845 | |
846 /////////////////////////////////////////////////////////////////////////////// | 839 /////////////////////////////////////////////////////////////////////////////// |
847 // RenderViewHostImpl, IPC message handlers: | 840 // RenderViewHostImpl, IPC message handlers: |
848 | 841 |
849 bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) { | 842 bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) { |
850 if (!BrowserMessageFilter::CheckCanDispatchOnUI(msg, this)) | 843 if (!BrowserMessageFilter::CheckCanDispatchOnUI(msg, this)) |
851 return true; | 844 return true; |
852 | 845 |
853 // Filter out most IPC messages if this renderer is swapped out. | 846 // Filter out most IPC messages if this renderer is swapped out. |
854 // We still want to handle certain ACKs to keep our state consistent. | 847 // We still want to handle certain ACKs to keep our state consistent. |
855 if (is_swapped_out_) { | 848 if (is_swapped_out_) { |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1471 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1464 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1472 | 1465 |
1473 frame_tree->ResetForMainFrameSwap(); | 1466 frame_tree->ResetForMainFrameSwap(); |
1474 } | 1467 } |
1475 | 1468 |
1476 void RenderViewHostImpl::SelectWordAroundCaret() { | 1469 void RenderViewHostImpl::SelectWordAroundCaret() { |
1477 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1470 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1478 } | 1471 } |
1479 | 1472 |
1480 } // namespace content | 1473 } // namespace content |
OLD | NEW |