| 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 16 matching lines...) Expand all Loading... |
| 27 #include "base/time/time.h" | 27 #include "base/time/time.h" |
| 28 #include "base/trace_event/trace_event.h" | 28 #include "base/trace_event/trace_event.h" |
| 29 #include "base/values.h" | 29 #include "base/values.h" |
| 30 #include "build/build_config.h" | 30 #include "build/build_config.h" |
| 31 #include "cc/base/switches.h" | 31 #include "cc/base/switches.h" |
| 32 #include "components/variations/variations_associated_data.h" | 32 #include "components/variations/variations_associated_data.h" |
| 33 #include "content/browser/bad_message.h" | 33 #include "content/browser/bad_message.h" |
| 34 #include "content/browser/child_process_security_policy_impl.h" | 34 #include "content/browser/child_process_security_policy_impl.h" |
| 35 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 35 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
| 36 #include "content/browser/frame_host/frame_tree.h" | 36 #include "content/browser/frame_host/frame_tree.h" |
| 37 #include "content/browser/frame_host/render_frame_proxy_host.h" |
| 37 #include "content/browser/gpu/compositor_util.h" | 38 #include "content/browser/gpu/compositor_util.h" |
| 38 #include "content/browser/gpu/gpu_data_manager_impl.h" | 39 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 39 #include "content/browser/gpu/gpu_process_host.h" | 40 #include "content/browser/gpu/gpu_process_host.h" |
| 40 #include "content/browser/host_zoom_map_impl.h" | 41 #include "content/browser/host_zoom_map_impl.h" |
| 41 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 42 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 42 #include "content/browser/renderer_host/input/timeout_monitor.h" | 43 #include "content/browser/renderer_host/input/timeout_monitor.h" |
| 43 #include "content/browser/renderer_host/render_process_host_impl.h" | 44 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 44 #include "content/browser/renderer_host/render_view_host_delegate.h" | 45 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 45 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 46 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
| 46 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 47 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 params->main_frame_routing_id = main_frame_routing_id_; | 298 params->main_frame_routing_id = main_frame_routing_id_; |
| 298 if (main_frame_routing_id_ != MSG_ROUTING_NONE) { | 299 if (main_frame_routing_id_ != MSG_ROUTING_NONE) { |
| 299 RenderFrameHostImpl* main_rfh = RenderFrameHostImpl::FromID( | 300 RenderFrameHostImpl* main_rfh = RenderFrameHostImpl::FromID( |
| 300 GetProcess()->GetID(), main_frame_routing_id_); | 301 GetProcess()->GetID(), main_frame_routing_id_); |
| 301 DCHECK(main_rfh); | 302 DCHECK(main_rfh); |
| 302 RenderWidgetHostImpl* main_rwh = main_rfh->GetRenderWidgetHost(); | 303 RenderWidgetHostImpl* main_rwh = main_rfh->GetRenderWidgetHost(); |
| 303 params->main_frame_widget_routing_id = main_rwh->GetRoutingID(); | 304 params->main_frame_widget_routing_id = main_rwh->GetRoutingID(); |
| 304 } | 305 } |
| 305 params->session_storage_namespace_id = | 306 params->session_storage_namespace_id = |
| 306 delegate_->GetSessionStorageNamespace(instance_.get())->id(); | 307 delegate_->GetSessionStorageNamespace(instance_.get())->id(); |
| 307 // Ensure the RenderView sets its opener correctly. | 308 if (main_frame_routing_id_ != MSG_ROUTING_NONE) { |
| 309 params->browsing_instance_id = RenderFrameHostImpl::FromID( |
| 310 GetProcess()->GetID(), main_frame_routing_id_) |
| 311 ->GetSiteInstance() |
| 312 ->GetBrowsingInstanceId(); |
| 313 } else if (opener_frame_route_id != MSG_ROUTING_NONE) { |
| 314 params->browsing_instance_id = RenderFrameHostImpl::FromID( |
| 315 GetProcess()->GetID(), opener_frame_route_id) |
| 316 ->GetSiteInstance() |
| 317 ->GetBrowsingInstanceId(); |
| 318 } else if (proxy_route_id != MSG_ROUTING_NONE) { |
| 319 SiteInstance* site_instance = RenderFrameProxyHost::FromID( |
| 320 GetProcess()->GetID(), proxy_route_id) |
| 321 ->GetSiteInstance(); |
| 322 params->browsing_instance_id = static_cast<SiteInstanceImpl*>(site_instance) |
| 323 ->GetBrowsingInstanceId(); |
| 324 } else { |
| 325 CHECK(false); |
| 326 params->browsing_instance_id = -1; |
| 327 } |
| 308 params->opener_frame_route_id = opener_frame_route_id; | 328 params->opener_frame_route_id = opener_frame_route_id; |
| 309 params->swapped_out = !is_active_; | 329 params->swapped_out = !is_active_; |
| 310 params->replicated_frame_state = replicated_frame_state; | 330 params->replicated_frame_state = replicated_frame_state; |
| 311 params->proxy_routing_id = proxy_route_id; | 331 params->proxy_routing_id = proxy_route_id; |
| 312 params->hidden = is_active_ ? GetWidget()->is_hidden() | 332 params->hidden = is_active_ ? GetWidget()->is_hidden() |
| 313 : GetWidget()->delegate()->IsHidden(); | 333 : GetWidget()->delegate()->IsHidden(); |
| 314 params->never_visible = delegate_->IsNeverVisible(); | 334 params->never_visible = delegate_->IsNeverVisible(); |
| 315 params->window_was_created_with_opener = window_was_created_with_opener; | 335 params->window_was_created_with_opener = window_was_created_with_opener; |
| 316 params->enable_auto_resize = GetWidget()->auto_resize_enabled(); | 336 params->enable_auto_resize = GetWidget()->auto_resize_enabled(); |
| 317 params->min_size = GetWidget()->min_size_for_auto_resize(); | 337 params->min_size = GetWidget()->min_size_for_auto_resize(); |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 } | 979 } |
| 960 | 980 |
| 961 void RenderViewHostImpl::ClosePageTimeout() { | 981 void RenderViewHostImpl::ClosePageTimeout() { |
| 962 if (delegate_->ShouldIgnoreUnresponsiveRenderer()) | 982 if (delegate_->ShouldIgnoreUnresponsiveRenderer()) |
| 963 return; | 983 return; |
| 964 | 984 |
| 965 ClosePageIgnoringUnloadEvents(); | 985 ClosePageIgnoringUnloadEvents(); |
| 966 } | 986 } |
| 967 | 987 |
| 968 } // namespace content | 988 } // namespace content |
| OLD | NEW |