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

Issue 1602443003: Improve GetWeakPtr() to better protect against unsafe usage patterns. (Closed)

Created:
4 years, 11 months ago by Wez
Modified:
3 years, 5 months ago
Reviewers:
dcheng
CC:
chromium-reviews, gavinp+memory_chromium.org, vmpstr+watch_chromium.org, danakj, ajuma
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

- Add a comment to clarify the [lack of] thread-safety. - Remove the hack to allow thread hand-off if there are zero outstanding WeakPtrs.

Patch Set 1 #

Total comments: 2

Patch Set 2 : Reword comment #

Patch Set 3 : Require explicit InvalidateWeakPtrs() for thread hand-offs #

Patch Set 4 : Fix FilePathWatcher.DeleteDuringNotify test #

Patch Set 5 : Rebase #

Patch Set 6 : Allow wrong-thread delete if no WeakPtrs exist, for now #

Patch Set 7 : Rebase #

Patch Set 8 : WeakPtr::DetachFromSequence hack #

Patch Set 9 : Rebase #

Patch Set 10 : Rebase on NaClBrowser fixes #

Patch Set 11 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -45 lines) Patch
M base/memory/weak_ptr.h View 1 2 3 4 5 6 7 5 chunks +19 lines, -6 lines 0 comments Download
M base/memory/weak_ptr.cc View 1 2 3 4 5 6 7 8 9 4 chunks +18 lines, -11 lines 0 comments Download
M base/memory/weak_ptr_unittest.cc View 1 2 3 4 1 chunk +0 lines, -28 lines 0 comments Download
M base/observer_list.h View 1 2 3 4 5 6 7 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 64 (50 generated)
Wez
PTAL at this wording...
4 years, 11 months ago (2016-01-19 17:51:19 UTC) #2
Wez
ping
4 years, 10 months ago (2016-02-06 03:07:37 UTC) #3
Wez
pingy
4 years, 10 months ago (2016-02-19 20:41:46 UTC) #4
dcheng
https://codereview.chromium.org/1602443003/diff/1/base/memory/weak_ptr.h File base/memory/weak_ptr.h (right): https://codereview.chromium.org/1602443003/diff/1/base/memory/weak_ptr.h#newcode275 base/memory/weak_ptr.h:275: // Returns a new WeakPtr. This is not thread-safe ...
4 years, 10 months ago (2016-02-19 20:45:00 UTC) #5
Wez
https://codereview.chromium.org/1602443003/diff/1/base/memory/weak_ptr.h File base/memory/weak_ptr.h (right): https://codereview.chromium.org/1602443003/diff/1/base/memory/weak_ptr.h#newcode275 base/memory/weak_ptr.h:275: // Returns a new WeakPtr. This is not thread-safe ...
4 years, 9 months ago (2016-03-01 23:20:28 UTC) #6
dcheng
Sorry for being a slacker. I see you've updated this; let me know when you ...
4 years, 6 months ago (2016-06-22 12:35:23 UTC) #7
Wez
danakj: Could you take a look at the cc::ElementAnimations test failures? It seems that the ...
4 years, 1 month ago (2016-11-21 01:40:09 UTC) #17
danakj
On Sun, Nov 20, 2016 at 5:40 PM, <wez@chromium.org> wrote: > danakj: Could you take ...
4 years, 1 month ago (2016-11-21 21:29:04 UTC) #18
Wez
danakj@, loyso@, ajuma@: I added some instrumentation to ThreadChecker and gathered this back-trace for the ...
4 years, 1 month ago (2016-11-21 23:40:39 UTC) #19
loyso (OOO)
Is it a crash? Could you give more context? Overall, it looks like a valid ...
4 years, 1 month ago (2016-11-22 00:41:06 UTC) #20
Wez
On 2016/11/22 00:41:06, loyso wrote: > Is it a crash? Could you give more context? ...
4 years, 1 month ago (2016-11-22 01:18:34 UTC) #21
loyso (OOO)
On 2016/11/22 01:18:34, Wez wrote: > This is the back-trace of an ElementAnimations player_list_ iteration ...
4 years, 1 month ago (2016-11-22 03:16:36 UTC) #22
loyso (OOO)
Related feature: https://bugs.chromium.org/p/chromium/issues/detail?id=667579
4 years, 1 month ago (2016-11-22 04:00:28 UTC) #23
Wez
3 years, 5 months ago (2017-07-17 19:35:13 UTC) #64

Powered by Google App Engine
This is Rietveld 408576698