Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2058)

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwPdfExporter.java

Issue 1456203002: Swallow the illegal state exception when calling to printmanager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/java/src/org/chromium/android_webview/AwPdfExporter.java
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 d02ba6604dae967fda6ef47b02df7ee9e05c5363..97f84fb1e81cbee6f20dc287c69d84e1e3580e19 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
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698