Bug 1298246 - Update documentation for APZ IPDL protocols. r=kats

MozReview-Commit-ID: 6IYNycFmu7z

--HG--
extra : rebase_source : 917aecd0b7dafc09db21c6993eb6eca0f01a8eba
This commit is contained in:
Ryan Hunt 2016-08-25 16:42:55 -07:00
Родитель 265b20404d
Коммит a624f81f28
7 изменённых файлов: 58 добавлений и 14 удалений

Просмотреть файл

@ -27,7 +27,11 @@ public:
/**
* Requests a paint of the given FrameMetrics |aFrameMetrics| from Gecko.
* Implementations per-platform are responsible for actually handling this.
* This method will always be called on the Gecko main thread.
*
* This method must always be called on the repaint thread, which depends
* on the GeckoContentController. For ChromeProcessController it is the
* Gecko main thread, while for RemoteContentController it is the compositor
* thread where it can send IPDL messages.
*/
virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics) = 0;

Просмотреть файл

@ -24,8 +24,14 @@ namespace layers {
class IAPZCTreeManager;
class APZEventState;
// A ChromeProcessController is attached to the root of a compositor's layer
// tree.
/**
* ChromeProcessController is a GeckoContentController attached to the root of
* a compositor's layer tree. It's used directly by APZ by default, and remoted
* using PAPZ if there is a gpu process.
*
* If ChromeProcessController needs to implement a new method on GeckoContentController
* PAPZ, APZChild, and RemoteContentController must be updated to handle it.
*/
class ChromeProcessController : public mozilla::layers::GeckoContentController
{
protected:

Просмотреть файл

@ -21,6 +21,17 @@ namespace layers {
class APZChild;
/**
* ContentProcessController is a GeckoContentController for a TabChild, and is always
* remoted using PAPZ/APZChild.
*
* ContentProcessController is created in ContentChild when a layer tree id has
* been allocated for a PBrowser that lives in that content process, and is destroyed
* when the Destroy message is received, or when the tab dies.
*
* If ContentProcessController needs to implement a new method on GeckoContentController
* PAPZ, APZChild, and RemoteContentController must be updated to handle it.
*/
class ContentProcessController final
: public GeckoContentController
{

Просмотреть файл

@ -15,6 +15,10 @@ namespace layers {
class GeckoContentController;
/**
* APZChild implements PAPZChild and is used to remote a GeckoContentController
* that lives in a different process than where APZ lives.
*/
class APZChild final : public PAPZChild
{
public:

Просмотреть файл

@ -29,13 +29,19 @@ namespace layers {
/**
* If APZ is enabled then one PAPZ will be opened per PBrowser between the
* process where the PBrowser child actor lives and the main process (the
* PBrowser parent actor doesn't necessarily live in the main process, for
* example with nested browsers). This will typically be set up when the layers
* id is allocated for the PBrowser.
* PAPZ is a protocol for remoting a GeckoContentController. PAPZ lives on the
* PCompositorBridge protocol which either connects to the compositor thread
* in the main process, or to the compositor thread in the gpu processs.
*
* Opened through PContent and runs on the main thread in both parent and child.
* PAPZParent lives in the compositor thread, while PAPZChild lives wherever the remoted
* GeckoContentController lives (generally the main thread of the main or content process).
* RemoteContentController implements PAPZParent, while APZChild implements PAPZChild.
*
* PAPZ is always used for ContentProcessController and only used for ChromeProcessController
* when there is a gpu process, otherwhise ChromeProcessController is used directly on the
* compositor thread. Only the methods that are used by the [Chrome,Content]ProcessController
* are implemented. If a new method is needed then PAPZ, APZChild, and RemoteContentController
* must be updated to handle it.
*/
sync protocol PAPZ
{
@ -48,6 +54,7 @@ parent:
async __delete__();
child:
async RequestContentRepaint(FrameMetrics frame);
// The aCallTakeFocusForClickFromTap argument is used for eSingleTap types,

Просмотреть файл

@ -34,6 +34,15 @@ using class mozilla::ScrollWheelInput from "InputData.h";
namespace mozilla {
namespace layers {
/**
* PAPZCTreeManager is a protocol for remoting an IAPZCTreeManager. PAPZCTreeManager
* lives on the PCompositorBridge protocol which either connects to the compositor
* thread in the main process, or to the compositor thread in the gpu processs.
*
* PAPZCTreeManagerParent lives in the compositor thread, while PAPZCTreeManagerChild
* lives in the main thread of the main or the content process. APZCTreeManagerParent
* and APZCTreeManagerChild implement this protocol.
*/
sync protocol PAPZCTreeManager
{
manager PCompositorBridge;

Просмотреть файл

@ -20,11 +20,14 @@ class TabParent;
namespace layers {
/**
* RemoteContentController uses the PAPZ protocol to implement a
* GeckoContentController for a browser living in a remote process.
* Most of the member functions can be called on any thread, exceptions are
* annotated in comments. The PAPZ protocol runs on the main thread (so all the
* Recv* member functions do too).
* RemoteContentController implements PAPZChild and is used to access a
* GeckoContentController that lives in a different process.
*
* RemoteContentController lives on the compositor thread. All methods can
* be called off the compositor thread and will get dispatched to the right
* thread, with the exception of RequestContentRepaint and NotifyFlushComplete,
* which must be called on the repaint thread, which in this case is the compositor
* thread.
*/
class RemoteContentController : public GeckoContentController
, public PAPZParent