Merge "Prevent serialization after being destroyed"
This commit is contained in:
@@ -36,11 +36,15 @@ class ViewStateSerializer {
|
|||||||
|
|
||||||
static boolean serializeViewState(OutputStream stream, WebView web)
|
static boolean serializeViewState(OutputStream stream, WebView web)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
int baseLayer = web.getBaseLayer();
|
||||||
|
if (baseLayer == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
DataOutputStream dos = new DataOutputStream(stream);
|
DataOutputStream dos = new DataOutputStream(stream);
|
||||||
dos.writeInt(VERSION);
|
dos.writeInt(VERSION);
|
||||||
dos.writeInt(web.getContentWidth());
|
dos.writeInt(web.getContentWidth());
|
||||||
dos.writeInt(web.getContentHeight());
|
dos.writeInt(web.getContentHeight());
|
||||||
return nativeSerializeViewState(web.getBaseLayer(), dos,
|
return nativeSerializeViewState(baseLayer, dos,
|
||||||
new byte[WORKING_STREAM_STORAGE]);
|
new byte[WORKING_STREAM_STORAGE]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4308,6 +4308,9 @@ public class WebView extends AbsoluteLayout
|
|||||||
}
|
}
|
||||||
|
|
||||||
int getBaseLayer() {
|
int getBaseLayer() {
|
||||||
|
if (mNativeClass == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return nativeGetBaseLayer();
|
return nativeGetBaseLayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user