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

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

Issue 1129283004: Cache state directory in TabPersistentStore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 0e821b961949847f1136c565c972d7803e49613b..011c1e212c420ed6887a3244e06d6525f964a3e4 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
@@ -106,6 +106,8 @@ public class TabPersistentStore extends TabPersister {
private boolean mCancelNormalTabLoads = false;
private boolean mCancelIncognitoTabLoads = false;
+ private File mStateDirectory;
+
// Keys are the original tab indexes, values are the tab ids.
private SparseIntArray mNormalTabsRestored;
private SparseIntArray mIncognitoTabsRestored;
@@ -143,7 +145,10 @@ public class TabPersistentStore extends TabPersister {
@Override
public File getStateDirectory() {
- return getStateDirectory(mContext, mSelectorIndex);
+ if (mStateDirectory == null) {
+ mStateDirectory = getStateDirectory(mContext, mSelectorIndex);
+ }
+ return mStateDirectory;
}
/**
« 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