@@ -17,14 +17,13 @@ IntersectionObserverManager::IntersectionObserverManager() = default;
17
17
18
18
void IntersectionObserverManager::observe (
19
19
IntersectionObserverObserverId intersectionObserverId,
20
- const ShadowNode ::Shared& shadowNode ,
20
+ const ShadowNodeFamily ::Shared& shadowNodeFamily ,
21
21
std::vector<Float> thresholds,
22
22
std::optional<std::vector<Float>> rootThresholds,
23
23
const UIManager& uiManager) {
24
24
TraceSection s (" IntersectionObserverManager::observe" );
25
25
26
- auto surfaceId = shadowNode->getSurfaceId ();
27
- auto shadowNodeFamily = shadowNode->getFamilyShared ();
26
+ auto surfaceId = shadowNodeFamily->getSurfaceId ();
28
27
29
28
// The actual observer lives in the array, so we need to create it there and
30
29
// then get a reference. Otherwise we only update its state in a copy.
@@ -78,15 +77,13 @@ void IntersectionObserverManager::observe(
78
77
79
78
void IntersectionObserverManager::unobserve (
80
79
IntersectionObserverObserverId intersectionObserverId,
81
- const ShadowNode& shadowNode ) {
80
+ const ShadowNodeFamily::Shared& shadowNodeFamily ) {
82
81
TraceSection s (" IntersectionObserverManager::unobserve" );
83
82
84
- auto & shadowNodeFamily = shadowNode.getFamily ();
85
-
86
83
{
87
84
std::unique_lock lock (observersMutex_);
88
85
89
- auto surfaceId = shadowNode. getSurfaceId ();
86
+ auto surfaceId = shadowNodeFamily-> getSurfaceId ();
90
87
91
88
auto observersIt = observersBySurfaceId_.find (surfaceId);
92
89
if (observersIt == observersBySurfaceId_.end ()) {
@@ -102,7 +99,7 @@ void IntersectionObserverManager::unobserve(
102
99
[intersectionObserverId, &shadowNodeFamily](const auto & observer) {
103
100
return observer.getIntersectionObserverId () ==
104
101
intersectionObserverId &&
105
- observer.isTargetShadowNodeFamily (shadowNodeFamily);
102
+ observer.isTargetShadowNodeFamily (* shadowNodeFamily);
106
103
}),
107
104
observers.end ());
108
105
@@ -120,7 +117,7 @@ void IntersectionObserverManager::unobserve(
120
117
pendingEntries_.end (),
121
118
[intersectionObserverId, &shadowNodeFamily](const auto & entry) {
122
119
return entry.intersectionObserverId == intersectionObserverId &&
123
- entry.sameShadowNodeFamily (shadowNodeFamily);
120
+ entry.sameShadowNodeFamily (* shadowNodeFamily);
124
121
}),
125
122
pendingEntries_.end ());
126
123
}
0 commit comments