Bug 1551988 - Move util classes not used in GeckoView into Fennec r=geckoview-reviewers,agi
authorRandall E. Barker <rbarker@mozilla.com>
Wed, 15 May 2019 19:12:53 +0000
changeset 474011 c496d42a69b48d22510821637c5494200b80aee0
parent 474010 50170a11ab589e28996b962da710acd2438bd8ad
child 474012 b60e7b3407b3aa6a2110f7e09a41e1ea10a04213
push id85599
push userrbarker@mozilla.com
push dateWed, 15 May 2019 21:37:54 +0000
treeherderautoland@c496d42a69b4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgeckoview-reviewers, agi
bugs1551988
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1551988 - Move util classes not used in GeckoView into Fennec r=geckoview-reviewers,agi Differential Revision: https://phabricator.services.mozilla.com/D31324
mobile/android/base/java/org/mozilla/gecko/util/ActivityResultHandler.java
mobile/android/base/java/org/mozilla/gecko/util/ActivityResultHandlerMap.java
mobile/android/base/java/org/mozilla/gecko/util/InputOptionsUtils.java
mobile/android/base/java/org/mozilla/gecko/util/JSONUtils.java
mobile/android/base/java/org/mozilla/gecko/util/MapUtils.java
mobile/android/base/java/org/mozilla/gecko/util/MenuUtils.java
mobile/android/base/java/org/mozilla/gecko/util/PrefUtils.java
mobile/android/base/java/org/mozilla/gecko/util/WindowUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityResultHandler.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityResultHandlerMap.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/InputOptionsUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/JSONUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/MapUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/MenuUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/NonEvictingLruCache.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/PrefUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/WindowUtils.java
rename from mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityResultHandler.java
rename to mobile/android/base/java/org/mozilla/gecko/util/ActivityResultHandler.java
rename from mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityResultHandlerMap.java
rename to mobile/android/base/java/org/mozilla/gecko/util/ActivityResultHandlerMap.java
rename from mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/InputOptionsUtils.java
rename to mobile/android/base/java/org/mozilla/gecko/util/InputOptionsUtils.java
rename from mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/JSONUtils.java
rename to mobile/android/base/java/org/mozilla/gecko/util/JSONUtils.java
rename from mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/MapUtils.java
rename to mobile/android/base/java/org/mozilla/gecko/util/MapUtils.java
rename from mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/MenuUtils.java
rename to mobile/android/base/java/org/mozilla/gecko/util/MenuUtils.java
rename from mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/PrefUtils.java
rename to mobile/android/base/java/org/mozilla/gecko/util/PrefUtils.java
rename from mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/WindowUtils.java
rename to mobile/android/base/java/org/mozilla/gecko/util/WindowUtils.java
deleted file mode 100644
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/NonEvictingLruCache.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.gecko.util;
-
-import android.util.LruCache;
-
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * An LruCache that also supports a set of items that will never be evicted.
- *
- * Alas, LruCache is final, so we compose rather than inherit.
- */
-public class NonEvictingLruCache<K, V> {
-    private final ConcurrentHashMap<K, V> mPermanent = new ConcurrentHashMap<K, V>();
-    private final LruCache<K, V> mEvitable;
-
-    public NonEvictingLruCache(final int evictableSize) {
-        mEvitable = new LruCache<K, V>(evictableSize);
-    }
-
-    public V get(final K key) {
-        V val = mPermanent.get(key);
-        if (val == null) {
-            return mEvitable.get(key);
-        }
-        return val;
-    }
-
-    public void putWithoutEviction(final K key, final V value) {
-        mPermanent.put(key, value);
-    }
-
-    public void put(final K key, final V value) {
-        mEvitable.put(key, value);
-    }
-
-    public void evictAll() {
-        mEvitable.evictAll();
-    }
-}