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

Issue 1281373002: Remove "delete this" pattern from UsbContext completely. (Closed)

Created:
5 years, 4 months ago by Reilly Grant (use Gerrit)
Modified:
5 years, 4 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove "delete this" pattern from UsbContext completely. This change fixes a much rarer possible use-after-free on USB context shutdown than commit 3219ab0a9caf806b6dda0fe970869735726a5481. If there is an event that wakes up the event loop thread after running_ is set to false then the context could be freed before the attempt to wake it up with libusb_interrupt_handle_event() is made, instead signaling a freed object. This change instead makes it the responsibility of UsbContext to free the UsbEventHandler once its thread has been joined. BUG=518749 R=rockot@chromium.org Committed: https://crrev.com/7ecee444661e8b855c15171615d68162602c39fa Cr-Commit-Position: refs/heads/master@{#342711}

Patch Set 1 #

Patch Set 2 : Make UsbEventHandler a SimpleThread. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -15 lines) Patch
M device/usb/usb_context.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M device/usb/usb_context.cc View 1 3 chunks +9 lines, -14 lines 0 comments Download

Messages

Total messages: 7 (1 generated)
Reilly Grant (use Gerrit)
Please take a look.
5 years, 4 months ago (2015-08-10 20:19:01 UTC) #1
Ken Rockot(use gerrit already)
lgtm
5 years, 4 months ago (2015-08-10 21:51:41 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1281373002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1281373002/20001
5 years, 4 months ago (2015-08-10 21:53:02 UTC) #4
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 4 months ago (2015-08-10 22:19:00 UTC) #5
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/7ecee444661e8b855c15171615d68162602c39fa Cr-Commit-Position: refs/heads/master@{#342711}
5 years, 4 months ago (2015-08-10 22:19:33 UTC) #6
Ken Rockot(use gerrit already)
5 years, 4 months ago (2015-08-11 22:43:44 UTC) #7
Message was sent while issue was closed.
lgtm

Powered by Google App Engine
This is Rietveld 408576698