Closed
Bug 1058127
Opened 12 years ago
Closed 12 years ago
Fix GeckoEditable.removeSpan race condition
Categories
(Firefox for Android Graveyard :: Keyboards and IME, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 34
People
(Reporter: jchen, Assigned: jchen)
References
Details
Attachments
(1 file)
|
2.87 KB,
patch
|
cpeterson
:
review+
|
Details | Diff | Splinter Review |
Right now removeSpan is handled on the InputConnection thread whereas other calls are handled on the Gecko thread. This can result in race conditions.
| Assignee | ||
Comment 1•12 years ago
|
||
This patch changes removeSpan processing from the InputConnection thread to the Gecko thread. Chris, I'm not sure who else can review this, but let me know if you want someone else to look at it.
Attachment #8478465 -
Flags: review?(cpeterson)
Comment 2•12 years ago
|
||
Comment on attachment 8478465 [details] [diff] [review]
Properly implement removeSpan synchronization (v1)
Review of attachment 8478465 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM!
::: mobile/android/base/GeckoEditable.java
@@ -1045,5 @@
> if (what == Selection.SELECTION_START ||
> what == Selection.SELECTION_END) {
> Log.w(LOGTAG, "selection removed with removeSpan()");
> }
> - if (mText.getSpanStart(what) >= 0) { // only remove if it's there
Was this check a (racy) optimization? Do you want this check when processing TYPE_REMOVE_SPAN on the Gecko thread?
Attachment #8478465 -
Flags: review?(cpeterson) → review+
| Assignee | ||
Comment 3•12 years ago
|
||
(In reply to Chris Peterson (:cpeterson) from comment #2)
> Comment on attachment 8478465 [details] [diff] [review]
> Properly implement removeSpan synchronization (v1)
>
> Review of attachment 8478465 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> LGTM!
>
> ::: mobile/android/base/GeckoEditable.java
> @@ -1045,5 @@
> > if (what == Selection.SELECTION_START ||
> > what == Selection.SELECTION_END) {
> > Log.w(LOGTAG, "selection removed with removeSpan()");
> > }
> > - if (mText.getSpanStart(what) >= 0) { // only remove if it's there
>
> Was this check a (racy) optimization? Do you want this check when processing
> TYPE_REMOVE_SPAN on the Gecko thread?
Yep it was a racy optimization. The same check is contained in the removeSpan call on the Gecko thread.
| Assignee | ||
Comment 4•12 years ago
|
||
Comment 5•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 34
Updated•5 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•