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

Issue 274073002: Mac AVFoundation: check -CrAVCaptureDevice::observationInfo before removing observers. (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

Mac AVFoundation: check -CrAVCaptureDevice::observationInfo before removing observers. During Chrome shutdown, DeviceMonitorMac deallocs CrAVFoundationDeviceObserver, which is registered as an observer of suspended and connected events on the CrAVCaptureDevice. Every so seldom (see bugs), the removal of these observers causes a crash. Observers removal seems to be a long standing problem with Cocoa and Objective-C++. This CL speculates with a solution for this trouble via testing if the protocol method -observationInfo [1] is not |nil| before removing the observers. This is based on the observation that: a) There might be an AVFoundation-internal race between observer removal and AVCaptureDevice destruction. b) A previous, unrelated Chrome crash might have left the AVFoundation into some unstable meta state. (This is based on xians@ hitting this bug during browser_tests). Tested locally and seems to work fine. BUG=288562, 371271 [1] https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Protocols/NSKeyValueObserving_Protocol/Reference/Reference.html#jumpTo_10 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=269603

Patch Set 1 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -4 lines) Patch
M content/browser/device_monitor_mac.mm View 1 chunk +9 lines, -4 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
mcasas
rsesek@ PTAL.
6 years, 7 months ago (2014-05-09 10:06:01 UTC) #1
Robert Sesek
LGTM
6 years, 7 months ago (2014-05-09 15:15:24 UTC) #2
mcasas
avi@ OWNERS stamp please.
6 years, 7 months ago (2014-05-09 15:55:49 UTC) #3
Avi (use Gerrit)
LGTM
6 years, 7 months ago (2014-05-09 16:18:36 UTC) #4
mcasas
The CQ bit was checked by mcasas@chromium.org
6 years, 7 months ago (2014-05-09 16:19:00 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mcasas@chromium.org/274073002/20001
6 years, 7 months ago (2014-05-09 16:23:01 UTC) #6
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-09 19:12:52 UTC) #7
commit-bot: I haz the power
6 years, 7 months ago (2014-05-10 18:51:47 UTC) #8
Message was sent while issue was closed.
Change committed as 269603

Powered by Google App Engine
This is Rietveld 408576698