New issue
Advanced search Search tips

Issue 744621 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

CronetEngine.Builder.setStoragePath() and enableHttpCache() inconsistency

Project Member Reported by mge...@chromium.org, Jul 17 2017

Issue description

enableHttpCache() enforces that the storage path is set if disk cache is being enabled, and is not set if disk cache is not being enabled. The first part is fine. The issue with the second part is that the storage path can be used for features that aren't gated in any other way on disk cache being enabled, and setting the cache mode HTTP_CACHE_DISABLED or HTTP_CACHE_IN_MEMORY before calling setStoragePath() works.

We should either add more logic to ensure that cache mode and storage path existence match each other, or get rid of "throw new IllegalArgumentException("Storage path must not be set");" in enableHttpCache(). I'm in favor of not throwing the exception, unless someone knows a good reason for it to be there.
 

Comment 1 by mef@chromium.org, Jul 17 2017

I agree with not throwing exception, as storage path is now used for more than http cache, and should not be tied to cache mode.
Labels: Hotlist-Fixit

Sign in to add a comment