| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 #include "skia/ext/event_tracer_impl.h" | 144 #include "skia/ext/event_tracer_impl.h" |
| 145 #include "skia/ext/skia_memory_dump_provider.h" | 145 #include "skia/ext/skia_memory_dump_provider.h" |
| 146 #include "third_party/WebKit/public/platform/WebImageGenerator.h" | 146 #include "third_party/WebKit/public/platform/WebImageGenerator.h" |
| 147 #include "third_party/WebKit/public/platform/WebString.h" | 147 #include "third_party/WebKit/public/platform/WebString.h" |
| 148 #include "third_party/WebKit/public/platform/WebThread.h" | 148 #include "third_party/WebKit/public/platform/WebThread.h" |
| 149 #include "third_party/WebKit/public/web/WebCache.h" | 149 #include "third_party/WebKit/public/web/WebCache.h" |
| 150 #include "third_party/WebKit/public/web/WebDatabase.h" | 150 #include "third_party/WebKit/public/web/WebDatabase.h" |
| 151 #include "third_party/WebKit/public/web/WebDocument.h" | 151 #include "third_party/WebKit/public/web/WebDocument.h" |
| 152 #include "third_party/WebKit/public/web/WebFrame.h" | 152 #include "third_party/WebKit/public/web/WebFrame.h" |
| 153 #include "third_party/WebKit/public/web/WebKit.h" | 153 #include "third_party/WebKit/public/web/WebKit.h" |
| 154 #include "third_party/WebKit/public/web/WebMemoryPressureListener.h" | 154 #include "third_party/WebKit/public/web/WebMemoryCoordinator.h" |
| 155 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" | 155 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" |
| 156 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 156 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
| 157 #include "third_party/WebKit/public/web/WebScriptController.h" | 157 #include "third_party/WebKit/public/web/WebScriptController.h" |
| 158 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 158 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
| 159 #include "third_party/WebKit/public/web/WebView.h" | 159 #include "third_party/WebKit/public/web/WebView.h" |
| 160 #include "third_party/icu/source/i18n/unicode/timezone.h" | 160 #include "third_party/icu/source/i18n/unicode/timezone.h" |
| 161 #include "third_party/skia/include/core/SkGraphics.h" | 161 #include "third_party/skia/include/core/SkGraphics.h" |
| 162 #include "ui/base/layout.h" | 162 #include "ui/base/layout.h" |
| 163 #include "ui/base/ui_base_switches.h" | 163 #include "ui/base/ui_base_switches.h" |
| 164 | 164 |
| (...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1909 params.pause_on_start, params.route_id); | 1909 params.pause_on_start, params.route_id); |
| 1910 } | 1910 } |
| 1911 | 1911 |
| 1912 void RenderThreadImpl::OnMemoryPressure( | 1912 void RenderThreadImpl::OnMemoryPressure( |
| 1913 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) { | 1913 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) { |
| 1914 TRACE_EVENT0("memory","RenderThreadImpl::OnMemoryPressure"); | 1914 TRACE_EVENT0("memory","RenderThreadImpl::OnMemoryPressure"); |
| 1915 ReleaseFreeMemory(); | 1915 ReleaseFreeMemory(); |
| 1916 | 1916 |
| 1917 // Do not call into blink if it is not initialized. | 1917 // Do not call into blink if it is not initialized. |
| 1918 if (blink_platform_impl_) { | 1918 if (blink_platform_impl_) { |
| 1919 blink::WebMemoryPressureListener::onMemoryPressure( | 1919 blink::WebMemoryCoordinator::onMemoryPressure( |
| 1920 static_cast<blink::WebMemoryPressureLevel>(memory_pressure_level)); | 1920 static_cast<blink::WebMemoryPressureLevel>(memory_pressure_level)); |
| 1921 | 1921 |
| 1922 if (memory_pressure_level == | 1922 if (memory_pressure_level == |
| 1923 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL) { | 1923 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL) { |
| 1924 // Purge Skia font cache, by setting it to 0 and then again to the | 1924 // Purge Skia font cache, by setting it to 0 and then again to the |
| 1925 // previous limit. | 1925 // previous limit. |
| 1926 size_t font_cache_limit = SkGraphics::SetFontCacheLimit(0); | 1926 size_t font_cache_limit = SkGraphics::SetFontCacheLimit(0); |
| 1927 SkGraphics::SetFontCacheLimit(font_cache_limit); | 1927 SkGraphics::SetFontCacheLimit(font_cache_limit); |
| 1928 } | 1928 } |
| 1929 } | 1929 } |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2099 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) | 2099 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) |
| 2100 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; | 2100 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; |
| 2101 | 2101 |
| 2102 blink::mainThreadIsolate()->MemoryPressureNotification( | 2102 blink::mainThreadIsolate()->MemoryPressureNotification( |
| 2103 v8_memory_pressure_level); | 2103 v8_memory_pressure_level); |
| 2104 blink::MemoryPressureNotificationToWorkerThreadIsolates( | 2104 blink::MemoryPressureNotificationToWorkerThreadIsolates( |
| 2105 v8_memory_pressure_level); | 2105 v8_memory_pressure_level); |
| 2106 } | 2106 } |
| 2107 | 2107 |
| 2108 } // namespace content | 2108 } // namespace content |
| OLD | NEW |