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

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

Issue 12666007: Don't leak ContentViewCores via ImeAdapter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ws Created 7 years, 9 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
Index: content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java b/content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java
index f80b2598e28940c0bf9f67ccb18b9261d1521ab1..2240b682aa9da2644d20dc52a32d98db135a617a 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java
@@ -24,21 +24,26 @@ import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
/**
- We have to adapt and plumb android IME service and chrome text input API.
- ImeAdapter provides an interface in both ways native <-> java:
- 1. InputConnectionAdapter notifies native code of text composition state and
- dispatch key events from java -> WebKit.
- 2. Native ImeAdapter notifies java side to clear composition text.
-
- The basic flow is:
- 1. When InputConnectionAdapter gets called with composition or result text:
- If we receive a composition text or a result text, then we just need to
- dispatch a synthetic key event with special keycode 229, and then dispatch
- the composition or result text.
- 2. Intercept dispatchKeyEvent() method for key events not handled by IME, we
- need to dispatch them to webkit and check webkit's reply. Then inject a
- new key event for further processing if webkit didn't handle it.
-*/
+ * Adapts and plumbs android IME service onto the chrome text input API.
+ * ImeAdapter provides an interface in both ways native <-> java:
+ * 1. InputConnectionAdapter notifies native code of text composition state and
+ * dispatch key events from java -> WebKit.
+ * 2. Native ImeAdapter notifies java side to clear composition text.
+ *
+ * The basic flow is:
+ * 1. When InputConnectionAdapter gets called with composition or result text:
+ * If we receive a composition text or a result text, then we just need to
+ * dispatch a synthetic key event with special keycode 229, and then dispatch
+ * the composition or result text.
+ * 2. Intercept dispatchKeyEvent() method for key events not handled by IME, we
+ * need to dispatch them to webkit and check webkit's reply. Then inject a
+ * new key event for further processing if webkit didn't handle it.
+ *
+ * Note that the native peer object does not take any strong reference onto the
+ * instance of this java object, hence it is up to the client of this class (e.g.
+ * the ViewEmbedder implementor) to hold a strong reference to it for the required
+ * lifetime of the object.
+ */
@JNINamespace("content")
class ImeAdapter {
interface ViewEmbedder {

Powered by Google App Engine
This is Rietveld 408576698