bool PageCache::canCache(Page* page) const { if (!page) return false; #if PLATFORM(CHROMIUM) || !defined(NDEBUG) logCanCachePageDecision(page); #endif // Cache the page, if possible. // Don't write to the cache if in the middle of a redirect, since we will want to // store the final page we end up on. // No point writing to the cache on a reload or loadSame, since we will just write // over it again when we leave that page. FrameLoadType loadType = page->mainFrame()->loader()->loadType(); return m_capacity > 0 && canCachePageContainingThisFrame(page->mainFrame()) && page->backForward()->isActive() && page->settings()->usesPageCache() #if ENABLE(DEVICE_ORIENTATION) && !DeviceMotionController::isActiveAt(page) && !DeviceOrientationController::isActiveAt(page) #endif #if ENABLE(PROXIMITY_EVENTS) && !DeviceProximityController::isActiveAt(page) #endif && loadType != FrameLoadTypeReload && loadType != FrameLoadTypeReloadFromOrigin && loadType != FrameLoadTypeSame; }
bool PageCache::canCache(Page* page) const { if (!page) return false; #if !defined(NDEBUG) logCanCachePageDecision(page); #endif if (memoryPressureHandler().isUnderMemoryPressure()) return false; // Cache the page, if possible. // Don't write to the cache if in the middle of a redirect, since we will want to // store the final page we end up on. // No point writing to the cache on a reload or loadSame, since we will just write // over it again when we leave that page. FrameLoadType loadType = page->mainFrame().loader().loadType(); return m_capacity > 0 && canCachePageContainingThisFrame(&page->mainFrame()) && page->settings().usesPageCache() #if ENABLE(DEVICE_ORIENTATION) && !PLATFORM(IOS) && !DeviceMotionController::isActiveAt(page) && !DeviceOrientationController::isActiveAt(page) #endif #if ENABLE(PROXIMITY_EVENTS) && !DeviceProximityController::isActiveAt(page) #endif && (loadType == FrameLoadType::Standard || loadType == FrameLoadType::Back || loadType == FrameLoadType::Forward || loadType == FrameLoadType::IndexedBackForward); }