forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Assert access checks + more UseCounter code #1291
Open
Domiii
wants to merge
22
commits into
master
Choose a base branch
from
dominik/tt-1480-assert-more-counter-code
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+78
−111
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
8d84699
Assert access checks + more UseCounter code
Domiii 59ad771
DEPS (v8)
Domiii 0b7cf15
Merge branch 'master' of github.com:replayio/chromium into dominik/tt…
Domiii 6cf2cf7
Remove outdated code
Domiii 79ad3cc
Merge branch 'master' of github.com:replayio/chromium into dominik/tt…
Domiii 35faee4
Merge branch 'master' of github.com:replayio/chromium into dominik/tt…
Domiii 14515f9
Assert more CSS parsing
Domiii 0852edc
Fix tests
Domiii 1a4b781
Merge branch 'master' of github.com:replayio/chromium into dominik/tt…
Domiii 2c94761
Merge branch 'master' of github.com:replayio/chromium into dominik/tt…
Domiii 3ff1d25
Small fixes + issuu tests
Domiii 9ff1448
DEPS (v8)
Domiii ba1c2ba
Fix test runner + minor updates
Domiii 1b50cff
Clean up + more Asserts
Domiii adbee7c
More Asserts
Domiii 3486765
clean-up the `Use` counter Asserts
Domiii 4789101
Better warning categorizations in crash reprots
Domiii 7599dc2
Merge branch 'master' of github.com:replayio/chromium into dominik/tt…
Domiii 74cb781
DEPS (v8)
Domiii e1227b0
Merge branch 'master' of github.com:replayio/chromium into dominik/tt…
Domiii 0f91e22
whoops
Domiii e1e84ba
backend dep update
Domiii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
6c7e9991dcf557721c0566c2c0d68ac94f2a5b10 | ||
8d5f91e301c3d248654f3158db03fd9098eca8bb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,96 +23,26 @@ bool ContextLifecycleNotifier::IsContextDestroyed() const { | |
void ContextLifecycleNotifier::AddContextLifecycleObserver( | ||
ContextLifecycleObserver* observer) { | ||
observers_.AddObserver(observer); | ||
|
||
if (recordreplay::IsRecordingOrReplaying("values") && recordreplay::IsReplaying()) | ||
replay_observers_.push_back(observer); | ||
} | ||
|
||
void ContextLifecycleNotifier::RemoveContextLifecycleObserver( | ||
ContextLifecycleObserver* observer) { | ||
DCHECK(observers_.HasObserver(observer)); | ||
observers_.RemoveObserver(observer); | ||
|
||
for (wtf_size_t i = 0; i < replay_observers_.size(); i++) { | ||
if (replay_observers_[i] == observer) { | ||
replay_observers_.EraseAt(i); | ||
break; | ||
} | ||
} | ||
} | ||
|
||
void ContextLifecycleNotifier::NotifyContextDestroyed() { | ||
context_destroyed_ = true; | ||
|
||
ScriptForbiddenScope forbid_script; | ||
HeapVector<Member<ContextLifecycleObserver>> observers; | ||
observers_.ForEachObserver([&](ContextLifecycleObserver* observer) { | ||
observers.push_back(observer); | ||
observers_.ForEachObserver([](ContextLifecycleObserver* observer) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NOTE: Undid outdated changes. This looks like a very old version of assuring determinism of a |
||
observer->NotifyContextDestroyed(); | ||
}); | ||
observers_.Clear(); | ||
|
||
std::sort(observers.begin(), observers.end(), | ||
recordreplay::CompareMemberByPointerId<Member<ContextLifecycleObserver>>()); | ||
|
||
// When replaying, notify the same observers in the same order which were | ||
// notified when recording. Because of the use of weak pointers in the | ||
// HeapObserverSet the set contents can vary, so we manually record/replay | ||
// the objects which should be notified. The replay_observers_ vector holds | ||
// strong references on the observers when replaying so none of the observers | ||
// we need to notify should already be collected. | ||
if (recordreplay::IsRecordingOrReplaying("values", "ContextLifecycleNotifier::NotifyContextDestroyed") && | ||
recordreplay::FeatureEnabled("pointer-ids") && | ||
!recordreplay::AreEventsDisallowed()) { | ||
size_t num_observers = recordreplay::RecordReplayValue("NotifyContextDestroyed NumObservers", observers.size()); | ||
int* observer_ids = new int[num_observers]; | ||
|
||
if (recordreplay::IsRecording()) { | ||
for (wtf_size_t i = 0; i < observers.size(); i++) { | ||
int id = recordreplay::PointerId(observers[i]); | ||
CHECK(id); | ||
observer_ids[i] = id; | ||
} | ||
} | ||
|
||
recordreplay::RecordReplayBytes("ContextLifecycleNotifier::NotifyContextDestroyed ObserverIds", | ||
observer_ids, num_observers * sizeof(int)); | ||
|
||
if (recordreplay::IsReplaying()) { | ||
HeapVector<Member<ContextLifecycleObserver>> new_observers; | ||
for (ContextLifecycleObserver* observer : observers) { | ||
int id = recordreplay::PointerId(observer); | ||
CHECK(id); | ||
bool found = false; | ||
for (wtf_size_t i = 0; i < num_observers; i++) { | ||
if (observer_ids[i] == id) { | ||
found = true; | ||
break; | ||
} | ||
} | ||
if (found) | ||
new_observers.push_back(observer); | ||
} | ||
|
||
observers = std::move(new_observers); | ||
} | ||
|
||
delete[] observer_ids; | ||
} | ||
|
||
for (ContextLifecycleObserver* observer : observers) { | ||
if (!recordreplay::AreEventsDisallowed()) { | ||
recordreplay::Assert("ContextLifecycleNotifier::NotifyContextDestroyed #1 %d", | ||
recordreplay::PointerId(observer)); | ||
} | ||
observer->NotifyContextDestroyed(); | ||
} | ||
|
||
replay_observers_.clear(); | ||
} | ||
|
||
void ContextLifecycleNotifier::Trace(Visitor* visitor) const { | ||
visitor->Trace(observers_); | ||
visitor->Trace(replay_observers_); | ||
} | ||
|
||
} // namespace blink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 exactly might change? can the answer go in the comment?