Commit 0c58b808 authored by boliu@chromium.org's avatar boliu@chromium.org

Do not call into blink before initialization

OnMemoryPressure can be called before blink is initialized, which can
cause a crash. See bug for details.

BUG=374211

Review URL: https://codereview.chromium.org/292523002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271216 0039d316-1c4b-4281-b951-d872f2087c98
parent ac05ea55
......@@ -1419,8 +1419,12 @@ void RenderThreadImpl::OnMemoryPressure(
base::MemoryPressureListener::MEMORY_PRESSURE_CRITICAL) {
// Trigger full v8 garbage collection on critical memory notification.
v8::V8::LowMemoryNotification();
// Clear the image cache.
blink::WebImageCache::clear();
if (webkit_platform_support_) {
// Clear the image cache. Do not call into blink if it is not initialized.
blink::WebImageCache::clear();
}
// Purge Skia font cache, by setting it to 0 and then again to the previous
// limit.
size_t font_cache_limit = SkGraphics::SetFontCacheLimit(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment