SurfaceInfo needs an is_valid() method |
|||||
Issue descriptionCurrently we check the validity of a SurfaceInfo object by grabbing the surface ID and then checking whether the surface ID is valid(). While that is a necessary condition of validity of a SurfaceInfo, it is technically insufficient. A SurfaceInfo is valid if the SurfaceId is valid AND the device scale factor is non-zero AND the frame size is not empty. I am a bit worried that the current check might lead to subtle bugs in the future.
,
Feb 23 2017
Well, really they're dumb mistakes I made while building the surface synchronization prototype. The parent allocates a new SurfaceID for the child, but the SurfaceLayer corresponding to the child in the parent takes in a SurfaceInfo for the new primary SurfaceInfo. We (me) can naively/accidentally pass in an invalid SurfaceInfo, and so we should probably DCHECK that it's valid in SurfaceLayer. SurfaceInfos are sent over IPC. I should probably check that they're valid in the StructTraits/ParamTraits. The display compositor sends the window server a SurfaceInfo which is then passed blindly to the parent. The gpu process can in theory be pwn3d and so we should ensure that we're sending valid SurfaceInfos on deseralization.
,
Feb 27 2017
,
Mar 1 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9afc576bd3e06d83d6abc870000293b4be9d6132 commit 9afc576bd3e06d83d6abc870000293b4be9d6132 Author: staraz <staraz@chromium.org> Date: Wed Mar 01 19:39:25 2017 Add cc::SurfaceInfo::is_valid() SurfaceInfo::is_valid() returns true iff the SurfaceId is valid AND the device scale factor is non-zero AND the frame size is not empty. SurfaceInfo::is_valid() replaces obtaining and checking if the SurfaceId of a SurfaceInfo object is valid. While that is a necessary condition of validity of a SurfaceInfo, it is technically insufficient. BUG= 695420 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Review-Url: https://codereview.chromium.org/2720503008 Cr-Commit-Position: refs/heads/master@{#453998} [modify] https://crrev.com/9afc576bd3e06d83d6abc870000293b4be9d6132/cc/ipc/cc_param_traits.cc [modify] https://crrev.com/9afc576bd3e06d83d6abc870000293b4be9d6132/cc/ipc/cc_param_traits.h [modify] https://crrev.com/9afc576bd3e06d83d6abc870000293b4be9d6132/cc/ipc/cc_param_traits_macros.h [modify] https://crrev.com/9afc576bd3e06d83d6abc870000293b4be9d6132/cc/ipc/cc_param_traits_unittest.cc [modify] https://crrev.com/9afc576bd3e06d83d6abc870000293b4be9d6132/cc/ipc/surface_info_struct_traits.h [modify] https://crrev.com/9afc576bd3e06d83d6abc870000293b4be9d6132/cc/layers/surface_layer.cc [modify] https://crrev.com/9afc576bd3e06d83d6abc870000293b4be9d6132/cc/layers/surface_layer_impl.cc [modify] https://crrev.com/9afc576bd3e06d83d6abc870000293b4be9d6132/cc/surfaces/surface_info.h [modify] https://crrev.com/9afc576bd3e06d83d6abc870000293b4be9d6132/cc/trees/layer_tree_host_impl.cc [modify] https://crrev.com/9afc576bd3e06d83d6abc870000293b4be9d6132/services/ui/ws/frame_generator.cc [modify] https://crrev.com/9afc576bd3e06d83d6abc870000293b4be9d6132/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp [modify] https://crrev.com/9afc576bd3e06d83d6abc870000293b4be9d6132/ui/aura/mus/window_port_mus.cc [modify] https://crrev.com/9afc576bd3e06d83d6abc870000293b4be9d6132/ui/compositor/layer.cc
,
Mar 1 2017
,
Jun 13 2017
,
Feb 26 2018
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by danakj@chromium.org
, Feb 23 2017