summaryrefslogtreecommitdiffstats
path: root/android_webview
diff options
context:
space:
mode:
authorsgurun <sgurun@chromium.org>2015-11-18 17:52:16 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-19 01:53:07 +0000
commit1274b729b9bfead6b8b100f72f46df652fe23484 (patch)
tree5c4ebba828efda019816fce0ff33cef69a211cf8 /android_webview
parent44cc1ab351e14882f3e0522004eddca120a780e5 (diff)
downloadchromium_src-1274b729b9bfead6b8b100f72f46df652fe23484.zip
chromium_src-1274b729b9bfead6b8b100f72f46df652fe23484.tar.gz
chromium_src-1274b729b9bfead6b8b100f72f46df652fe23484.tar.bz2
Swallow the illegal state exception when calling to printmanager
We call to printmanager the failure if webview is destroyed and a print job is in progress. However it is possible that binder is already finalized. In this case simply swallow the exception. BUG= Review URL: https://codereview.chromium.org/1456203002 Cr-Commit-Position: refs/heads/master@{#360475}
Diffstat (limited to 'android_webview')
-rw-r--r--android_webview/java/src/org/chromium/android_webview/AwPdfExporter.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/android_webview/java/src/org/chromium/android_webview/AwPdfExporter.java b/android_webview/java/src/org/chromium/android_webview/AwPdfExporter.java
index d02ba66..97f84fb 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwPdfExporter.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwPdfExporter.java
@@ -78,11 +78,16 @@ public class AwPdfExporter {
@CalledByNative
private void setNativeAwPdfExporter(long nativePdfExporter) {
mNativeAwPdfExporter = nativePdfExporter;
- // Handle the cornercase that Webview.Destroy is called before the native side
- // has a chance to complete the pdf exporting.
+ // Handle the cornercase that the native side is destroyed (for example
+ // via Webview.Destroy) before it has a chance to complete the pdf exporting.
if (nativePdfExporter == 0 && mResultCallback != null) {
- mResultCallback.onReceiveValue(false);
- mResultCallback = null;
+ try {
+ mResultCallback.onReceiveValue(false);
+ mResultCallback = null;
+ } catch (IllegalStateException ex) {
+ // Swallow the illegal state exception here. It is possible that app
+ // is going away and binder is already finalized. b/25462345
+ }
}
}