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

Issue 2001813002: Invalidate ChromotingJniInstance's WeakPtr on network thread (Closed)

Created:
4 years, 7 months ago by Yuwei
Modified:
4 years, 7 months ago
Reviewers:
Lambros, Wez
CC:
Sergey Ulanov, chromium-reviews, chromoting-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Invalidate ChromotingJniInstance's WeakPtr on network thread ChromotingJniInstance implements refcounted but also has a weak pointer factory. The implementation allows the d'tor to be called on any thread but the weak pointer can only be invalidated on the network thread. In some rare circumstances, The instance is destructed on a non-network thread and fails weakptr's DCHECK. This CL makes the instance invalidate the weak pointer when it disconnects on the network thread. BUG=611893 Committed: https://crrev.com/3f62203016905be841dfa1142238f338916802c8 Cr-Commit-Position: refs/heads/master@{#395347}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -1 line) Patch
M remoting/client/jni/chromoting_jni_instance.h View 1 chunk +2 lines, -1 line 0 comments Download
M remoting/client/jni/chromoting_jni_instance.cc View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (7 generated)
Yuwei
While I couldn't reproduce the weird logging sequence per comment#6, an automated test does show ...
4 years, 7 months ago (2016-05-20 21:28:06 UTC) #2
Lambros
Can you update the description to point to the correct bug? Otherwise lgtm.
4 years, 7 months ago (2016-05-20 21:38:30 UTC) #3
Yuwei
On 2016/05/20 21:38:30, Lambros wrote: > Can you update the description to point to the ...
4 years, 7 months ago (2016-05-20 21:40:09 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2001813002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2001813002/1
4 years, 7 months ago (2016-05-20 21:41:11 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/233297)
4 years, 7 months ago (2016-05-21 00:23:07 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2001813002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2001813002/1
4 years, 7 months ago (2016-05-23 16:30:04 UTC) #11
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 7 months ago (2016-05-23 17:21:56 UTC) #13
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/3f62203016905be841dfa1142238f338916802c8 Cr-Commit-Position: refs/heads/master@{#395347}
4 years, 7 months ago (2016-05-23 17:24:35 UTC) #15
Wez
You can specify custom traits for ref-counted objects, in particular a custom function to call ...
4 years, 7 months ago (2016-05-23 20:50:39 UTC) #16
Yuwei
On 2016/05/23 20:50:39, Wez wrote: > You can specify custom traits for ref-counted objects, in ...
4 years, 7 months ago (2016-05-24 03:04:33 UTC) #17
chromium-reviews
Perfect! On 23 May 2016 20:04, <yuweih@chromium.org> wrote: > On 2016/05/23 20:50:39, Wez wrote: > ...
4 years, 7 months ago (2016-05-24 03:16:15 UTC) #18
Wez
4 years, 7 months ago (2016-05-24 05:27:06 UTC) #19
Message was sent while issue was closed.
Perfect!

On 23 May 2016 at 20:04, <yuweih@chromium.org> wrote:

> On 2016/05/23 20:50:39, Wez wrote:
> > You can specify custom traits for ref-counted objects, in particular a
> custom
> > function to call to actually tear-down the object - you could use that to
> > DeleteSoon the ChromotingJniInstance from the correct thread, thereby
> ensuring
> > that _all_ members can rely on being torn-down on the UI thread, rather
> than
> > special-casing the WeakPtrFactory.
>
> This class has been problematic. It is run on multiple threads and the weak
> pointer is only being used on the network thread. We are planning to break
> down
> this class by threads and delete each of them on the right thread rather
> than
> having a ref-counted object with obscure deletion behavior.
>
> https://codereview.chromium.org/2001813002/
>

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698