Closed Bug 1371527 Opened 3 years ago Closed 3 years ago

Create a LayersMessageUtils from GfxMessageUtils


(Core :: Graphics, enhancement)

Not set



Tracking Status
firefox56 --- fixed


(Reporter: rhunt, Assigned: rhunt)



(Whiteboard: [gfx-noted])


(1 file)

For bug 1351783, I want to include nsGUIEventIPC.h from within GfxMessageUtils.h so I can serialize a KeyboardShortcut (with ParamsTrait in GfxMessageUtils) which contains a KeyboardEventType (with ParamTraits in nsGUIEventIPC.h).

Unfortunately nsGUIEventIPC.h already includes GfxMessageUtils.h so it's a circular reference. Looking at it more, I see that nsGUIEventIPC.h really only needs ParamTraits for gfx types, not ParamTraits for layers types.

So I think it makes sense to split the files apart and have a new LayersMessageUtils.h that includes GfxMessageUtils.h. We can then include nsGUIEventIPC.h in LayerMessageUtils.h without a problem.
Blocks: apz-keyboard
Whiteboard: [gfx-noted]
Comment on attachment 8876006 [details]
Bug 1371527 - Add LayersMessageUtils

::: gfx/ipc/LayersMessageUtils.h:8
(Diff revision 1)
>  /* This Source Code Form is subject to the terms of the Mozilla Public
>   * License, v. 2.0. If a copy of the MPL was not distributed with this
>   * file, You can obtain one at */
> -#ifndef __GFXMESSAGEUTILS_H__
> -#define __GFXMESSAGEUTILS_H__

nit: I think this is supposed to look like mozilla_gfx_ipc_LayersMessageUtils_h

::: gfx/ipc/
(Diff revision 1)
>      BUG_COMPONENT = ('Core', 'Graphics: Layers')
>  EXPORTS.mozilla += [
>      'D3DMessageUtils.h',
> -    'GfxMessageUtils.h'
> +    'GfxMessageUtils.h',
> +    'LayersMessageUtils.h'

Should LayersMessageUtils.h be in gfx/layers/ipc, and be exported into mozilla/layers? (We're pretty inconsistent so it doesn't bother me either way.)
Attachment #8876006 - Flags: review?(dvander) → review+

I moved it to gfx/layers/ipc/ as that makes more sense, and updated the include guard.
Pushed by
Add LayersMessageUtils for IPC serialization of mozilla::layers structs. r=dvander
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.