Commit 766a9570 authored by wnwen's avatar wnwen Committed by Commit bot

Cache state directory in TabPersistentStore.

Fixes 6 out of 8 slow StrictMode violations.

BUG=473357

Review URL: https://codereview.chromium.org/1129283004

Cr-Commit-Position: refs/heads/master@{#329725}
parent f50c9b48
......@@ -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;
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment