New issue
Advanced search Search tips

Issue 663522 link

Starred by 2 users

Issue metadata

Status: Archived
Owner:
Closed: Dec 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocking:
issue 660994



Sign in to add a comment

Wire up aura::PropertyConverter for ash

Project Member Reported by sky@chromium.org, Nov 8 2016

Issue description

aura::PropertyConverter is used to convert properties for transport to server and back. For example, ui::mojom::WindowManager::kAlwaysOnTop_Property corresponds to aura::client::kAlwaysOnTopKey. We need to write an implementation of aura::PropertyConverter that can map between these values.

Ideally this information would be baked into how the properties are defined (e.g. DEFINE_WINDOW_PROPERTY_KEY/DECLARE_WINDOW_PROPERTY_TYPE), but I suspect that would take some time.
 

Comment 1 by sky@chromium.org, Nov 8 2016

Labels: -Pri-3 Pri-2

Comment 3 by msw@chromium.org, Nov 11 2016

Owner: msw@chromium.org
Status: Started (was: Untriaged)
I'm taking a look.

Comment 4 by msw@chromium.org, Nov 11 2016

Hey Scott, I was initially trying to get clever using templates in the converter itself, but that gets tricky because some aura window property keys can be void* instead of aura::WindowProperty<T>*. It seems like we could convert all the native window properties to regular properties and nix the char/void* key type?

[Get|Set]NativeWindowProperty types (I don't see what's blocking these from being non-native...):
  Profile* Profile::kProfileKey (only used in chrome/browser/*)
  ui::Window* kMusWindowKey (only used in ui/aura/mus/mus_util.cc)
  void* TooltipManager::kGroupingPropertyKey (only used in ui/views/*)
  ui/aura/window_unittest.cc examples

I could instead try converting aura window properties to byte arrays, like mus? That seems like it should work in theory, though exported pointer property types couldn't be shared across mojo application bounds, even though it'd look like they are? This would likely also require an audit of users' expectations. Here's a breakdown of the aura property types:
  DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE (14 types, 5 primitive, 9 pointers)
  DECLARE_WINDOW_PROPERTY_TYPE (43 types, 6 primitives, 37 pointers)

I could also just go for a dumb brute force approach for now with the properties we care about...

I'm open to other ideas, and willing to bail if you'd prefer someone with more experience take over... WDYT?
Project Member

Comment 5 by bugdroid1@chromium.org, Nov 12 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/28625ccf0b3bcbcf118f06024f78d975f7575d5b

commit 28625ccf0b3bcbcf118f06024f78d975f7575d5b
Author: msw <msw@chromium.org>
Date: Sat Nov 12 02:12:33 2016

Implement aura::PropertyConverter for mus interop.

Provide an implementation for the interface.
TODO: Add other properties besides always-on-top.

Use aura::Window's internal int64_t property accessors.
TODO: This is wasteful for smaller types (eg. bool).

Use the existing property type converters.
TODO: Use Mojo's generated byte array Serialize function?

Some misc. TODO ideas to improve this or follow up:
TODO: Store aura::Window props by key *name*?
TODO: Store aura::Window props as std::vector<uint8_t>?
TODO: Optimize for smaller property types?
TODO: Let clients extend the set of known properties?
TODO: Nix WindowTreeClientDelegate::GetPropertyConverter?

BUG= 663522 
TEST=Automated
R=sky@chromium.org
TBR=tsepez@chromium.org

Review-Url: https://codereview.chromium.org/2488353005
Cr-Commit-Position: refs/heads/master@{#431743}

[modify] https://crrev.com/28625ccf0b3bcbcf118f06024f78d975f7575d5b/ui/aura/BUILD.gn
[modify] https://crrev.com/28625ccf0b3bcbcf118f06024f78d975f7575d5b/ui/aura/mus/DEPS
[add] https://crrev.com/28625ccf0b3bcbcf118f06024f78d975f7575d5b/ui/aura/mus/property_converter.cc
[modify] https://crrev.com/28625ccf0b3bcbcf118f06024f78d975f7575d5b/ui/aura/mus/property_converter.h
[modify] https://crrev.com/28625ccf0b3bcbcf118f06024f78d975f7575d5b/ui/aura/mus/window_tree_client_unittest.cc
[modify] https://crrev.com/28625ccf0b3bcbcf118f06024f78d975f7575d5b/ui/aura/test/aura_test_base.cc
[modify] https://crrev.com/28625ccf0b3bcbcf118f06024f78d975f7575d5b/ui/aura/window.h
[modify] https://crrev.com/28625ccf0b3bcbcf118f06024f78d975f7575d5b/ui/views/mus/mus_client.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Nov 17 2016

Project Member

Comment 7 by bugdroid1@chromium.org, Nov 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f84ab8b028d958dfd73d17cddb320dd319492910

commit f84ab8b028d958dfd73d17cddb320dd319492910
Author: msw <msw@chromium.org>
Date: Wed Nov 23 00:47:16 2016

Add gfx::ImageSkia and icon support to aura::PropertyConverter.

Split up mus app and window icon properties (like aura).
Remove unused ash::mus::GetWindowAppIcon; add/update tests.

BUG= 663522 
TEST=Automated.
R=sky@chromium.org
TBR=tsepez@chromium.org

Review-Url: https://codereview.chromium.org/2519583002
Cr-Commit-Position: refs/heads/master@{#434039}

[modify] https://crrev.com/f84ab8b028d958dfd73d17cddb320dd319492910/ash/mus/property_util.cc
[modify] https://crrev.com/f84ab8b028d958dfd73d17cddb320dd319492910/ash/mus/property_util.h
[modify] https://crrev.com/f84ab8b028d958dfd73d17cddb320dd319492910/ash/mus/window_manager.cc
[modify] https://crrev.com/f84ab8b028d958dfd73d17cddb320dd319492910/services/ui/public/interfaces/window_manager.mojom
[modify] https://crrev.com/f84ab8b028d958dfd73d17cddb320dd319492910/ui/aura/mus/property_converter.cc
[modify] https://crrev.com/f84ab8b028d958dfd73d17cddb320dd319492910/ui/aura/mus/property_converter.h
[modify] https://crrev.com/f84ab8b028d958dfd73d17cddb320dd319492910/ui/aura/mus/property_converter_unittest.cc
[modify] https://crrev.com/f84ab8b028d958dfd73d17cddb320dd319492910/ui/views/mus/native_widget_mus.cc
[modify] https://crrev.com/f84ab8b028d958dfd73d17cddb320dd319492910/ui/views/mus/native_widget_mus_unittest.cc

Comment 9 by sky@chromium.org, Dec 15 2016

Mike, can we call this done?

Comment 10 by msw@chromium.org, Dec 15 2016

Let me try to naively hook up window and app icons first.
(services/ui/public/interfaces/window_manager.mojom cites this bug)

Otherwise, it's generally fixed, and we have  Issue 655874  and Issue 667939 for optimizing image passing.
Project Member

Comment 11 by bugdroid1@chromium.org, Dec 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0c069a141a3acf78acc9fa357a558bf326ba4b73

commit 0c069a141a3acf78acc9fa357a558bf326ba4b73
Author: msw <msw@chromium.org>
Date: Thu Dec 22 14:23:25 2016

Register app and window icon properties for aura mus conversion.

This ports aura app and window icon properties over mus.

BUG= 663522 
TEST=chrome --mash task_viewer shelf item has an icon.
R=sadrul@chromium.org
TBR=tsepez@chromium.org

Review-Url: https://codereview.chromium.org/2591333002
Cr-Commit-Position: refs/heads/master@{#440411}

[modify] https://crrev.com/0c069a141a3acf78acc9fa357a558bf326ba4b73/services/ui/public/interfaces/window_manager.mojom
[modify] https://crrev.com/0c069a141a3acf78acc9fa357a558bf326ba4b73/ui/aura/mus/property_converter.cc

Comment 12 by msw@chromium.org, Dec 22 2016

Status: Fixed (was: Started)
This is now generally fixed.

Comment 13 by dchan@google.com, Mar 4 2017

Labels: VerifyIn-58

Comment 14 by dchan@google.com, Apr 17 2017

Labels: VerifyIn-59

Comment 15 by dchan@google.com, May 30 2017

Labels: VerifyIn-60
Labels: VerifyIn-61

Comment 17 by dchan@chromium.org, Oct 14 2017

Status: Archived (was: Fixed)

Sign in to add a comment