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

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

Issue 2613863006: Add a ThreadLocal flag to replace the reflection in shouldTriggerDelayedOnCreateInputConnection() (Closed)
Patch Set: fix cast error Created 3 years, 11 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/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index d51e32f303eb6f4bf2248e4e6e07fc28bd275303..a86b3777d0e7e3387b167c49020e2a26bdcc19c9 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -47,6 +47,7 @@ import org.chromium.base.TraceEvent;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
+import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.content.browser.accessibility.BrowserAccessibilityManager;
import org.chromium.content.browser.accessibility.captioning.CaptioningBridgeFactory;
import org.chromium.content.browser.accessibility.captioning.SystemCaptioningBridge;
@@ -124,6 +125,19 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Displa
// expects HashSet (no bindings for interfaces).
private final HashSet<Object> mRetainedJavaScriptObjects = new HashSet<Object>();
+ private static ThreadLocal<Boolean> sTriggerDelayedOnCreateInputConnection =
+ new ThreadLocal<Boolean>() {
+ @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD")
+ @Override
+ protected synchronized Boolean initialValue() {
+ return true;
+ }
+ };
+
+ public void setTriggerDelayedOnCreateInputConnection(final boolean trigger) {
+ sTriggerDelayedOnCreateInputConnection.set(trigger);
+ }
+
/**
* A {@link WebContentsObserver} that listens to frame navigation events.
*/
@@ -1379,6 +1393,8 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Displa
* @see View#onCreateInputConnection(EditorInfo)
*/
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
+ mImeAdapter.setTriggerDelayedOnCreateInputConnection(
+ sTriggerDelayedOnCreateInputConnection.get());
return mImeAdapter.onCreateInputConnection(outAttrs);
}

Powered by Google App Engine
This is Rietveld 408576698