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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 bool has_initialized_audio_host) | 206 bool has_initialized_audio_host) |
207 : RenderWidgetHostImpl(widget_delegate, | 207 : RenderWidgetHostImpl(widget_delegate, |
208 instance->GetProcess(), | 208 instance->GetProcess(), |
209 routing_id, | 209 routing_id, |
210 hidden), | 210 hidden), |
211 frames_ref_count_(0), | 211 frames_ref_count_(0), |
212 delegate_(delegate), | 212 delegate_(delegate), |
213 instance_(static_cast<SiteInstanceImpl*>(instance)), | 213 instance_(static_cast<SiteInstanceImpl*>(instance)), |
214 waiting_for_drag_context_response_(false), | 214 waiting_for_drag_context_response_(false), |
215 enabled_bindings_(0), | 215 enabled_bindings_(0), |
216 page_id_(-1), | |
217 is_active_(!swapped_out), | 216 is_active_(!swapped_out), |
218 is_swapped_out_(swapped_out), | 217 is_swapped_out_(swapped_out), |
219 main_frame_routing_id_(main_frame_routing_id), | 218 main_frame_routing_id_(main_frame_routing_id), |
220 is_waiting_for_close_ack_(false), | 219 is_waiting_for_close_ack_(false), |
221 sudden_termination_allowed_(false), | 220 sudden_termination_allowed_(false), |
222 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING), | 221 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING), |
223 virtual_keyboard_requested_(false), | 222 virtual_keyboard_requested_(false), |
224 is_focused_element_editable_(false), | 223 is_focused_element_editable_(false), |
225 updating_web_preferences_(false), | 224 updating_web_preferences_(false), |
226 weak_factory_(this) { | 225 weak_factory_(this) { |
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 } | 1019 } |
1021 | 1020 |
1022 void RenderViewHostImpl::OnRenderProcessGone(int status, int exit_code) { | 1021 void RenderViewHostImpl::OnRenderProcessGone(int status, int exit_code) { |
1023 // Do nothing, otherwise RenderWidgetHostImpl will assume it is not a | 1022 // Do nothing, otherwise RenderWidgetHostImpl will assume it is not a |
1024 // RenderViewHostImpl and destroy itself. | 1023 // RenderViewHostImpl and destroy itself. |
1025 // TODO(nasko): Remove this hack once RenderViewHost and RenderWidgetHost are | 1024 // TODO(nasko): Remove this hack once RenderViewHost and RenderWidgetHost are |
1026 // decoupled. | 1025 // decoupled. |
1027 } | 1026 } |
1028 | 1027 |
1029 void RenderViewHostImpl::OnUpdateState(int32 page_id, const PageState& state) { | 1028 void RenderViewHostImpl::OnUpdateState(int32 page_id, const PageState& state) { |
1030 // If the following DCHECK fails, you have encountered a tricky edge-case that | |
1031 // has evaded reproduction for a very long time. Please report what you were | |
1032 // doing on http://crbug.com/407376, whether or not you can reproduce the | |
1033 // failure. | |
1034 DCHECK_EQ(page_id, page_id_); | |
1035 | |
1036 // Without this check, the renderer can trick the browser into using | 1029 // Without this check, the renderer can trick the browser into using |
1037 // filenames it can't access in a future session restore. | 1030 // filenames it can't access in a future session restore. |
1038 if (!CanAccessFilesOfPageState(state)) { | 1031 if (!CanAccessFilesOfPageState(state)) { |
1039 bad_message::ReceivedBadMessage( | 1032 bad_message::ReceivedBadMessage( |
1040 GetProcess(), bad_message::RVH_CAN_ACCESS_FILES_OF_PAGE_STATE); | 1033 GetProcess(), bad_message::RVH_CAN_ACCESS_FILES_OF_PAGE_STATE); |
1041 return; | 1034 return; |
1042 } | 1035 } |
1043 | 1036 |
1044 delegate_->UpdateState(this, page_id, state); | 1037 delegate_->UpdateState(this, page_id, state); |
1045 } | 1038 } |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1417 if (!policy->CanReadFile(GetProcess()->GetID(), file)) | 1410 if (!policy->CanReadFile(GetProcess()->GetID(), file)) |
1418 policy->GrantReadFile(GetProcess()->GetID(), file); | 1411 policy->GrantReadFile(GetProcess()->GetID(), file); |
1419 } | 1412 } |
1420 } | 1413 } |
1421 | 1414 |
1422 void RenderViewHostImpl::SelectWordAroundCaret() { | 1415 void RenderViewHostImpl::SelectWordAroundCaret() { |
1423 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1416 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1424 } | 1417 } |
1425 | 1418 |
1426 } // namespace content | 1419 } // namespace content |
OLD | NEW |