Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1756)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java

Issue 2222683002: Use SparseBooleanArray to get rid of lint warning. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java
index 410a592f9e9aa65f45c742b4da5155d05bd86513..9c51810e2176b045432a76566590b6e226bb9d2f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java
@@ -14,7 +14,7 @@ import android.support.annotation.WorkerThread;
import android.support.v4.util.AtomicFile;
import android.text.TextUtils;
import android.util.Pair;
-import android.util.SparseArray;
+import android.util.SparseBooleanArray;
import android.util.SparseIntArray;
import org.chromium.base.ContextUtils;
@@ -1014,7 +1014,7 @@ public class TabPersistentStore extends TabPersister {
}
private int readSavedStateFile(DataInputStream stream, OnTabStateReadCallback callback,
- SparseArray<Boolean> tabIds, boolean forMerge) throws IOException {
+ SparseBooleanArray tabIds, boolean forMerge) throws IOException {
if (stream == null) return 0;
long time = SystemClock.uptimeMillis();
int nextId = 0;
@@ -1247,7 +1247,7 @@ public class TabPersistentStore extends TabPersister {
private final boolean mDeleteAllFiles;
private String[] mTabFileNames;
private String[] mThumbnailFileNames;
- private SparseArray<Boolean> mOtherTabIds;
+ private SparseBooleanArray mOtherTabIds;
/**
* Creates a new AsyncTask to delete tab files. If deleteAllFiles is true, all tab files
* will be deleted regardless of whether they currently belong to a tab model. If it is
@@ -1267,7 +1267,7 @@ public class TabPersistentStore extends TabPersister {
String thumbnailDirectory = PathUtils.getThumbnailCacheDirectory(mContext);
mThumbnailFileNames = new File(thumbnailDirectory).list();
- mOtherTabIds = new SparseArray<Boolean>();
+ mOtherTabIds = new SparseBooleanArray();
if (!mDeleteAllFiles) getTabsFromOtherStateFiles(mOtherTabIds);
return null;
}
@@ -1306,16 +1306,16 @@ public class TabPersistentStore extends TabPersister {
private boolean shouldDeleteTabFile(int tabId, TabWindowManager tabWindowManager) {
return mDeleteAllFiles || (!tabWindowManager.tabExistsInAnySelector(tabId)
- && mOtherTabIds.get(tabId) == null);
+ && !mOtherTabIds.get(tabId));
}
}
/**
* Gets the IDs of all tabs in TabModelSelectors other than the currently selected one. IDs for
* custom tabs are excluded.
- * @param tabIds SparseArray to populate with TabIds.
+ * @param tabIds SparseBooleanArray to populate with TabIds.
*/
- private void getTabsFromOtherStateFiles(SparseArray<Boolean> tabIds) {
+ private void getTabsFromOtherStateFiles(SparseBooleanArray tabIds) {
for (int i = 0; i < TabWindowManager.MAX_SIMULTANEOUS_SELECTORS; i++) {
// Although we check all selectors before deleting, we can only be sure that our own
// selector will not go away between now and then. So, we read from disk all other state
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698