Commit c777f75c authored by Illia Martyniuk's avatar Illia Martyniuk Committed by Commit Bot

Viz: Changing OnRegisteredHierarchy

Moving observer calls a bit up in the code so we don't miss hierarchy
events. We could miss them if |parent_source| is nullptr and we return
from the function earlier than events are sent.
Sorry for not catching this earlier.

Bug: 816802
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: Ic72e1b1553df6883540c97ff2cead2240fef7c13
Reviewed-on: https://chromium-review.googlesource.com/1008404Reviewed-by: default avatarkylechar <kylechar@chromium.org>
Commit-Queue: Illia Martyniuk <illiam@google.com>
Cr-Commit-Position: refs/heads/master@{#550048}
parent b45464bb
...@@ -197,6 +197,11 @@ void FrameSinkManagerImpl::RegisterFrameSinkHierarchy( ...@@ -197,6 +197,11 @@ void FrameSinkManagerImpl::RegisterFrameSinkHierarchy(
DCHECK(!base::ContainsKey(children, child_frame_sink_id)); DCHECK(!base::ContainsKey(children, child_frame_sink_id));
children.insert(child_frame_sink_id); children.insert(child_frame_sink_id);
for (auto& observer : observer_list_) {
observer.OnRegisteredFrameSinkHierarchy(parent_frame_sink_id,
child_frame_sink_id);
}
// If the parent has no source, then attaching it to this child will // If the parent has no source, then attaching it to this child will
// not change any downstream sources. // not change any downstream sources.
BeginFrameSource* parent_source = BeginFrameSource* parent_source =
...@@ -206,11 +211,6 @@ void FrameSinkManagerImpl::RegisterFrameSinkHierarchy( ...@@ -206,11 +211,6 @@ void FrameSinkManagerImpl::RegisterFrameSinkHierarchy(
DCHECK_EQ(registered_sources_.count(parent_source), 1u); DCHECK_EQ(registered_sources_.count(parent_source), 1u);
RecursivelyAttachBeginFrameSource(child_frame_sink_id, parent_source); RecursivelyAttachBeginFrameSource(child_frame_sink_id, parent_source);
for (auto& observer : observer_list_) {
observer.OnRegisteredFrameSinkHierarchy(parent_frame_sink_id,
child_frame_sink_id);
}
} }
void FrameSinkManagerImpl::UnregisterFrameSinkHierarchy( void FrameSinkManagerImpl::UnregisterFrameSinkHierarchy(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment