summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-10-12 10:47:05 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-10-12 10:47:05 -0700
commit4664b34d47a6b8276118bedae9f8f320cb40ed6e (patch)
tree8e57e8f3603534c6ab2da6e807a799c571509f31 /src
parentd2948999171dc55bca4b640f0e618d1309029baf (diff)
parent4e11a85649bf1b7b44af910ff68f2e9188896c2f (diff)
downloadpackages_apps_Browser-4664b34d47a6b8276118bedae9f8f320cb40ed6e.zip
packages_apps_Browser-4664b34d47a6b8276118bedae9f8f320cb40ed6e.tar.gz
packages_apps_Browser-4664b34d47a6b8276118bedae9f8f320cb40ed6e.tar.bz2
am 4e11a856: Merge "Lower snapshot size limit" into ics-mr0
* commit '4e11a85649bf1b7b44af910ff68f2e9188896c2f': Lower snapshot size limit
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/Controller.java6
-rw-r--r--src/com/android/browser/SnapshotByteArrayOutputStream.java5
-rw-r--r--src/com/android/browser/SnapshotTab.java11
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();