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

Issue 276573009: DeviceMonitorMac AVFoundation: move mgmt of |suspend_observer_| to a class living in Device Thread. (Closed)

Created:
6 years, 7 months ago by mcasas
Modified:
6 years, 7 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam
Visibility:
Public.

Description

DeviceMonitorMac AVFoundation: move mgmt of |suspend_observer_| to a class living in Device Thread. This CL addresses a potential problem due to a race: |suspend_observer_| [1] could have been deallocated in ~AVFoundationMonitorImpl while still being in use in Device Thread [2]. This race didn't show up in normal circumstances since it needed the Device Thread to be active for a very short time; xians@ stumbled upon it during some unrelated code activities that made a browser_test fail. This CL then cleans up the management of |suspend_observer_| from the AVFoundationMonitorImpl to a new class SuspendObserverDelegate, the former living exclusively in UI thread, the latter in Device Thread. SuspendObserverDelegate gets the Device Thread parts of AVFoundationMonitorImpl. The new class sits between AVFoundationMonitorImpl and the Objective-C++ CrAVFoundationDeviceObserver. [1] https://code.google.com/p/chromium/codesearch#chromium/src/content/browser/device_monitor_mac.mm&sq=package:chromium&type=cs&l=259 [2] https://code.google.com/p/chromium/codesearch#chromium/src/content/browser/device_monitor_mac.mm&sq=package:chromium&type=cs&l=336 BUG=288562, 372418 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=271438

Patch Set 1 : #

Total comments: 8

Patch Set 2 : tommi@s comments. #

Total comments: 2

Patch Set 3 : tommi@s thread-hopping proposal for OnDeviceChanged() back PostTask #

Total comments: 6

Patch Set 4 : tommi@s 2nd round of comments. #

Total comments: 12

Patch Set 5 : rsesek@ comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -58 lines) Patch
M content/browser/device_monitor_mac.mm View 1 2 3 4 7 chunks +102 lines, -58 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
mcasas
tommi@ PTAL rsesek@ FYI/PTAL.
6 years, 7 months ago (2014-05-13 12:43:43 UTC) #1
tommi (sloooow) - chröme
https://codereview.chromium.org/276573009/diff/20001/content/browser/device_monitor_mac.mm File content/browser/device_monitor_mac.mm (right): https://codereview.chromium.org/276573009/diff/20001/content/browser/device_monitor_mac.mm#newcode256 content/browser/device_monitor_mac.mm:256: DeviceMonitorMacImpl* avfoundation_monitor_impl_; I don't see where this variable is ...
6 years, 7 months ago (2014-05-13 14:43:41 UTC) #2
mcasas
tommi@ PTAL. https://codereview.chromium.org/276573009/diff/20001/content/browser/device_monitor_mac.mm File content/browser/device_monitor_mac.mm (right): https://codereview.chromium.org/276573009/diff/20001/content/browser/device_monitor_mac.mm#newcode256 content/browser/device_monitor_mac.mm:256: DeviceMonitorMacImpl* avfoundation_monitor_impl_; On 2014/05/13 14:43:41, tommi wrote: ...
6 years, 7 months ago (2014-05-14 12:07:16 UTC) #3
tommi (sloooow) - chröme
https://codereview.chromium.org/276573009/diff/80001/content/browser/device_monitor_mac.mm File content/browser/device_monitor_mac.mm (right): https://codereview.chromium.org/276573009/diff/80001/content/browser/device_monitor_mac.mm#newcode293 content/browser/device_monitor_mac.mm:293: base::Unretained(avfoundation_monitor_impl_), snapshot_devices)); This is unfortunately not safe either. The ...
6 years, 7 months ago (2014-05-15 13:35:39 UTC) #4
mcasas
PTAL. https://codereview.chromium.org/276573009/diff/80001/content/browser/device_monitor_mac.mm File content/browser/device_monitor_mac.mm (right): https://codereview.chromium.org/276573009/diff/80001/content/browser/device_monitor_mac.mm#newcode293 content/browser/device_monitor_mac.mm:293: base::Unretained(avfoundation_monitor_impl_), snapshot_devices)); On 2014/05/15 13:35:39, tommi wrote: > ...
6 years, 7 months ago (2014-05-15 13:52:19 UTC) #5
tommi (sloooow) - chröme
lgtm https://codereview.chromium.org/276573009/diff/140001/content/browser/device_monitor_mac.mm File content/browser/device_monitor_mac.mm (right): https://codereview.chromium.org/276573009/diff/140001/content/browser/device_monitor_mac.mm#newcode14 content/browser/device_monitor_mac.mm:14: #include "base/synchronization/lock.h" remove this now? https://codereview.chromium.org/276573009/diff/140001/content/browser/device_monitor_mac.mm#newcode259 content/browser/device_monitor_mac.mm:259: base::ThreadChecker ...
6 years, 7 months ago (2014-05-15 15:43:22 UTC) #6
mcasas
avi@ OWNERS stamp please. rsesek@ ping just in case. https://codereview.chromium.org/276573009/diff/140001/content/browser/device_monitor_mac.mm File content/browser/device_monitor_mac.mm (right): https://codereview.chromium.org/276573009/diff/140001/content/browser/device_monitor_mac.mm#newcode14 content/browser/device_monitor_mac.mm:14: ...
6 years, 7 months ago (2014-05-15 16:34:53 UTC) #7
Robert Sesek
https://codereview.chromium.org/276573009/diff/160001/content/browser/device_monitor_mac.mm File content/browser/device_monitor_mac.mm (right): https://codereview.chromium.org/276573009/diff/160001/content/browser/device_monitor_mac.mm#newcode219 content/browser/device_monitor_mac.mm:219: // manipulated by SuspendObserverDelegate in Device Thread. -stopObserving is ...
6 years, 7 months ago (2014-05-15 17:01:00 UTC) #8
mcasas
rsesek@ PTAL. https://codereview.chromium.org/276573009/diff/160001/content/browser/device_monitor_mac.mm File content/browser/device_monitor_mac.mm (right): https://codereview.chromium.org/276573009/diff/160001/content/browser/device_monitor_mac.mm#newcode219 content/browser/device_monitor_mac.mm:219: // manipulated by SuspendObserverDelegate in Device Thread. ...
6 years, 7 months ago (2014-05-16 07:06:12 UTC) #9
Robert Sesek
lgtm
6 years, 7 months ago (2014-05-16 13:29:31 UTC) #10
mcasas
avi@ PTAL.
6 years, 7 months ago (2014-05-16 18:25:43 UTC) #11
mcasas
avi@ ping OWNERS stamp please.
6 years, 7 months ago (2014-05-19 13:00:21 UTC) #12
Avi (use Gerrit)
lgtm stamp
6 years, 7 months ago (2014-05-19 14:18:23 UTC) #13
mcasas
The CQ bit was checked by mcasas@chromium.org
6 years, 7 months ago (2014-05-19 14:18:47 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mcasas@chromium.org/276573009/180001
6 years, 7 months ago (2014-05-19 14:19:57 UTC) #15
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-19 16:21:02 UTC) #16
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-19 17:14:14 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg_triggered_tests on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_dbg_triggered_tests/builds/155012)
6 years, 7 months ago (2014-05-19 17:14:15 UTC) #18
mcasas
The CQ bit was checked by mcasas@chromium.org
6 years, 7 months ago (2014-05-19 17:19:43 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mcasas@chromium.org/276573009/180001
6 years, 7 months ago (2014-05-19 17:21:45 UTC) #20
commit-bot: I haz the power
6 years, 7 months ago (2014-05-19 18:53:31 UTC) #21
Message was sent while issue was closed.
Change committed as 271438

Powered by Google App Engine
This is Rietveld 408576698