New issue
Advanced search Search tips

Issue 891017 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Rethink how property conversion is done

Project Member Reported by sky@chromium.org, Oct 1

Issue description

There is a fair amount of boilerplate code necessary to get properties sent over the wire. This code spans a number of places and is not particularly extensible. By that I mean you have to change PropertyConverter itself for any new type. This approach doesn't work for structures that are not known to aura as well.

In my ideal world we would extend the macros already in place to deal with this. For example, kAlwaysOnTopKey is currently defined as:

DEFINE_UI_CLASS_PROPERTY_KEY(bool, kAlwaysOnTopKey, false);

It would be created if all you needed to make this go over mojom is:

DEFINE_UI_CLASS_PROPERTY_KEY(bool, kAlwaysOnTopKey, false, ws::mojom::WindowManager::kAlwaysOnTop_Property);

?

When setting up the mapping between window constant and serialization we need to add how the types are converted, and potentially any validation. So, for non-core types something like:

DEFINE_UI_CLASS_PROPERTY_KEY(CustomType,
                             kKey,
                             defaultValue,
                             mojom-string-name,
                             encode_function,
                             decode_function,
                             validating_function);

 
+1, that would be nice.

Sign in to add a comment