Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "public/web/WebMemoryCoordinator.h" | 5 #include "public/web/WebMemoryCoordinator.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/V8PerIsolateData.h" | |
| 7 #include "core/dom/MemoryCoordinator.h" | 8 #include "core/dom/MemoryCoordinator.h" |
| 8 #include "core/page/Page.h" | 9 #include "core/page/Page.h" |
| 10 #include "platform/TraceEvent.h" | |
| 11 #include "platform/fonts/FontCache.h" | |
| 12 #include "platform/text/CompressibleString.h" | |
| 13 | |
| 9 | 14 |
| 10 namespace blink { | 15 namespace blink { |
| 11 | 16 |
| 12 void WebMemoryCoordinator::onMemoryPressure(WebMemoryPressureLevel pressureLevel ) | 17 void WebMemoryCoordinator::onMemoryPressure(WebMemoryPressureLevel pressureLevel ) |
| 13 { | 18 { |
| 14 MemoryCoordinator::instance().onMemoryPressure(pressureLevel); | 19 MemoryCoordinator::instance().onMemoryPressure(pressureLevel); |
| 20 Page::onMemoryPressure(); | |
| 21 FontCache::fontCache()->invalidateShapeCache(); | |
| 22 FontCache::fontCache()->invalidate(); | |
| 23 V8PerIsolateData::purgeMemory(); | |
| 24 CompressibleStringImpl::compressAll(); | |
| 25 WTF::Partitions::decommitFreeableMemory(); | |
|
bashi
2016/07/08 04:16:22
I think these should be in core::MemoryCoordinator
tasak
2016/07/08 06:47:23
Since I heard that core and modules will be the sa
bashi
2016/07/08 07:09:09
In this case I think we can add a callback in core
tasak
2016/07/19 08:22:51
Done.
| |
| 15 } | 26 } |
| 16 | 27 |
| 17 } // namespace blink | 28 } // namespace blink |
| OLD | NEW |