Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Issue 2161993004: Make geometry struct_trait shared by Blink and Chromium (Closed)

Created:
4 years, 5 months ago by xlai (Olivia)
Modified:
4 years, 3 months ago
Reviewers:
Fady Samuel, dcheng
CC:
Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, blink-reviews, blink-reviews-api_chromium.org, cc-bugs_chromium.org, chromium-reviews, darin (slow to review), dglazkov+blink, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make geometry struct_trait shared by Blink and Chromium This CL is part of the effort to import compositor_frame.mojom to offscreen_canvas_surface.mojom in Blink. The compositor_frame.mojom depends on ui/gfx/geometry/mojo/geometry.mojom, cc/ipc/surface_id.mojom, etc. This CL makes geometry struct_traits to be a partial template specialization so that it can be specialized in blink mojom types and in chromium mojom types without code duplication. BUG=629566

Patch Set 1 #

Total comments: 4

Patch Set 2 : Remove geometry.typemap from Blink build #

Patch Set 3 : Only geometry struct traits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -31 lines) Patch
M ui/gfx/geometry/mojo/geometry_struct_traits.h View 6 chunks +30 lines, -31 lines 0 comments Download

Messages

Total messages: 30 (13 generated)
xlai (Olivia)
pdr@chromium.org: Please review changes in third_party/WebKit/public/ and third_party/WebKit/Source/platform/ to see if my re-organization in GN ...
4 years, 5 months ago (2016-07-19 21:10:13 UTC) #6
Fady Samuel
geometry_struct_traits.h lgtm
4 years, 5 months ago (2016-07-19 21:13:26 UTC) #7
pdr.
I'm not very familiar with this area. Just a couple nits about indentation. @jbroman, can ...
4 years, 5 months ago (2016-07-20 17:35:55 UTC) #13
dcheng
https://codereview.chromium.org/2161993004/diff/1/ui/gfx/geometry/mojo/geometry_struct_traits.h File ui/gfx/geometry/mojo/geometry_struct_traits.h (right): https://codereview.chromium.org/2161993004/diff/1/ui/gfx/geometry/mojo/geometry_struct_traits.h#newcode21 ui/gfx/geometry/mojo/geometry_struct_traits.h:21: template <typename T> Why do we need to templatize ...
4 years, 5 months ago (2016-07-20 18:16:10 UTC) #15
jbroman
If I read this correctly, this maps gfx.mojom.* to gfx::* in Blink as well as ...
4 years, 5 months ago (2016-07-20 18:25:31 UTC) #16
xlai (Olivia)
On 2016/07/20 18:25:31, jbroman wrote: > If I read this correctly, this maps gfx.mojom.* to ...
4 years, 5 months ago (2016-07-20 19:07:35 UTC) #17
xlai (Olivia)
On 2016/07/20 18:25:31, jbroman wrote: > Do we want to do that (at the moment ...
4 years, 5 months ago (2016-07-20 23:46:06 UTC) #18
yzshen1
On 2016/07/20 18:25:31, jbroman wrote: > If I read this correctly, this maps gfx.mojom.* to ...
4 years, 5 months ago (2016-07-21 16:17:21 UTC) #19
yzshen1
On 2016/07/20 23:46:06, xlai (Olivia) wrote: > On 2016/07/20 18:25:31, jbroman wrote: > > Do ...
4 years, 5 months ago (2016-07-21 16:28:38 UTC) #20
esprehn
I don't think we want to use the gfx types in blink yet, unless you're ...
4 years, 5 months ago (2016-07-21 17:29:14 UTC) #21
xlai (Olivia)
Based on suggestion from yzshen1@ and jbroman@, I did a local experiment and learn that ...
4 years, 5 months ago (2016-07-22 17:03:04 UTC) #22
jbroman
Could you please split the geometry_struct_traits.h change into a separate CL? It doesn't seem part ...
4 years, 5 months ago (2016-07-22 17:27:03 UTC) #23
dcheng
How many more struct traits do we need to do this for? It is an ...
4 years, 5 months ago (2016-07-22 17:49:27 UTC) #26
xlai (Olivia)
On 2016/07/22 17:27:03, jbroman wrote: > Could you please split the geometry_struct_traits.h change into a ...
4 years, 5 months ago (2016-07-22 17:52:56 UTC) #27
xlai (Olivia)
On 2016/07/22 17:49:27, dcheng wrote: > How many more struct traits do we need to ...
4 years, 5 months ago (2016-07-22 18:09:48 UTC) #28
dcheng
On 2016/07/22 18:09:48, xlai (Olivia) wrote: > On 2016/07/22 17:49:27, dcheng wrote: > > How ...
4 years, 5 months ago (2016-07-23 01:43:27 UTC) #29
xlai (Olivia)
4 years, 3 months ago (2016-08-26 20:19:31 UTC) #30
Message was sent while issue was closed.
To tie up the loose threads, this CL is abandoned and closed.
Instead, a completely different approach to import compositor_frame typemap to 
Blink that no longer raises any of the concerns here 
is done in another CL (https://codereview.chromium.org/2285433002/), after
yzshen@
has completed implementation change in mojo to allow Blink and Chromium and
share
the same DataView (crbug.com/632061).


On 2016/07/23 01:43:27, dcheng wrote:
> On 2016/07/22 18:09:48, xlai (Olivia) wrote:
> > On 2016/07/22 17:49:27, dcheng wrote:
> > > How many more struct traits do we need to do this for?
> > > 
> > > It is an oversight that the original Read() methods weren't out-of-lined,
> and
> > > templating makes that impossible. Are we going to need to template a bunch
> of
> > > other struct traits?
> > 
> > Yes, exactly.
> > The exhaustive list of struct_traits that I'm going to templatize are:
> > 
> > cc/ipc/compositor_frame_struct_traits
> > cc/ipc/compositor_frame_metadata_struct_traits
> > cc/ipc/render_pass_struct_traits
> > cc/ipc/render_pass_id_struct_traits
> > cc/ipc/transferable_resource_struct_traits
> > cc/ipc/selection_struct_traits
> > cc/ipc/shared_quad_state_struct_traits
> > cc/ipc/quads_struct_traits
> > cc/ipc/filter_operations_struct_traits
> > cc/ipc/filter_operation_struct_traits
> > ui/gfx/mojo/transform_struct_traits
> > ui/gfx/mojo/selection_bound_struct_traits
> > gpu/ipc/common/mailbox_struct_traits
> > gpu/ipc/common/mailbox_holder_struct_traits
> > gpu/ipc/common/sync_token_struct_traits
> > skia/public/interfaces/image_filter_struct_traits
> > mojo/common/common_custom_types_struct_traits
> > ui/events/mojo/latency_info_struct_traits
> > 
> > In total it is 18 struct_traits.
> > 
> > Note that these struct_traits themselves are already
> > templates by themselves. But I'm just changing the full
> > templates to partial templates. 
> > 
> > Two major reasons that I must do this are (+cc yzshen to verify): 
> > 1. I need to use compositor_frame.mojom in Blink, and it
> >    depends on the other 17 mojom files.
> > 2. Given the current differentiation btw Blink and Chromium
> >    in mojo, there is no other way to get around this. If
> >    I do not make them partial templates, then the only other
> >    way is to add 18 more struct_traits in Blink to specifically
> >    do type conversion between Blink mojom types and custom
> >    types.
> 
> Some of these Read methods() are very large and having them inline is going to
> result in a fair amount of bloat. If it's possible to define these in a .cc
even
> with the partial specialization, then I have no objection. But I don't think
it
> is, in which case, we need to find another solution.

Powered by Google App Engine
This is Rietveld 408576698