Closed Bug 1274149 Opened 9 years ago Closed 9 years ago

Restrict main-thread access to CompositorBridgeParent

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: dvander, Assigned: dvander)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

With out-of-process compositing, callers on the main thread won't be able to access CompositorBridgeParent directly, since it might live in the GPU process. I'm proposing a new GPUProcessManager class to provide these functions instead. Initially, it'll just wrap CompositorBridgeParent, but we'll try to ensure that no new direct callers appear. GPUProcessManager will later be responsible for launching the GPU process and maintaining state that has to migrate from out-of-process to in-process, or vice versa, in the event of a device reset or crash.
Skeleton class, with CompositorSession instantiation moved over.
Attachment #8754215 - Flags: review?(matt.woodrow)
Make GetAPZCTreeManager private, move calls to GPUProcessManager. I changed the CBP version to return already_AddRefed since it wasn't clear how threadsafe it is to return the bare pointer.
Attachment #8754223 - Flags: review?(bugmail.mozilla)
Comment on attachment 8754215 [details] [diff] [review] part 1, GPUProcessManager Review of attachment 8754215 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/ipc/GPUProcessManager.h @@ +20,5 @@ > +namespace gfx { > + > +// The GPUProcessManager is a singleton responsible for creating GPU-bound > +// objects that may live in another process. Currently, it provides access > +// to the compositor via CompositorBridgeParent. CompositorSession?
Attachment #8754215 - Flags: review?(matt.woodrow) → review+
(In reply to David Anderson [:dvander] from comment #0) > With out-of-process compositing, callers on the main thread won't be able to > access CompositorBridgeParent directly, since it might live in the GPU > process. I'm proposing a new GPUProcessManager class to provide these > functions instead. Initially, it'll just wrap CompositorBridgeParent, but > we'll try to ensure that no new direct callers appear. > > GPUProcessManager will later be responsible for launching the GPU process > and maintaining state that has to migrate from out-of-process to in-process, > or vice versa, in the event of a device reset or crash. Follow-up note: this state includes layers ID allocation (which will have to move to the GPUProcessManager) as well as observers, content controllers, and possibly the APZ input queue. When compositing has to migrate from out-of-process to in-process, GPUProcessManager will have to ensure the new compositor begins with this state.
Comment on attachment 8754215 [details] [diff] [review] part 1, GPUProcessManager Review of attachment 8754215 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/ipc/GPUProcessManager.h @@ +29,5 @@ > + static void Shutdown(); > + static GPUProcessManager* Get(); > + > + GPUProcessManager(); > + ~GPUProcessManager(); The constructor should probably be protected or private, if this is a singleton
Attachment #8754223 - Flags: review?(bugmail.mozilla) → review+
Attachment #8754242 - Flags: review?(matt.woodrow) → review+
Attachment #8754243 - Flags: review?(matt.woodrow) → review+
Attachment #8754245 - Flags: review?(matt.woodrow) → review+
Looking further back, this failure seems to have started prior to this landing. I think you should be good to reland this once the tree reopens.
Flags: needinfo?(dvander)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: