diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/Controller.java | 6 | ||||
-rw-r--r-- | src/com/android/browser/SnapshotByteArrayOutputStream.java | 5 | ||||
-rw-r--r-- | src/com/android/browser/SnapshotTab.java | 11 |
3 files changed, 13 insertions, 9 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 686cfcd..0fc9b8a 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -2394,7 +2394,11 @@ public class Controller */ @Override public void closeTab(Tab tab) { - removeTab(tab); + if (tab == mTabControl.getCurrentTab()) { + closeCurrentTab(); + } else { + removeTab(tab); + } } // Called when loading from context menu or LOAD_URL message diff --git a/src/com/android/browser/SnapshotByteArrayOutputStream.java b/src/com/android/browser/SnapshotByteArrayOutputStream.java index bfd1a76..127eee8 100644 --- a/src/com/android/browser/SnapshotByteArrayOutputStream.java +++ b/src/com/android/browser/SnapshotByteArrayOutputStream.java @@ -21,8 +21,9 @@ import java.io.OutputStream; public class SnapshotByteArrayOutputStream extends OutputStream { - // Maximum size, just below CursorWindow's 2mb row limit - private static final int MAX_SIZE = 2000000; + // Maximum size, this needs to be small enough such that an entire row + // can fit in CursorWindow's 2MB limit + private static final int MAX_SIZE = 1700000; private ByteArrayOutputStream mStream; public SnapshotByteArrayOutputStream() { diff --git a/src/com/android/browser/SnapshotTab.java b/src/com/android/browser/SnapshotTab.java index cc6eeb7..d9c71f0 100644 --- a/src/com/android/browser/SnapshotTab.java +++ b/src/com/android/browser/SnapshotTab.java @@ -189,17 +189,16 @@ public class SnapshotTab extends Tab { if (web != null) { byte[] data = result.getBlob(4); ByteArrayInputStream bis = new ByteArrayInputStream(data); - try { - GZIPInputStream stream = new GZIPInputStream(bis); - web.loadViewState(stream); - } catch (Exception e) { - Log.w(LOGTAG, "Failed to load view state", e); - } + GZIPInputStream stream = new GZIPInputStream(bis); + web.loadViewState(stream); } mTab.mBackgroundColor = result.getInt(5); mTab.mDateCreated = result.getLong(6); mTab.mWebViewController.onPageFinished(mTab); } + } catch (Exception e) { + Log.w(LOGTAG, "Failed to load view state, closing tab", e); + mTab.mWebViewController.closeTab(mTab); } finally { if (result != null) { result.close(); |