Skip to content

Commit

Permalink
[embedding] Fix ipdl and related Bridge renames for embedlite
Browse files Browse the repository at this point in the history
  • Loading branch information
rainemak committed Apr 8, 2020
1 parent 98f2426 commit 1a515c7
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 113 deletions.
38 changes: 19 additions & 19 deletions embedding/embedlite/PEmbedLiteApp.ipdl
Expand Up @@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

include protocol PCompositor;
include protocol PCompositorBridge;
include protocol PEmbedLiteView;
include protocol PEmbedLiteWindow;

Expand All @@ -11,32 +11,32 @@ include DOMTypes;
namespace mozilla {
namespace embedlite {

prio(normal upto urgent) sync protocol PEmbedLiteApp {
parent opens PCompositor;
nested(upto inside_cpow) sync protocol PEmbedLiteApp {
parent opens PCompositorBridge;
manages PEmbedLiteView;
manages PEmbedLiteWindow;
parent:
Initialized();
ReadyToShutdown();
async Initialized();
async ReadyToShutdown();
sync CreateWindow(uint32_t parentId, nsCString uri, uint32_t chromeFlags, uint32_t contextFlags)
returns (uint32_t createdID, bool cancel);
PrefsArrayInitialized(PrefSetting[] prefs);
async PrefsArrayInitialized(PrefSetting[] prefs);

child:
PEmbedLiteView(uint32_t windowId, uint32_t id, uint32_t parentId, bool isPrivateWindow);
PEmbedLiteWindow(uint16_t width, uint16_t height, uint32_t id);
PreDestroy();
SetBoolPref(nsCString name, bool value);
SetCharPref(nsCString name, nsCString value);
SetIntPref(nsCString name, int value);
LoadGlobalStyleSheet(nsCString uri, bool aEnable);
AddObserver(nsCString topic);
RemoveObserver(nsCString topic);
LoadComponentManifest(nsCString manifest);
AddObservers(nsCString [] observers);
RemoveObservers(nsCString [] observers);
async PEmbedLiteView(uint32_t windowId, uint32_t id, uint32_t parentId, bool isPrivateWindow);
async PEmbedLiteWindow(uint16_t width, uint16_t height, uint32_t id);
async PreDestroy();
async SetBoolPref(nsCString name, bool value);
async SetCharPref(nsCString name, nsCString value);
async SetIntPref(nsCString name, int value);
async LoadGlobalStyleSheet(nsCString uri, bool aEnable);
async AddObserver(nsCString topic);
async RemoveObserver(nsCString topic);
async LoadComponentManifest(nsCString manifest);
async AddObservers(nsCString [] observers);
async RemoveObservers(nsCString [] observers);
both:
Observe(nsCString topic, nsString data);
async Observe(nsCString topic, nsString data);
};

}}
146 changes: 75 additions & 71 deletions embedding/embedlite/PEmbedLiteView.ipdl
Expand Up @@ -35,98 +35,102 @@ using mozilla::layers::GeckoContentController::APZStateChange from "mozilla/laye
namespace mozilla {
namespace embedlite {

prio(normal upto urgent) sync protocol PEmbedLiteView {
// Or inside_cpow
// nested(upto inside_sync)
nested(upto inside_sync) sync protocol PEmbedLiteView
{
manager PEmbedLiteApp;

child:
LoadURL(nsString url);
GoBack();
GoForward();
StopLoad();
Reload(bool hardReload);
LoadFrameScript(nsString uri);
SetIsActive(bool aIsActive);
SetIsFocused(bool aIsFocused);
SetThrottlePainting(bool aThrottle);
SetMargins(int top, int right, int bottom, int left);
ScheduleUpdate();
SuspendTimeouts();
ResumeTimeouts();
HandleScrollEvent(bool isRootScrollFrame, gfxRect contentRect, gfxSize scrollSize);

UpdateFrame(FrameMetrics frame) compress;
HandleDoubleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid);
HandleSingleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid);
HandleLongTap(CSSPoint aPoint, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
AcknowledgeScrollUpdate(ViewID aScrollId, uint32_t aScrollGeneration);
RequestFlingSnap(ViewID aScrollId, CSSPoint aDestination);
HandleTextEvent(nsString commit, nsString preEdit);
HandleKeyPressEvent(int domKeyCode, int gmodifiers, int charCode);
HandleKeyReleaseEvent(int domKeyCode, int gmodifiers, int charCode);
MouseEvent(nsString aType, float aX, float aY,
int32_t aButton, int32_t aClickCount,
int32_t aModifiers, bool aIgnoreRootScrollFrame);
NotifyAPZStateChange(ViewID aViewId, APZStateChange aChange, int aArg);
NotifyFlushComplete();

ScrollTo(int x, int y);
ScrollBy(int x, int y);

InputDataTouchEvent(ScrollableLayerGuid aGuid, MultiTouchInput event, uint64_t aInputBlockId, nsEventStatus aApzResponse);
async LoadURL(nsString url);
async GoBack();
async GoForward();
async StopLoad();
async Reload(bool hardReload);
async LoadFrameScript(nsString uri);
async SetIsActive(bool aIsActive);
async SetIsFocused(bool aIsFocused);
async SetThrottlePainting(bool aThrottle);
async SetMargins(int top, int right, int bottom, int left);
async ScheduleUpdate();
async SuspendTimeouts();
async ResumeTimeouts();
async HandleScrollEvent(bool isRootScrollFrame, gfxRect contentRect, gfxSize scrollSize);

async UpdateFrame(FrameMetrics frame) compress;
async HandleDoubleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid);
async HandleSingleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid);
async HandleLongTap(CSSPoint aPoint, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
async AcknowledgeScrollUpdate(ViewID aScrollId, uint32_t aScrollGeneration);
async RequestFlingSnap(ViewID aScrollId, CSSPoint aDestination);
async HandleTextEvent(nsString commit, nsString preEdit);
async HandleKeyPressEvent(int domKeyCode, int gmodifiers, int charCode);
async HandleKeyReleaseEvent(int domKeyCode, int gmodifiers, int charCode);
async MouseEvent(nsString aType, float aX, float aY,
int32_t aButton, int32_t aClickCount,
int32_t aModifiers, bool aIgnoreRootScrollFrame);
async NotifyAPZStateChange(ViewID aViewId, APZStateChange aChange, int aArg);
async NotifyFlushComplete();

async ScrollTo(int x, int y);
async ScrollBy(int x, int y);

async InputDataTouchEvent(ScrollableLayerGuid aGuid, MultiTouchInput event, uint64_t aInputBlockId, nsEventStatus aApzResponse);
// We use a separate message for touchmove events only to apply
// compression to them.
InputDataTouchMoveEvent(ScrollableLayerGuid aGuid, MultiTouchInput event, uint64_t aInputBlockId, nsEventStatus aApzResponse) compress;
AddMessageListener(nsCString name);
RemoveMessageListener(nsCString name);
AddMessageListeners(nsString [] messageNames);
RemoveMessageListeners(nsString [] messageNames);
async InputDataTouchMoveEvent(ScrollableLayerGuid aGuid, MultiTouchInput event, uint64_t aInputBlockId, nsEventStatus aApzResponse) compress;
async AddMessageListener(nsCString name);
async RemoveMessageListener(nsCString name);
async AddMessageListeners(nsString [] messageNames);
async RemoveMessageListeners(nsString [] messageNames);

Destroy();
async Destroy();

parent:
Initialized();
Destroyed();
__delete__();

OnLocationChanged(nsCString aLocation, bool aCanGoBack, bool aCanGoForward);
OnLoadStarted(nsCString aLocation);
OnLoadFinished();
OnLoadRedirect();
OnLoadProgress(int32_t aProgress, int32_t aCurTotal, int32_t aMaxTotal);
OnSecurityChanged(nsCString aStatus, uint32_t aState);
OnFirstPaint(int32_t aX, int32_t aY);
OnScrolledAreaChanged(uint32_t aWidth, uint32_t aHeight);
OnScrollChanged(int32_t offSetX, int32_t offSetY);
OnTitleChanged(nsString aTitle);
OnWindowCloseRequested();
async Initialized();
async Destroyed();
async __delete__();

async OnLocationChanged(nsCString aLocation, bool aCanGoBack, bool aCanGoForward);
async OnLoadStarted(nsCString aLocation);
async OnLoadFinished();
async OnLoadRedirect();
async OnLoadProgress(int32_t aProgress, int32_t aCurTotal, int32_t aMaxTotal);
async OnSecurityChanged(nsCString aStatus, uint32_t aState);
async OnFirstPaint(int32_t aX, int32_t aY);
async OnScrolledAreaChanged(uint32_t aWidth, uint32_t aHeight);
async OnScrollChanged(int32_t offSetX, int32_t offSetY);
async OnTitleChanged(nsString aTitle);
async OnWindowCloseRequested();

/**
* Updates the zoom constraints for a scrollable frame in this tab.
* The zoom controller code lives on the parent side and so this allows it to
* have up-to-date zoom constraints.
*/
UpdateZoomConstraints(uint32_t aPresShellId, ViewID aViewId, MaybeZoomConstraints aConstraints);
async UpdateZoomConstraints(uint32_t aPresShellId, ViewID aViewId, MaybeZoomConstraints aConstraints);

/**
* Instructs the EmbedLiteViewThreadParent to forward a request to zoom to a rect given in
* CSS pixels. This rect is relative to the document.
*/
ZoomToRect(uint32_t aPresShellId, ViewID aViewId, CSSRect aRect);
SetBackgroundColor(nscolor color);
ContentReceivedInputBlock(ScrollableLayerGuid aGuid, uint64_t aInputBlockId, bool aPreventDefault);
async ZoomToRect(uint32_t aPresShellId, ViewID aViewId, CSSRect aRect);
async SetBackgroundColor(nscolor color);
async ContentReceivedInputBlock(ScrollableLayerGuid aGuid, uint64_t aInputBlockId, bool aPreventDefault);

/**
* Notifies the APZ code of the results of the gecko hit-test for a
* particular input block. Each target corresponds to one touch point in the
* touch event.
*/
SetTargetAPZC(uint64_t aInputBlockId, ScrollableLayerGuid[] aTargets);
async SetTargetAPZC(uint64_t aInputBlockId, ScrollableLayerGuid[] aTargets);

/**
* Notifies the APZ code of the allowed touch-behaviours for a particular
* input block. Each item in the aFlags array corresponds to one touch point
* in the touch event.
*/
SetAllowedTouchBehavior(uint64_t aInputBlockId, TouchBehaviorFlags[] aFlags);
async SetAllowedTouchBehavior(uint64_t aInputBlockId, TouchBehaviorFlags[] aFlags);

/*
* Gets the DPI of the screen corresponding to this view.
Expand All @@ -136,22 +140,22 @@ parent:
sync SyncMessage(nsString aMessage, nsString aJSON)
returns (nsString[] retval);

prio(high) sync RpcMessage(nsString aMessage, nsString aJSON)
nested(inside_sync) sync RpcMessage(nsString aMessage, nsString aJSON)
returns (nsString[] retval);

// IME
sync GetInputContext() returns (int32_t IMEEnabled, int32_t IMEOpen);

SetInputContext(int32_t IMEEnabled,
int32_t IMEOpen,
nsString type,
nsString inputmode,
nsString actionHint,
int32_t cause,
int32_t focusChange);
async SetInputContext(int32_t IMEEnabled,
int32_t IMEOpen,
nsString type,
nsString inputmode,
nsString actionHint,
int32_t cause,
int32_t focusChange);

both:
AsyncMessage(nsString aMessage, nsString aData);
async AsyncMessage(nsString aMessage, nsString aData);
};

}}
14 changes: 7 additions & 7 deletions embedding/embedlite/PEmbedLiteWindow.ipdl
Expand Up @@ -11,18 +11,18 @@ using struct gfxSize from "gfxPoint.h";
namespace mozilla {
namespace embedlite {

prio(normal upto urgent) sync protocol PEmbedLiteWindow {
nested(upto inside_cpow) sync protocol PEmbedLiteWindow {
manager PEmbedLiteApp;

child:
SetSize(gfxSize aSize);
SetContentOrientation(uint32_t aRotation);
Destroy();
async SetSize(gfxSize aSize);
async SetContentOrientation(uint32_t aRotation);
async Destroy();

parent:
Initialized();
Destroyed();
__delete__();
async Initialized();
async Destroyed();
async __delete__();
};

} // namespace embedlite
Expand Down
Expand Up @@ -31,7 +31,7 @@
#include "nsIFactory.h"
#include "mozilla/GenericFactory.h"
#include "mozilla/ModuleUtils.h" // for NS_GENERIC_FACTORY_CONSTRUCTOR
#include "mozilla/layers/PCompositorChild.h"
#include "mozilla/layers/PCompositorBridgeChild.h"

#include "mozilla/Preferences.h"
#include "mozilla/dom/PContent.h"
Expand Down
Expand Up @@ -30,7 +30,7 @@
#include "base/command_line.h"
#include "nsDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
#include "mozilla/layers/CompositorParent.h"
#include "mozilla/layers/CompositorBridgeParent.h"
#include "mozilla/layers/ImageBridgeParent.h"

#include "EmbedLiteViewProcessParent.h"
Expand Down Expand Up @@ -332,8 +332,8 @@ EmbedLiteAppProcessParent::ShutDownProcess(bool aCloseWithError)
}
}

PCompositorParent*
EmbedLiteAppProcessParent::AllocPCompositorParent(Transport* aTransport,
PCompositorBridgeParent*
EmbedLiteAppProcessParent::AllocPCompositorBridgeParent(Transport* aTransport,
ProcessId aOtherProcess)
{
LOGT();
Expand Down
4 changes: 2 additions & 2 deletions embedding/embedlite/embedprocess/EmbedLiteAppProcessParent.h
Expand Up @@ -68,8 +68,8 @@ class EmbedLiteAppProcessParent : public PEmbedLiteAppParent
virtual void
ActorDestroy(ActorDestroyReason aWhy);

virtual PCompositorParent*
AllocPCompositorParent(Transport* aTransport, ProcessId aOtherProcess);
virtual PCompositorBridgeParent*
AllocPCompositorBridgeParent(Transport* aTransport, ProcessId aOtherProcess);

virtual bool
RecvPrefsArrayInitialized(nsTArray<mozilla::dom::PrefSetting>&& prefs);
Expand Down
Expand Up @@ -43,7 +43,7 @@ OpenCompositor(EmbedLiteCompositorProcessParent* aCompositor,
MOZ_ASSERT(ok);
}

/*static*/ PCompositorParent*
/*static*/ PCompositorBridgeParent*
EmbedLiteCompositorProcessParent::Create(Transport* aTransport, ProcessId aOtherProcess, int aSurfaceWidth, int aSurfaceHeight, uint32_t id)
{
LOGT();
Expand Down
Expand Up @@ -16,7 +16,7 @@
namespace mozilla {
namespace embedlite {

class EmbedLiteCompositorProcessParent final : public PCompositorParent,
class EmbedLiteCompositorProcessParent final : public PCompositorBridgeParent,
public ShadowLayersManager
{
friend class CompositorParent;
Expand Down Expand Up @@ -98,7 +98,7 @@ class EmbedLiteCompositorProcessParent final : public PCompositorParent,
* A new child process has been configured to push transactions
* directly to us. Transport is to its thread context.
*/
static PCompositorParent*
static PCompositorBridgeParent*
Create(Transport* aTransport, ProcessId aOtherProcess, int aSurfaceWidth, int aSurfaceHeight, uint32_t id);

private:
Expand Down
Expand Up @@ -7,7 +7,7 @@
#include "EmbedLiteAppThreadChild.h"
#include "EmbedLiteViewThreadChild.h"
#include "EmbedLiteWindowThreadChild.h"
#include "mozilla/layers/PCompositorChild.h"
#include "mozilla/layers/PCompositorBridgeChild.h"

namespace mozilla {
namespace embedlite {
Expand Down
6 changes: 3 additions & 3 deletions embedding/embedlite/embedthread/EmbedLiteAppThreadParent.cpp
Expand Up @@ -9,7 +9,7 @@
#include "EmbedLiteWindowThreadParent.h"
#include "EmbedLiteAppThreadParent.h"
#include "EmbedLiteApp.h"
#include "mozilla/layers/PCompositorParent.h"
#include "mozilla/layers/PCompositorBridgeParent.h"

#include "mozilla/unused.h"

Expand Down Expand Up @@ -126,8 +126,8 @@ EmbedLiteAppThreadParent::RecvObserve(const nsCString& topic,
return true;
}

PCompositorParent*
EmbedLiteAppThreadParent::AllocPCompositorParent(Transport* aTransport,
PCompositorBridgeParent*
EmbedLiteAppThreadParent::AllocPCompositorBridgeParent(Transport* aTransport,
ProcessId aOtherProcess)
{
LOGT();
Expand Down
6 changes: 3 additions & 3 deletions embedding/embedlite/embedthread/EmbedLiteAppThreadParent.h
Expand Up @@ -11,7 +11,7 @@
namespace mozilla {

namespace layers {
class PCompositorParent;
class PCompositorBridgeParent;
} // namespace layers

namespace embedlite {
Expand Down Expand Up @@ -48,8 +48,8 @@ class EmbedLiteAppThreadParent : public PEmbedLiteAppParent
uint32_t* createdID,
bool* cancel) override;

virtual PCompositorParent*
AllocPCompositorParent(Transport* aTransport, ProcessId aOtherProcess) override;
virtual PCompositorBridgeParent*
AllocPCompositorBridgeParent(Transport* aTransport, ProcessId aOtherProcess) override;

virtual bool
RecvPrefsArrayInitialized(nsTArray<mozilla::dom::PrefSetting>&& prefs) override;
Expand Down

0 comments on commit 1a515c7

Please sign in to comment.