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