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

Issue 629566 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocked on:
issue 632061

Blocking:
issue 563852



Sign in to add a comment

Import compositor_frame.mojom into Blink

Project Member Reported by xlai@chromium.org, Jul 19 2016

Issue description

This bug is about using compositor_frame.typemap to do type conversion in Blink.

compositor_frame.mojom has about 20 dependent mojom files from ui/, gpu/, skia/, cc/ipc/. 

Right now, we must import it to offscreen_canvas_surface.mojom (inside Blink) in order to add a mojo interface to submit compositor frame. This is an essential step to implement OffscreenCanvas.commit() to pass compositor frame from renderer to browser via mojo IPC calls.

However, the struct_traits used by compositor_frame.mojom and its dependent mojom types are currently only used in Chromium. To make it used by Chromium and Blink, we need two different conversions (one typemapping user custom type to mojom type in mojom-blink.h and another typemapping user custome type to mojom type in mojom.h). To reduce code duplication, we should aim to use partial template specialization so that Chromium and Blink can share the typemapping usage.



 

Comment 1 by xlai@chromium.org, Jul 19 2016

Blocking: 563852

Comment 2 by xlai@chromium.org, Jul 22 2016

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

Project Member

Comment 3 by bugdroid1@chromium.org, Jul 22 2016

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

commit b491c565c55b8a13862ae5c343c10c1f0025122d
Author: xlai <xlai@chromium.org>
Date: Fri Jul 22 22:01:11 2016

Organize typemaps in Blink

This CL organizes the typemaps in Blink GN build. Previously, we dump
typemaps in Blink to third_party/WebKit/Source/platform/mojo/blink_typemaps.gni,
even though some of them are used by third_party/WebKit/public/. This is wrong
and inconsistent with GYP build. So I added a new typemaps.gni in WebKit/public
to collect them separately.

TBR=pdr@chromium.org

BUG= 629566 

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

[modify] https://crrev.com/b491c565c55b8a13862ae5c343c10c1f0025122d/mojo/public/tools/bindings/blink_bindings_configuration.gni
[modify] https://crrev.com/b491c565c55b8a13862ae5c343c10c1f0025122d/third_party/WebKit/Source/platform/mojo/blink_typemaps.gni
[modify] https://crrev.com/b491c565c55b8a13862ae5c343c10c1f0025122d/third_party/WebKit/public/blink.gyp
[add] https://crrev.com/b491c565c55b8a13862ae5c343c10c1f0025122d/third_party/WebKit/public/blink_typemaps.gni

Comment 4 by xlai@chromium.org, Jul 27 2016

Blockedon: 632061

Comment 5 by xlai@chromium.org, Jul 27 2016

Status: Assigned (was: Started)
Pause this issue for 2 weeks first.

Comment 6 by xlai@chromium.org, Aug 23 2016

Description: Show this description
Project Member

Comment 7 by bugdroid1@chromium.org, Aug 24 2016

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

commit b8cd385fb7004724f431d99af4f410adcd51888e
Author: fsamuel <fsamuel@chromium.org>
Date: Wed Aug 24 21:47:45 2016

LatencyInfo mojo: Avoid extra copy of LatencyComponents

Prior to ArrayDataView, during deserialization, we read latency components outs
into a mojo::Array and then read the mojo array out into LatencyInfo's
latency_components_. This results in an unnecessary extra copy and is not
compatible with usage in blink. This CL moves us towards using ArrayDataView.

BUG= 629566 

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

[modify] https://crrev.com/b8cd385fb7004724f431d99af4f410adcd51888e/ui/events/mojo/latency_info_struct_traits.cc

Comment 8 by xlai@chromium.org, Aug 25 2016

Status: Started (was: Assigned)
Project Member

Comment 9 by bugdroid1@chromium.org, Sep 1 2016

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

commit 8f40538bf3fb692a3c0f1352c4294b0f35b465f6
Author: xlai <xlai@chromium.org>
Date: Thu Sep 01 19:46:22 2016

Use compositor_frame typemap in Blink

After mojo implementation change to share DataView between Blink and Chromium
( crbug.com/632061  fixed), now it is possible to use cc.mojom.CompositorFrame and
its typemap in Blink. Previously this attempt failed because of the need to
convert all struct_traits of  compositor_frame's dependent types to partial
templates (that would cause code bloating) or the need to include all typemaps
of dependent types to Blink (that would violate Blink-Chromium dependency
restriction); but now neither of these is needed.

This CL does the following:
1. It makes all the struct_traits of dependent types of compositor_frame.mojom
   to use shared DataView.
2. It extracts the struct_traits source files and put them as a standalone
   build target, which is then referenced by their coresponding typemap as well
   as the other struct_traits target that depend on them. In this way, the
   struct traits source files form a build dependency graph just as same as the
   mojom files. This allows Blink to include the cc struct traits (with proper
   dependency beneath it) to compile the compositor_frame typemap.
3. Ultimately, the usage of compositor_frame happens in
   offscreen_canvas_surface.mojom in Blink.
4. The offscreen_canvas_surface.mojom is isolated in build (see third_party/
   WebKit/public/BUILD) because it includes compositor_frame.h (a super complex
   data type that includes a lot of other things) that would pollute
   the other Blink mojom files. This is not to interfere other existing or
   future mojom files in Blink that do not want to include compositor_frame. I
   put these in the comment. Since it is an isolated build target, I add it
   to deps in WebKit/Source/platform/BUILD.gn and content/browser/BUILD.gn, the
   only two places that use offscreen_canvas_surface.

TBR=danakj@chromium.com,sievers@chromium.org
BUG= 629566 
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

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

[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/BUILD.gn
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/compositor_frame.typemap
[add] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/compositor_frame_for_blink.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/compositor_frame_metadata.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/compositor_frame_metadata_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/compositor_frame_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/filter_operation.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/filter_operation_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/filter_operations.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/filter_operations_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/quads_struct_traits.cc
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/quads_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/render_pass.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/render_pass_id.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/render_pass_id_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/render_pass_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/selection.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/selection_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/shared_quad_state.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/shared_quad_state_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/surface_id.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/surface_id_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/surface_sequence_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/transferable_resource.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/cc/ipc/transferable_resource_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/content/browser/BUILD.gn
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/content/common/BUILD.gn
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/gpu/ipc/common/BUILD.gn
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/gpu/ipc/common/gpu_info.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/gpu/ipc/common/mailbox_holder.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/gpu/ipc/common/mailbox_holder_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/gpu/ipc/common/mailbox_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/gpu/ipc/common/sync_token.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/gpu/ipc/common/sync_token_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/mojo/common/BUILD.gn
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/mojo/common/common_custom_types.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/mojo/common/common_custom_types_struct_traits.cc
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/mojo/common/common_custom_types_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/skia/public/interfaces/BUILD.gn
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/skia/public/interfaces/image_filter.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/skia/public/interfaces/image_filter_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/third_party/WebKit/Source/platform/BUILD.gn
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/third_party/WebKit/public/BUILD.gn
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/third_party/WebKit/public/blink_typemaps.gni
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/ui/events/mojo/BUILD.gn
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/ui/events/mojo/latency_info.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/ui/events/mojo/latency_info_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/ui/gfx/geometry/mojo/BUILD.gn
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/ui/gfx/geometry/mojo/geometry.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/ui/gfx/geometry/mojo/geometry_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/ui/gfx/mojo/BUILD.gn
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/ui/gfx/mojo/selection_bound.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/ui/gfx/mojo/selection_bound_struct_traits.h
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/ui/gfx/mojo/transform.typemap
[modify] https://crrev.com/8f40538bf3fb692a3c0f1352c4294b0f35b465f6/ui/gfx/mojo/transform_struct_traits.h

Comment 10 by xlai@chromium.org, Sep 2 2016

Status: Fixed (was: Started)

Sign in to add a comment