-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AutoDisallowEvents
to PaintOpBuffer
and fix up and remove Asserts
#792
Add AutoDisallowEvents
to PaintOpBuffer
and fix up and remove Asserts
#792
Conversation
Domiii
commented
Jul 1, 2023
•
edited
Loading
edited
- https://linear.app/replay/issue/RUN-2104#comment-de50f9b0
- Tests: Tests passed ✔
ref_counter.h
+ moreref_counter.h
+ more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a bunch of complex refcount class logic here mixed in with assorted asserts. Please factor these out into separate PRs, this makes the changes much more difficult to review.
In addition to the comments I have serious concerns about these refcounting changes. All these macros are poorly documented and many seem unnecessary, this makes it a lot harder to see what changes we're making to chromium, their effects and possible performance implications.
More generally, in the past we've tried to assert refcount changes but it quickly gets to be very gnarly, as this PR demonstrates. I'd like to better understand why we need these now, and why we can't treat the object destruction as non-deterministic and not worry about the refcount changes matching precisely when replaying. Can we discuss this at the next crash fix meeting?
base/memory/ref_counted.h
Outdated
functionName, record_replay_id, refCount); \ | ||
} \ | ||
} \ | ||
static_assert(true, "require semicolon") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the value of assertWhenEventsDisallowed ? It is false in all the uses here. Also, the label is always non-null, why do we test for it (and compare it with zero which is confusing). All the branching here seems like it could be reduced to a single AssertMaybeEventsDisallowed call, which will be clearer and minimize overhead.
base/memory/ref_counted.h
Outdated
@@ -334,16 +374,20 @@ class RefCounted : public subtle::RefCountedBase { | |||
static constexpr subtle::StartRefCountFromZeroTag kRefCountPreference = | |||
subtle::kStartRefCountFromZeroTag; | |||
|
|||
REPLAY_REF_COUNT_DECLARE_STUB(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems pretty weird to be putting a RecordReplayId() member on every single refcounted object, which almost always returns zero. This sort of pollution will make it harder to rely on compiler type errors to fix problems in the code.
…n-2296-assert-lifecycle-of-displayitemlist-paintopbuffer-and
2. fix up Asserts 3. add `AutoDisallowEvents`
Yeah - I removed
Ok, let's give it a try. If it does not work, we have something in the pipeline that might.
Sure! Already jotted it down. |
ref_counter.h
+ moreAutoDisallowEvents
to PaintOpBuffer
and friends
AutoDisallowEvents
to PaintOpBuffer
and friendsAutoDisallowEvents
to PaintOpBuffer
and fix up and remove Asserts