New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 695420 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

SurfaceInfo needs an is_valid() method

Project Member Reported by fsam...@chromium.org, Feb 23 2017

Issue description

Currently 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.
 

Comment 1 by danakj@chromium.org, Feb 23 2017

In what scenarios do you want to have a SurfaceInfo with a valid SurfaceID but not other valid fields?
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.

Comment 3 by staraz@chromium.org, Feb 27 2017

Owner: staraz@chromium.org
Status: Assigned (was: Available)
Project Member

Comment 4 by bugdroid1@chromium.org, 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

Status: Fixed (was: Assigned)
Blocking: -601863
Components: -Internals>MUS Internals>Services>WindowService

Sign in to add a comment