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 532823 c496d42a69b48d22510821637c5494200b80aee0
parent 532822 50170a11ab589e28996b962da710acd2438bd8ad
child 532824 b60e7b3407b3aa6a2110f7e09a41e1ea10a04213
push id11272
push userapavel@mozilla.com
push dateThu, 16 May 2019 15:28:22 +0000
treeherdermozilla-beta@2265bfc5920d [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();
-    }
-}