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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java

Issue 611543002: Increase safety of delayed-keyboard-dismiss to not call destroyed object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months 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: content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java b/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
index f7a58918b3430f378ce63b4fedd28a9195fa40cf..e45a463f20fb4104ff26b81f79b3d844da4fd8d2 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
@@ -74,15 +74,22 @@ public class ImeAdapter {
}
private class DelayedDismissInput implements Runnable {
- private final long mNativeImeAdapter;
+ private long mNativeImeAdapter;
DelayedDismissInput(long nativeImeAdapter) {
mNativeImeAdapter = nativeImeAdapter;
}
+ // http://crbug.com/413744
+ void detach() {
+ mNativeImeAdapter = 0;
+ }
+
@Override
public void run() {
- attach(mNativeImeAdapter, sTextInputTypeNone, sTextInputFlagNone);
+ if (mNativeImeAdapter != 0) {
+ attach(mNativeImeAdapter, sTextInputTypeNone, sTextInputFlagNone);
+ }
dismissInput(true);
}
}
@@ -693,7 +700,10 @@ public class ImeAdapter {
@CalledByNative
void detach() {
- if (mDismissInput != null) mHandler.removeCallbacks(mDismissInput);
+ if (mDismissInput != null) {
+ mHandler.removeCallbacks(mDismissInput);
+ mDismissInput.detach();
+ }
mNativeImeAdapterAndroid = 0;
mTextInputType = 0;
}
« 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