| Index: chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersister.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersister.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersister.java
|
| index 08c8a0a61e269baeb9f1094ba8d50a416848fec4..28bfe9fbafd9b214ac6d5083a7595b5148e54be8 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersister.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersister.java
|
| @@ -6,13 +6,9 @@ package org.chromium.chrome.browser.tabmodel;
|
|
|
| import android.util.Log;
|
|
|
| -import org.chromium.base.StreamUtil;
|
| import org.chromium.chrome.browser.TabState;
|
|
|
| import java.io.File;
|
| -import java.io.FileNotFoundException;
|
| -import java.io.FileOutputStream;
|
| -import java.io.IOException;
|
|
|
| /**
|
| * Interacts with the file system to persist Tab and TabModel data.
|
| @@ -43,20 +39,12 @@ public abstract class TabPersister {
|
| public boolean saveTabState(int tabId, boolean encrypted, TabState state) {
|
| if (state == null) return false;
|
|
|
| - FileOutputStream stream = null;
|
| try {
|
| - stream = openTabStateOutputStream(tabId, encrypted);
|
| - TabState.saveState(stream, state, encrypted);
|
| + TabState.saveState(getTabStateFile(tabId, encrypted), state, encrypted);
|
| return true;
|
| - } catch (FileNotFoundException exception) {
|
| - Log.w(TAG, "FileNotFoundException while attempt to TabState.");
|
| - } catch (IOException exception) {
|
| - Log.w(TAG, "IO Exception while attempting to save tab state.");
|
| } catch (OutOfMemoryError e) {
|
| Log.w(TAG, "Out of memory error while attempting to save tab state. Erasing.");
|
| deleteTabState(tabId, encrypted);
|
| - } finally {
|
| - StreamUtil.closeQuietly(stream);
|
| }
|
|
|
| return false;
|
| @@ -70,9 +58,4 @@ public abstract class TabPersister {
|
| public void deleteTabState(int id, boolean encrypted) {
|
| TabState.deleteTabState(getStateDirectory(), id, encrypted);
|
| }
|
| -
|
| - protected FileOutputStream openTabStateOutputStream(int id, boolean encrypted)
|
| - throws IOException {
|
| - return new FileOutputStream(getTabStateFile(id, encrypted));
|
| - }
|
| }
|
|
|