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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/PostMessageHandler.java

Issue 2503943002: Fail gracefully if the postMessage channel is closed (Closed)
Patch Set: Created 4 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: chrome/android/java/src/org/chromium/chrome/browser/customtabs/PostMessageHandler.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/PostMessageHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/PostMessageHandler.java
index cc5ebccc319cfc7c40ed160b60a63db5d170e6f9..268a1a3c2acc6b7f1bf1751f2beec72b68901962 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/PostMessageHandler.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/PostMessageHandler.java
@@ -143,6 +143,9 @@ public class PostMessageHandler {
ThreadUtils.postOnUiThread(new Runnable() {
@Override
public void run() {
+ // It is still possible that the page has navigated while this task is in the queue.
+ // If that happens fail gracefully.
+ if (mChannel == null || mChannel[0].isClosed()) return;
jbudorick 2016/11/15 19:13:12 Should we do something to indicate this kind of fa
Yusuf 2016/11/15 19:16:32 Yeah, the return is more about accepting the reque
mChannel[0].postMessage(message, null);
}
});
« 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