Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e17ecae authored by Steve Block's avatar Steve Block
Browse files

Remove unused cache methods

These were added in https://mondrian.corp.google.com/changelist/19077-p9.

CacheManager.setCacheDisabled() has been unused since
https://mondrian.corp.google.com/changelist/20678-p9 (see change to WebView),
so the WebKit cache is always enabled.

BrowserFrame.setCacheDisabled() has been unused since
https://mondrian.corp.google.com/changelist/33679-p9, so the WebCore cache is
always enabled.

BrowserFrame.CacheDisabled() has been unused since
https://mondrian.corp.google.com/changelist/32803-p9 (see change to WebView).

See WebKit change https://android-git.corp.google.com/g/167298.

Change-Id: I68bf334f4a34df1b88d2b5204e50c2eb04db7e69
parent 5c9b4329
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -1351,15 +1351,6 @@ class BrowserFrame extends Handler {
    private native void nativeAddJavascriptInterface(int nativeFramePointer,
            Object obj, String interfaceName);

    /**
     * Enable or disable the native cache.
     */
    /* FIXME: The native cache is always on for now until we have a better
     * solution for our 2 caches. */
    private native void setCacheDisabled(boolean disabled);

    public native boolean cacheDisabled();

    public native void clearCache();

    /**
+1 −27
Original line number Diff line number Diff line
@@ -68,8 +68,6 @@ public final class CacheManager {
    // Limit the maximum cache file size to half of the normal capacity
    static long CACHE_MAX_SIZE = (CACHE_THRESHOLD - CACHE_TRIM_AMOUNT) / 2;

    private static boolean mDisabled;

    // Reference count the enable/disable transaction
    private static int mRefCount;

@@ -321,22 +319,6 @@ public final class CacheManager {
        return mBaseDir;
    }

    /**
     * Sets whether the HTTP cache should be disabled.
     * @param disabled Whether the cache should be disabled
     */
    static void setCacheDisabled(boolean disabled) {
        assert !JniUtil.useChromiumHttpStack();

        if (disabled == mDisabled) {
            return;
        }
        mDisabled = disabled;
        if (mDisabled) {
            removeAllCacheFiles();
        }
    }

    /**
     * Gets whether the HTTP cache is disabled.
     * @return True if the HTTP cache is disabled
@@ -344,7 +326,7 @@ public final class CacheManager {
     */
    @Deprecated
    public static boolean cacheDisabled() {
        return mDisabled;
        return false;
    }

    // only called from WebViewWorkerThread
@@ -489,10 +471,6 @@ public final class CacheManager {

    static CacheResult getCacheFile(String url, long postIdentifier,
            Map<String, String> headers) {
        if (mDisabled) {
            return null;
        }

        CacheResult result = JniUtil.useChromiumHttpStack() ?
                getCacheFileChromiumHttpStack(url) :
                getCacheFileAndroidHttpStack(url, postIdentifier);
@@ -552,10 +530,6 @@ public final class CacheManager {
            boolean forceCache) {
        assert !JniUtil.useChromiumHttpStack();

        if (!forceCache && mDisabled) {
            return null;
        }

        String databaseKey = getDatabaseKey(url, postIdentifier);

        // according to the rfc 2616, the 303 response MUST NOT be cached.