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

Issue 1409173006: Making DeviceCapabilities threadsafe with locking. (Closed)

Created:
5 years, 2 months ago by esum
Modified:
5 years, 1 month ago
CC:
chromium-reviews, gunsch+watch_chromium.org, lcwu+watch_chromium.org, halliwell+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Making DeviceCapabilities threadsafe with locking. Also updating interface due to thread safety concerns. Unit tests have been modified to ensure that Observers and Validators can call DeviceCapabilities methods safely without hitting deadlocks or unexpected behavior. TEST=cast_base_unittests BUG= Committed: https://crrev.com/e834718b8525eee99660f2c063cb556c0bb5c4b5 Cr-Commit-Position: refs/heads/master@{#357042}

Patch Set 1 #

Patch Set 2 : New locking strategy. Locking refptr swap. #

Patch Set 3 : Clean up header and implementation files. #

Patch Set 4 : Clean up unit test. #

Total comments: 18

Patch Set 5 : #

Total comments: 16

Patch Set 6 : #

Patch Set 7 : Make GetCapabilities accessors use ref counting. #

Patch Set 8 : Just changing unit test assertions to new format. No other changes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+477 lines, -156 lines) Patch
M chromecast/base/device_capabilities.h View 1 2 3 4 5 6 7 chunks +79 lines, -27 lines 0 comments Download
M chromecast/base/device_capabilities_impl.h View 1 2 3 4 5 6 3 chunks +48 lines, -16 lines 0 comments Download
M chromecast/base/device_capabilities_impl.cc View 1 2 3 4 5 6 4 chunks +152 lines, -60 lines 0 comments Download
M chromecast/base/device_capabilities_impl_unittest.cc View 1 2 3 4 5 6 7 20 chunks +198 lines, -53 lines 0 comments Download

Messages

Total messages: 39 (4 generated)
esum
This CL goes with https://eureka-internal-review.git.corp.google.com/#/c/40226
5 years, 2 months ago (2015-10-21 23:07:44 UTC) #2
gunsch
It's not very Chromium-idiomatic to use locking (ever!). It can cause subtle slowdowns that are ...
5 years, 2 months ago (2015-10-22 00:42:55 UTC) #4
esum
On 2015/10/22 00:42:55, gunsch wrote: > It's not very Chromium-idiomatic to use locking (ever!). It ...
5 years, 2 months ago (2015-10-22 04:46:38 UTC) #5
gunsch
On 2015/10/22 04:46:38, ericsum wrote: > On 2015/10/22 00:42:55, gunsch wrote: > > It's not ...
5 years, 2 months ago (2015-10-22 14:09:00 UTC) #6
esum
On 2015/10/22 14:09:00, gunsch wrote: > On 2015/10/22 04:46:38, ericsum wrote: > > On 2015/10/22 ...
5 years, 2 months ago (2015-10-22 17:14:03 UTC) #7
maclellant
> I'm assuming that "all of which have the same data" means that each > ...
5 years, 2 months ago (2015-10-22 17:46:58 UTC) #8
gunsch
One other idea I suggested to Eric over chat would be to have a given ...
5 years, 2 months ago (2015-10-22 18:00:16 UTC) #9
maclellant
On 2015/10/22 18:00:16, gunsch wrote: > One other idea I suggested to Eric over chat ...
5 years, 2 months ago (2015-10-22 18:22:31 UTC) #10
esum
Ready for review again. Implemented Byungchul's locked pointer swap idea.
5 years, 1 month ago (2015-10-26 06:19:54 UTC) #11
esum
Pinging for review when you guys have a chance. Thanks.
5 years, 1 month ago (2015-10-27 17:51:06 UTC) #12
byungchul
https://codereview.chromium.org/1409173006/diff/60001/chromecast/base/device_capabilities_impl.cc File chromecast/base/device_capabilities_impl.cc (right): https://codereview.chromium.org/1409173006/diff/60001/chromecast/base/device_capabilities_impl.cc#newcode188 chromecast/base/device_capabilities_impl.cc:188: scoped_ptr<base::DictionaryValue> DeviceCapabilitiesImpl::GetCapabilities() wrap line after scoped<> https://codereview.chromium.org/1409173006/diff/60001/chromecast/base/device_capabilities_impl.cc#newcode219 chromecast/base/device_capabilities_impl.cc:219: base::Unretained(this), ...
5 years, 1 month ago (2015-10-27 20:38:22 UTC) #13
esum
https://codereview.chromium.org/1409173006/diff/60001/chromecast/base/device_capabilities_impl.cc File chromecast/base/device_capabilities_impl.cc (right): https://codereview.chromium.org/1409173006/diff/60001/chromecast/base/device_capabilities_impl.cc#newcode253 chromecast/base/device_capabilities_impl.cc:253: } On 2015/10/27 20:38:22, byungchul wrote: > Lock twice ...
5 years, 1 month ago (2015-10-27 20:57:45 UTC) #14
maclellant
https://codereview.chromium.org/1409173006/diff/60001/chromecast/base/device_capabilities_impl.cc File chromecast/base/device_capabilities_impl.cc (right): https://codereview.chromium.org/1409173006/diff/60001/chromecast/base/device_capabilities_impl.cc#newcode216 chromecast/base/device_capabilities_impl.cc:216: validator_it->second.task_runner->PostTask( You can move this outside the lock once ...
5 years, 1 month ago (2015-10-27 21:00:32 UTC) #15
byungchul
https://codereview.chromium.org/1409173006/diff/60001/chromecast/base/device_capabilities_impl.cc File chromecast/base/device_capabilities_impl.cc (right): https://codereview.chromium.org/1409173006/diff/60001/chromecast/base/device_capabilities_impl.cc#newcode253 chromecast/base/device_capabilities_impl.cc:253: } On 2015/10/27 21:00:32, maclellant wrote: > On 2015/10/27 ...
5 years, 1 month ago (2015-10-27 21:07:40 UTC) #16
esum
https://codereview.chromium.org/1409173006/diff/60001/chromecast/base/device_capabilities_impl.cc File chromecast/base/device_capabilities_impl.cc (right): https://codereview.chromium.org/1409173006/diff/60001/chromecast/base/device_capabilities_impl.cc#newcode216 chromecast/base/device_capabilities_impl.cc:216: validator_it->second.task_runner->PostTask( On 2015/10/27 21:00:32, maclellant wrote: > You can ...
5 years, 1 month ago (2015-10-27 21:14:25 UTC) #17
maclellant
https://codereview.chromium.org/1409173006/diff/60001/chromecast/base/device_capabilities_impl.cc File chromecast/base/device_capabilities_impl.cc (right): https://codereview.chromium.org/1409173006/diff/60001/chromecast/base/device_capabilities_impl.cc#newcode216 chromecast/base/device_capabilities_impl.cc:216: validator_it->second.task_runner->PostTask( On 2015/10/27 21:14:25, ericsum wrote: > On 2015/10/27 ...
5 years, 1 month ago (2015-10-27 21:20:07 UTC) #18
esum
https://codereview.chromium.org/1409173006/diff/60001/chromecast/base/device_capabilities_impl.cc File chromecast/base/device_capabilities_impl.cc (right): https://codereview.chromium.org/1409173006/diff/60001/chromecast/base/device_capabilities_impl.cc#newcode188 chromecast/base/device_capabilities_impl.cc:188: scoped_ptr<base::DictionaryValue> DeviceCapabilitiesImpl::GetCapabilities() On 2015/10/27 20:38:22, byungchul wrote: > wrap ...
5 years, 1 month ago (2015-10-28 00:29:51 UTC) #19
byungchul
https://codereview.chromium.org/1409173006/diff/80001/chromecast/base/device_capabilities.h File chromecast/base/device_capabilities.h (right): https://codereview.chromium.org/1409173006/diff/80001/chromecast/base/device_capabilities.h#newcode155 chromecast/base/device_capabilities.h:155: virtual scoped_ptr<base::DictionaryValue> GetCapabilities() const = 0; Can we avoid ...
5 years, 1 month ago (2015-10-28 01:09:43 UTC) #20
esum
https://codereview.chromium.org/1409173006/diff/80001/chromecast/base/device_capabilities.h File chromecast/base/device_capabilities.h (right): https://codereview.chromium.org/1409173006/diff/80001/chromecast/base/device_capabilities.h#newcode155 chromecast/base/device_capabilities.h:155: virtual scoped_ptr<base::DictionaryValue> GetCapabilities() const = 0; On 2015/10/28 01:09:43, ...
5 years, 1 month ago (2015-10-28 04:16:27 UTC) #21
byungchul
https://codereview.chromium.org/1409173006/diff/80001/chromecast/base/device_capabilities.h File chromecast/base/device_capabilities.h (right): https://codereview.chromium.org/1409173006/diff/80001/chromecast/base/device_capabilities.h#newcode155 chromecast/base/device_capabilities.h:155: virtual scoped_ptr<base::DictionaryValue> GetCapabilities() const = 0; On 2015/10/28 04:16:27, ...
5 years, 1 month ago (2015-10-28 16:04:18 UTC) #22
esum
https://codereview.chromium.org/1409173006/diff/80001/chromecast/base/device_capabilities.h File chromecast/base/device_capabilities.h (right): https://codereview.chromium.org/1409173006/diff/80001/chromecast/base/device_capabilities.h#newcode155 chromecast/base/device_capabilities.h:155: virtual scoped_ptr<base::DictionaryValue> GetCapabilities() const = 0; On 2015/10/28 16:04:18, ...
5 years, 1 month ago (2015-10-28 17:58:51 UTC) #23
byungchul
https://codereview.chromium.org/1409173006/diff/80001/chromecast/base/device_capabilities.h File chromecast/base/device_capabilities.h (right): https://codereview.chromium.org/1409173006/diff/80001/chromecast/base/device_capabilities.h#newcode155 chromecast/base/device_capabilities.h:155: virtual scoped_ptr<base::DictionaryValue> GetCapabilities() const = 0; On 2015/10/28 17:58:50, ...
5 years, 1 month ago (2015-10-28 18:37:16 UTC) #24
esum
https://codereview.chromium.org/1409173006/diff/80001/chromecast/base/device_capabilities.h File chromecast/base/device_capabilities.h (right): https://codereview.chromium.org/1409173006/diff/80001/chromecast/base/device_capabilities.h#newcode155 chromecast/base/device_capabilities.h:155: virtual scoped_ptr<base::DictionaryValue> GetCapabilities() const = 0; On 2015/10/28 18:37:16, ...
5 years, 1 month ago (2015-10-28 18:44:30 UTC) #25
esum
https://codereview.chromium.org/1409173006/diff/80001/chromecast/base/device_capabilities.h File chromecast/base/device_capabilities.h (right): https://codereview.chromium.org/1409173006/diff/80001/chromecast/base/device_capabilities.h#newcode155 chromecast/base/device_capabilities.h:155: virtual scoped_ptr<base::DictionaryValue> GetCapabilities() const = 0; I can think ...
5 years, 1 month ago (2015-10-28 19:58:42 UTC) #26
maclellant
> Which if any of these do you prefer? I prefer #1, since it actually ...
5 years, 1 month ago (2015-10-28 20:11:17 UTC) #27
byungchul
On 2015/10/28 20:11:17, maclellant wrote: > > Which if any of these do you prefer? ...
5 years, 1 month ago (2015-10-28 20:26:03 UTC) #28
esum
On 2015/10/28 20:26:03, byungchul wrote: > On 2015/10/28 20:11:17, maclellant wrote: > > > Which ...
5 years, 1 month ago (2015-10-28 20:29:58 UTC) #29
esum
Discussed offline. Decided to just move ImmutableCapabilitiesData to public part DeviceCapabilities and make it part ...
5 years, 1 month ago (2015-10-29 21:44:31 UTC) #30
maclellant
lgtm
5 years, 1 month ago (2015-10-29 22:55:38 UTC) #31
esum
Jesse or Luke, can I get review/committer's stamp on this when you have a chance ...
5 years, 1 month ago (2015-10-29 23:38:26 UTC) #32
gunsch
rs lgtm, only took a cursory look
5 years, 1 month ago (2015-10-29 23:54:17 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1409173006/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1409173006/140001
5 years, 1 month ago (2015-10-30 03:55:12 UTC) #36
commit-bot: I haz the power
Committed patchset #8 (id:140001)
5 years, 1 month ago (2015-10-30 04:06:15 UTC) #37
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/e834718b8525eee99660f2c063cb556c0bb5c4b5 Cr-Commit-Position: refs/heads/master@{#357042}
5 years, 1 month ago (2015-10-30 04:07:12 UTC) #38
byungchul
5 years, 1 month ago (2015-11-02 17:51:29 UTC) #39
Message was sent while issue was closed.
lgtm

Powered by Google App Engine
This is Rietveld 408576698