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

Commit 745e02ae authored by Steve Block's avatar Steve Block Committed by Android (Google) Code Review
Browse files

Merge "Remove unused cache methods"

parents 1eb4c26a 1e17ecae
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.