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

Issue 2384613002: [Android] Fix spellcheck JNI crash when a tab is closed. (Closed)

Created:
4 years, 2 months ago by timvolodine
Modified:
4 years, 2 months ago
Reviewers:
Tobias Sargeant, Torne
CC:
chromium-reviews, groby+spellwatch_chromium.org, rlp+watch_chromium.org, rouslan+spell_chromium.org, timvolodine, agrieve+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Android] Fix spellcheck JNI crash when a tab is closed. Closing a tab while a spellcheck request is still running can result in a JNI crash, because the native part has already been destroyed. This typically happens when the results from the android spellchecking service come in with some delay which depends on the size of the request (see crbug.com/651612). This patch fixes this issue by zeroing the native pointer and checking it before sending the results to the native side. It also makes sure that this happens on the correct threads to avoid any potential race conditions. BUG=651612, 583616, 629609 Committed: https://crrev.com/3c92f97e4e4ad473a0788a22820235c71c84ca00 Cr-Commit-Position: refs/heads/master@{#422428}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Toby's comments #

Total comments: 4

Patch Set 3 : more fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -8 lines) Patch
M components/spellcheck/browser/android/java/src/org/chromium/components/spellcheck/SpellCheckerSessionBridge.java View 4 chunks +15 lines, -2 lines 0 comments Download
M components/spellcheck/browser/spellcheck_message_filter_platform.h View 1 1 chunk +7 lines, -2 lines 0 comments Download
M components/spellcheck/browser/spellcheck_message_filter_platform_android.cc View 1 2 chunks +14 lines, -2 lines 0 comments Download
M components/spellcheck/browser/spellchecker_session_bridge_android.cc View 1 2 5 chunks +20 lines, -2 lines 0 comments Download

Messages

Total messages: 27 (17 generated)
timvolodine
4 years, 2 months ago (2016-09-29 22:43:41 UTC) #5
Tobias Sargeant
https://codereview.chromium.org/2384613002/diff/1/components/spellcheck/browser/spellcheck_message_filter_platform.h File components/spellcheck/browser/spellcheck_message_filter_platform.h (right): https://codereview.chromium.org/2384613002/diff/1/components/spellcheck/browser/spellcheck_message_filter_platform.h#newcode72 components/spellcheck/browser/spellcheck_message_filter_platform.h:72: std::unique_ptr<SpellingServiceClient> client_; Unused on Android? https://codereview.chromium.org/2384613002/diff/1/components/spellcheck/browser/spellchecker_session_bridge_android.cc File components/spellcheck/browser/spellchecker_session_bridge_android.cc (right): ...
4 years, 2 months ago (2016-09-30 09:18:58 UTC) #8
timvolodine
thanks for the comments! https://codereview.chromium.org/2384613002/diff/1/components/spellcheck/browser/spellcheck_message_filter_platform.h File components/spellcheck/browser/spellcheck_message_filter_platform.h (right): https://codereview.chromium.org/2384613002/diff/1/components/spellcheck/browser/spellcheck_message_filter_platform.h#newcode72 components/spellcheck/browser/spellcheck_message_filter_platform.h:72: std::unique_ptr<SpellingServiceClient> client_; On 2016/09/30 09:18:57, ...
4 years, 2 months ago (2016-09-30 13:57:55 UTC) #11
timvolodine
PTAL )
4 years, 2 months ago (2016-09-30 13:58:11 UTC) #12
Tobias Sargeant
https://codereview.chromium.org/2384613002/diff/20001/components/spellcheck/browser/spellchecker_session_bridge_android.cc File components/spellcheck/browser/spellchecker_session_bridge_android.cc (right): https://codereview.chromium.org/2384613002/diff/20001/components/spellcheck/browser/spellchecker_session_bridge_android.cc#newcode73 components/spellcheck/browser/spellchecker_session_bridge_android.cc:73: void SpellCheckerSessionBridge::ProcessSpellCheckResults( DCHECK that this occurs on the UI ...
4 years, 2 months ago (2016-09-30 14:13:21 UTC) #13
timvolodine
https://codereview.chromium.org/2384613002/diff/20001/components/spellcheck/browser/spellchecker_session_bridge_android.cc File components/spellcheck/browser/spellchecker_session_bridge_android.cc (right): https://codereview.chromium.org/2384613002/diff/20001/components/spellcheck/browser/spellchecker_session_bridge_android.cc#newcode73 components/spellcheck/browser/spellchecker_session_bridge_android.cc:73: void SpellCheckerSessionBridge::ProcessSpellCheckResults( On 2016/09/30 14:13:21, Tobias Sargeant wrote: > ...
4 years, 2 months ago (2016-09-30 14:46:01 UTC) #16
Tobias Sargeant
Ok, LGTM.
4 years, 2 months ago (2016-09-30 14:51:56 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2384613002/40001
4 years, 2 months ago (2016-10-03 14:38:58 UTC) #23
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 2 months ago (2016-10-03 15:45:33 UTC) #25
commit-bot: I haz the power
4 years, 2 months ago (2016-10-03 15:47:40 UTC) #27
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/3c92f97e4e4ad473a0788a22820235c71c84ca00
Cr-Commit-Position: refs/heads/master@{#422428}

Powered by Google App Engine
This is Rietveld 408576698