| 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/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 #include "content/child/worker_thread_registry.h" | 67 #include "content/child/worker_thread_registry.h" |
| 68 #include "content/common/child_process_messages.h" | 68 #include "content/common/child_process_messages.h" |
| 69 #include "content/common/content_constants_internal.h" | 69 #include "content/common/content_constants_internal.h" |
| 70 #include "content/common/dom_storage/dom_storage_messages.h" | 70 #include "content/common/dom_storage/dom_storage_messages.h" |
| 71 #include "content/common/frame_messages.h" | 71 #include "content/common/frame_messages.h" |
| 72 #include "content/common/frame_owner_properties.h" | 72 #include "content/common/frame_owner_properties.h" |
| 73 #include "content/common/gpu/client/context_provider_command_buffer.h" | 73 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 74 #include "content/common/render_process_messages.h" | 74 #include "content/common/render_process_messages.h" |
| 75 #include "content/common/resource_messages.h" | 75 #include "content/common/resource_messages.h" |
| 76 #include "content/common/service_worker/embedded_worker_setup.mojom.h" | 76 #include "content/common/service_worker/embedded_worker_setup.mojom.h" |
| 77 #include "content/common/site_isolation_policy.h" |
| 77 #include "content/common/view_messages.h" | 78 #include "content/common/view_messages.h" |
| 78 #include "content/common/worker_messages.h" | 79 #include "content/common/worker_messages.h" |
| 79 #include "content/public/common/content_constants.h" | 80 #include "content/public/common/content_constants.h" |
| 80 #include "content/public/common/content_paths.h" | 81 #include "content/public/common/content_paths.h" |
| 81 #include "content/public/common/content_switches.h" | 82 #include "content/public/common/content_switches.h" |
| 82 #include "content/public/common/renderer_preferences.h" | 83 #include "content/public/common/renderer_preferences.h" |
| 83 #include "content/public/common/url_constants.h" | 84 #include "content/public/common/url_constants.h" |
| 84 #include "content/public/renderer/content_renderer_client.h" | 85 #include "content/public/renderer/content_renderer_client.h" |
| 85 #include "content/public/renderer/render_thread_observer.h" | 86 #include "content/public/renderer/render_thread_observer.h" |
| 86 #include "content/public/renderer/render_view_visitor.h" | 87 #include "content/public/renderer/render_view_visitor.h" |
| (...skipping 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1716 void RenderThreadImpl::OnProcessPurgeAndSuspend() { | 1717 void RenderThreadImpl::OnProcessPurgeAndSuspend() { |
| 1717 ChildThreadImpl::OnProcessPurgeAndSuspend(); | 1718 ChildThreadImpl::OnProcessPurgeAndSuspend(); |
| 1718 if (is_renderer_suspended_) | 1719 if (is_renderer_suspended_) |
| 1719 return; | 1720 return; |
| 1720 // TODO(hajimehoshi): Implement purging e.g. cache (crbug/607077) | 1721 // TODO(hajimehoshi): Implement purging e.g. cache (crbug/607077) |
| 1721 is_renderer_suspended_ = true; | 1722 is_renderer_suspended_ = true; |
| 1722 renderer_scheduler_->SuspendRenderer(); | 1723 renderer_scheduler_->SuspendRenderer(); |
| 1723 } | 1724 } |
| 1724 | 1725 |
| 1725 void RenderThreadImpl::OnCreateNewFrame(FrameMsg_NewFrame_Params params) { | 1726 void RenderThreadImpl::OnCreateNewFrame(FrameMsg_NewFrame_Params params) { |
| 1727 // Debug cases of https://crbug.com/626802. |
| 1728 base::debug::SetCrashKeyValue("newframe_routing_id", |
| 1729 base::IntToString(params.routing_id)); |
| 1730 base::debug::SetCrashKeyValue("newframe_proxy_id", |
| 1731 base::IntToString(params.proxy_routing_id)); |
| 1732 base::debug::SetCrashKeyValue("newframe_opener_id", |
| 1733 base::IntToString(params.opener_routing_id)); |
| 1734 base::debug::SetCrashKeyValue("newframe_parent_id", |
| 1735 base::IntToString(params.parent_routing_id)); |
| 1736 base::debug::SetCrashKeyValue("newframe_widget_id", |
| 1737 base::IntToString( |
| 1738 params.widget_params.routing_id)); |
| 1739 base::debug::SetCrashKeyValue("newframe_widget_hidden", |
| 1740 params.widget_params.hidden ? "yes" : "no"); |
| 1741 base::debug::SetCrashKeyValue("newframe_replicated_origin", |
| 1742 params.replication_state.origin.Serialize()); |
| 1743 base::debug::SetCrashKeyValue("newframe_oopifs_possible", |
| 1744 SiteIsolationPolicy::AreCrossProcessFramesPossible() ? "yes" : "no"); |
| 1726 CompositorDependencies* compositor_deps = this; | 1745 CompositorDependencies* compositor_deps = this; |
| 1727 RenderFrameImpl::CreateFrame( | 1746 RenderFrameImpl::CreateFrame( |
| 1728 params.routing_id, params.proxy_routing_id, params.opener_routing_id, | 1747 params.routing_id, params.proxy_routing_id, params.opener_routing_id, |
| 1729 params.parent_routing_id, params.previous_sibling_routing_id, | 1748 params.parent_routing_id, params.previous_sibling_routing_id, |
| 1730 params.replication_state, compositor_deps, params.widget_params, | 1749 params.replication_state, compositor_deps, params.widget_params, |
| 1731 params.frame_owner_properties); | 1750 params.frame_owner_properties); |
| 1732 } | 1751 } |
| 1733 | 1752 |
| 1734 void RenderThreadImpl::OnCreateNewFrameProxy( | 1753 void RenderThreadImpl::OnCreateNewFrameProxy( |
| 1735 int routing_id, | 1754 int routing_id, |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2231 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) | 2250 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) |
| 2232 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; | 2251 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; |
| 2233 | 2252 |
| 2234 blink::mainThreadIsolate()->MemoryPressureNotification( | 2253 blink::mainThreadIsolate()->MemoryPressureNotification( |
| 2235 v8_memory_pressure_level); | 2254 v8_memory_pressure_level); |
| 2236 blink::MemoryPressureNotificationToWorkerThreadIsolates( | 2255 blink::MemoryPressureNotificationToWorkerThreadIsolates( |
| 2237 v8_memory_pressure_level); | 2256 v8_memory_pressure_level); |
| 2238 } | 2257 } |
| 2239 | 2258 |
| 2240 } // namespace content | 2259 } // namespace content |
| OLD | NEW |