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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
215 bool hidden, | 215 bool hidden, |
216 bool has_initialized_audio_host) | 216 bool has_initialized_audio_host) |
217 : RenderWidgetHostImpl(widget_delegate, | 217 : RenderWidgetHostImpl(widget_delegate, |
218 instance->GetProcess(), | 218 instance->GetProcess(), |
219 routing_id, | 219 routing_id, |
220 hidden), | 220 hidden), |
221 frames_ref_count_(0), | 221 frames_ref_count_(0), |
222 delegate_(delegate), | 222 delegate_(delegate), |
223 instance_(static_cast<SiteInstanceImpl*>(instance)), | 223 instance_(static_cast<SiteInstanceImpl*>(instance)), |
224 waiting_for_drag_context_response_(false), | 224 waiting_for_drag_context_response_(false), |
225 enabled_bindings_(0), | 225 enabled_bindings_(GetContentClient()->browser() |
226 ->GetDefaultEnabledBindingsForView(this)), | |
226 page_id_(-1), | 227 page_id_(-1), |
227 is_active_(!swapped_out), | 228 is_active_(!swapped_out), |
228 is_pending_deletion_(false), | 229 is_pending_deletion_(false), |
229 is_swapped_out_(swapped_out), | 230 is_swapped_out_(swapped_out), |
230 main_frame_routing_id_(main_frame_routing_id), | 231 main_frame_routing_id_(main_frame_routing_id), |
231 is_waiting_for_close_ack_(false), | 232 is_waiting_for_close_ack_(false), |
232 sudden_termination_allowed_(false), | 233 sudden_termination_allowed_(false), |
233 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING), | 234 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING), |
234 virtual_keyboard_requested_(false), | 235 virtual_keyboard_requested_(false), |
235 is_focused_element_editable_(false), | 236 is_focused_element_editable_(false), |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
772 } | 773 } |
773 | 774 |
774 void RenderViewHostImpl::AllowBindings(int bindings_flags) { | 775 void RenderViewHostImpl::AllowBindings(int bindings_flags) { |
775 // Never grant any bindings to browser plugin guests. | 776 // Never grant any bindings to browser plugin guests. |
776 if (GetProcess()->IsForGuestsOnly()) { | 777 if (GetProcess()->IsForGuestsOnly()) { |
777 NOTREACHED() << "Never grant bindings to a guest process."; | 778 NOTREACHED() << "Never grant bindings to a guest process."; |
778 return; | 779 return; |
779 } | 780 } |
780 | 781 |
781 // Ensure we aren't granting WebUI bindings to a process that has already | 782 // Ensure we aren't granting WebUI bindings to a process that has already |
782 // been used for non-privileged views. | 783 // been used for non-privileged views. |
Charlie Reis
2015/11/24 17:35:59
Drive-by comment: Can you add a similar check for
| |
783 if (bindings_flags & BINDINGS_POLICY_WEB_UI && | 784 if (bindings_flags & BINDINGS_POLICY_WEB_UI && |
784 GetProcess()->HasConnection() && | 785 GetProcess()->HasConnection() && |
785 !ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | 786 !ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
786 GetProcess()->GetID())) { | 787 GetProcess()->GetID())) { |
787 // This process has no bindings yet. Make sure it does not have more | 788 // This process has no bindings yet. Make sure it does not have more |
788 // than this single active view. | 789 // than this single active view. |
789 // --single-process only has one renderer. | 790 // --single-process only has one renderer. |
790 if (GetProcess()->GetActiveViewCount() > 1 && | 791 if (GetProcess()->GetActiveViewCount() > 1 && |
791 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 792 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
792 switches::kSingleProcess)) | 793 switches::kSingleProcess)) |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1408 } else { | 1409 } else { |
1409 render_view_ready_on_process_launch_ = true; | 1410 render_view_ready_on_process_launch_ = true; |
1410 } | 1411 } |
1411 } | 1412 } |
1412 | 1413 |
1413 void RenderViewHostImpl::RenderViewReady() { | 1414 void RenderViewHostImpl::RenderViewReady() { |
1414 delegate_->RenderViewReady(this); | 1415 delegate_->RenderViewReady(this); |
1415 } | 1416 } |
1416 | 1417 |
1417 } // namespace content | 1418 } // namespace content |
OLD | NEW |