Skip to content

Commit

Permalink
Fixed embedlite compilation on latest upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
romaxa committed Oct 31, 2014
1 parent 8301313 commit f03b174
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 35 deletions.
8 changes: 4 additions & 4 deletions embedding/embedlite/PEmbedLiteView.ipdl
Expand Up @@ -47,7 +47,7 @@ child:
UpdateFrame(FrameMetrics frame) compress;
HandleDoubleTap(nsIntPoint point);
HandleSingleTap(nsIntPoint point);
HandleLongTap(nsIntPoint point);
HandleLongTap(nsIntPoint point, uint64_t aInputBlockId);
AcknowledgeScrollUpdate(ViewID aScrollId, uint32_t aScrollGeneration);
HandleTextEvent(nsString commit, nsString preEdit);
HandleKeyPressEvent(int domKeyCode, int gmodifiers, int charCode);
Expand All @@ -56,10 +56,10 @@ child:
int32_t aButton, int32_t aClickCount,
int32_t aModifiers, bool aIgnoreRootScrollFrame);

InputDataTouchEvent(ScrollableLayerGuid aGuid, MultiTouchInput event);
InputDataTouchEvent(ScrollableLayerGuid aGuid, MultiTouchInput event, uint64_t aInputBlockId);
// We use a separate message for touchmove events only to apply
// compression to them.
InputDataTouchMoveEvent(ScrollableLayerGuid aGuid, MultiTouchInput event) compress;
InputDataTouchMoveEvent(ScrollableLayerGuid aGuid, MultiTouchInput event, uint64_t aInputBlockId) compress;
AddMessageListener(nsCString name);
RemoveMessageListener(nsCString name);
AddMessageListeners(nsString [] messageNames);
Expand Down Expand Up @@ -97,7 +97,7 @@ parent:
*/
ZoomToRect(uint32_t aPresShellId, ViewID aViewId, CSSRect aRect);
async SetBackgroundColor(nscolor color);
ContentReceivedTouch(ScrollableLayerGuid aGuid, bool aPreventDefault);
ContentReceivedTouch(ScrollableLayerGuid aGuid, uint64_t aInputBlockId, bool aPreventDefault);
sync GetGLViewSize()
returns (gfxSize aSize);

Expand Down
14 changes: 9 additions & 5 deletions embedding/embedlite/embedthread/EmbedContentController.cpp
Expand Up @@ -70,18 +70,21 @@ void EmbedContentController::HandleSingleTap(const CSSPoint& aPoint, int32_t aMo
}
}

void EmbedContentController::HandleLongTap(const CSSPoint& aPoint, int32_t aModifiers, const ScrollableLayerGuid& aGuid)
void EmbedContentController::HandleLongTap(const CSSPoint& aPoint,
int32_t aModifiers,
const ScrollableLayerGuid& aGuid,
uint64_t aInputBlockId)
{
if (MessageLoop::current() != mUILoop) {
// We have to send this message from the "UI thread" (main
// thread).
mUILoop->PostTask(
FROM_HERE,
NewRunnableMethod(this, &EmbedContentController::HandleLongTap, aPoint, aModifiers, aGuid));
NewRunnableMethod(this, &EmbedContentController::HandleLongTap, aPoint, aModifiers, aGuid, aInputBlockId));
return;
}
if (mRenderFrame && !GetListener()->HandleLongTap(nsIntPoint(aPoint.x, aPoint.y))) {
unused << mRenderFrame->SendHandleLongTap(nsIntPoint(aPoint.x, aPoint.y));
unused << mRenderFrame->SendHandleLongTap(nsIntPoint(aPoint.x, aPoint.y), aInputBlockId);
}
}

Expand Down Expand Up @@ -180,13 +183,14 @@ void EmbedContentController::DoRequestContentRepaint(const FrameMetrics& aFrameM

nsEventStatus
EmbedContentController::ReceiveInputEvent(InputData& aEvent,
mozilla::layers::ScrollableLayerGuid* aOutTargetGuid)
mozilla::layers::ScrollableLayerGuid* aOutTargetGuid,
uint64_t* aOutInputBlockId)
{
if (!mAPZC) {
return nsEventStatus_eIgnore;
}

return mAPZC->ReceiveInputEvent(aEvent, aOutTargetGuid);
return mAPZC->ReceiveInputEvent(aEvent, aOutTargetGuid, aOutInputBlockId);
}

void
Expand Down
7 changes: 4 additions & 3 deletions embedding/embedlite/embedthread/EmbedContentController.h
Expand Up @@ -6,7 +6,7 @@
#ifndef MOZ_EMBED_CONTENT_CONTROLLER_H
#define MOZ_EMBED_CONTENT_CONTROLLER_H

#include "mozilla/layers/AsyncPanZoomController.h"
#include "apz/src/AsyncPanZoomController.h" // for AsyncPanZoomController
#include "mozilla/layers/GeckoContentController.h"
#include "FrameMetrics.h"

Expand Down Expand Up @@ -34,7 +34,7 @@ class EmbedContentController : public mozilla::layers::GeckoContentController
virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics) MOZ_OVERRIDE;
virtual void HandleDoubleTap(const CSSPoint& aPoint, int32_t aModifiers, const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
virtual void HandleSingleTap(const CSSPoint& aPoint, int32_t aModifiers, const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
virtual void HandleLongTap(const CSSPoint& aPoint, int32_t aModifiers, const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
virtual void HandleLongTap(const CSSPoint& aPoint, int32_t aModifiers, const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId) MOZ_OVERRIDE;
virtual void HandleLongTapUp(const CSSPoint& aPoint, int32_t aModifiers, const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
virtual void SendAsyncScrollDOMEvent(bool aIsRoot,
const CSSRect& aContentRect,
Expand All @@ -48,7 +48,8 @@ class EmbedContentController : public mozilla::layers::GeckoContentController
LayoutDeviceIntPoint* aRefPointOut);
void ContentReceivedTouch(const ScrollableLayerGuid& aGuid, bool aPreventDefault);
nsEventStatus ReceiveInputEvent(InputData& aEvent,
mozilla::layers::ScrollableLayerGuid* aOutTargetGuid);
mozilla::layers::ScrollableLayerGuid* aOutTargetGuid,
uint64_t* aOutInputBlockId);

mozilla::layers::APZCTreeManager* GetManager() { return mAPZC; }

Expand Down
12 changes: 6 additions & 6 deletions embedding/embedlite/embedthread/EmbedLiteViewThreadChild.cpp
Expand Up @@ -696,10 +696,10 @@ EmbedLiteViewThreadChild::RecvHandleSingleTap(const nsIntPoint& aPoint)
}

bool
EmbedLiteViewThreadChild::RecvHandleLongTap(const nsIntPoint& aPoint)
EmbedLiteViewThreadChild::RecvHandleLongTap(const nsIntPoint& aPoint, const uint64_t& aInputBlockId)
{
for (unsigned int i = 0; i < mControllerListeners.Length(); i++) {
mControllerListeners[i]->HandleLongTap(CSSIntPoint(aPoint.x, aPoint.y), 0, ScrollableLayerGuid(0, 0, 0));
mControllerListeners[i]->HandleLongTap(CSSIntPoint(aPoint.x, aPoint.y), 0, ScrollableLayerGuid(0, 0, 0), aInputBlockId);
}

if (sPostAZPCAsJson.longTap) {
Expand Down Expand Up @@ -854,7 +854,7 @@ EmbedLiteViewThreadChild::RecvMouseEvent(const nsString& aType,
}

bool
EmbedLiteViewThreadChild::RecvInputDataTouchEvent(const ScrollableLayerGuid& aGuid, const mozilla::MultiTouchInput& aData)
EmbedLiteViewThreadChild::RecvInputDataTouchEvent(const ScrollableLayerGuid& aGuid, const mozilla::MultiTouchInput& aData, const uint64_t& aInputBlockId)
{
WidgetTouchEvent localEvent;
if (mHelper->ConvertMutiTouchInputToEvent(aData, localEvent)) {
Expand All @@ -863,7 +863,7 @@ EmbedLiteViewThreadChild::RecvInputDataTouchEvent(const ScrollableLayerGuid& aGu
nsCOMPtr<nsPIDOMWindow> outerWindow = do_GetInterface(mWebNavigation);
nsCOMPtr<nsPIDOMWindow> innerWindow = outerWindow->GetCurrentInnerWindow();
if (innerWindow && innerWindow->HasTouchEventListeners()) {
SendContentReceivedTouch(aGuid, nsIPresShell::gPreventMouseEvents);
SendContentReceivedTouch(aGuid, aInputBlockId, nsIPresShell::gPreventMouseEvents);
}
static bool sDispatchMouseEvents;
static bool sDispatchMouseEventsCached = false;
Expand All @@ -888,9 +888,9 @@ EmbedLiteViewThreadChild::RecvInputDataTouchEvent(const ScrollableLayerGuid& aGu
}

bool
EmbedLiteViewThreadChild::RecvInputDataTouchMoveEvent(const ScrollableLayerGuid& aGuid, const mozilla::MultiTouchInput& aData)
EmbedLiteViewThreadChild::RecvInputDataTouchMoveEvent(const ScrollableLayerGuid& aGuid, const mozilla::MultiTouchInput& aData, const uint64_t& aInputBlockId)
{
return RecvInputDataTouchEvent(aGuid, aData);
return RecvInputDataTouchEvent(aGuid, aData, aInputBlockId);
}

NS_IMETHODIMP
Expand Down
6 changes: 3 additions & 3 deletions embedding/embedlite/embedthread/EmbedLiteViewThreadChild.h
Expand Up @@ -85,7 +85,7 @@ class EmbedLiteViewThreadChild : public PEmbedLiteViewChild,
virtual bool RecvUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics);
virtual bool RecvHandleDoubleTap(const nsIntPoint& aPoint);
virtual bool RecvHandleSingleTap(const nsIntPoint& aPoint);
virtual bool RecvHandleLongTap(const nsIntPoint& aPoint);
virtual bool RecvHandleLongTap(const nsIntPoint& aPoint, const uint64_t& aInputBlockId);
virtual bool RecvAcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId, const uint32_t& aScrollGeneration);
virtual bool RecvMouseEvent(const nsString& aType,
const float& aX,
Expand All @@ -97,8 +97,8 @@ class EmbedLiteViewThreadChild : public PEmbedLiteViewChild,
virtual bool RecvHandleTextEvent(const nsString& commit, const nsString& preEdit);
virtual bool RecvHandleKeyPressEvent(const int& domKeyCode, const int& gmodifiers, const int& charCode);
virtual bool RecvHandleKeyReleaseEvent(const int& domKeyCode, const int& gmodifiers, const int& charCode);
virtual bool RecvInputDataTouchEvent(const ScrollableLayerGuid& aGuid, const mozilla::MultiTouchInput&);
virtual bool RecvInputDataTouchMoveEvent(const ScrollableLayerGuid& aGuid, const mozilla::MultiTouchInput&);
virtual bool RecvInputDataTouchEvent(const ScrollableLayerGuid& aGuid, const mozilla::MultiTouchInput&, const uint64_t& aInputBlockId);
virtual bool RecvInputDataTouchMoveEvent(const ScrollableLayerGuid& aGuid, const mozilla::MultiTouchInput&, const uint64_t& aInputBlockId);

virtual bool
RecvAddMessageListener(const nsCString&);
Expand Down
16 changes: 8 additions & 8 deletions embedding/embedlite/embedthread/EmbedLiteViewThreadParent.cpp
Expand Up @@ -281,10 +281,10 @@ EmbedLiteViewThreadParent::RecvZoomToRect(const uint32_t& aPresShellId,
}

bool
EmbedLiteViewThreadParent::RecvContentReceivedTouch(const ScrollableLayerGuid& aGuid, const bool& aPreventDefault)
EmbedLiteViewThreadParent::RecvContentReceivedTouch(const ScrollableLayerGuid& aGuid, const uint64_t& aInputBlockId, const bool& aPreventDefault)
{
if (mController->GetManager()) {
mController->GetManager()->ContentReceivedTouch(aGuid, aPreventDefault);
mController->GetManager()->ContentReceivedTouch(aInputBlockId, aPreventDefault);
}
return true;
}
Expand Down Expand Up @@ -430,7 +430,7 @@ EmbedLiteViewThreadParent::ReceiveInputEvent(const mozilla::InputData& aEvent)
{
if (mController->GetManager()) {
ScrollableLayerGuid guid;
mController->ReceiveInputEvent(const_cast<mozilla::InputData&>(aEvent), &guid);
mController->ReceiveInputEvent(const_cast<mozilla::InputData&>(aEvent), &guid, nullptr);
if (aEvent.mInputType == MULTITOUCH_INPUT) {
const MultiTouchInput& multiTouchInput = aEvent.AsMultiTouchInput();
LayoutDeviceIntPoint lpt;
Expand All @@ -443,9 +443,9 @@ EmbedLiteViewThreadParent::ReceiveInputEvent(const mozilla::InputData& aEvent)
translatedEvent.mTouches.AppendElement(newData);
}
if (multiTouchInput.mType == MultiTouchInput::MULTITOUCH_MOVE) {
unused << SendInputDataTouchMoveEvent(guid, translatedEvent);
unused << SendInputDataTouchMoveEvent(guid, translatedEvent, 0);
} else {
unused << SendInputDataTouchEvent(guid, translatedEvent);
unused << SendInputDataTouchEvent(guid, translatedEvent, 0);
}
}
}
Expand Down Expand Up @@ -507,7 +507,7 @@ EmbedLiteViewThreadParent::MousePress(int x, int y, int mstime, unsigned int but
mozilla::ScreenSize(1, 1),
180.0f,
1.0f));
mController->ReceiveInputEvent(event, nullptr);
mController->ReceiveInputEvent(event, nullptr, nullptr);
unused << SendMouseEvent(NS_LITERAL_STRING("mousedown"),
x, y, buttons, 1, modifiers,
true);
Expand All @@ -524,7 +524,7 @@ EmbedLiteViewThreadParent::MouseRelease(int x, int y, int mstime, unsigned int b
mozilla::ScreenSize(1, 1),
180.0f,
1.0f));
mController->ReceiveInputEvent(event, nullptr);
mController->ReceiveInputEvent(event, nullptr, nullptr);
unused << SendMouseEvent(NS_LITERAL_STRING("mouseup"),
x, y, buttons, 1, modifiers,
true);
Expand All @@ -542,7 +542,7 @@ EmbedLiteViewThreadParent::MouseMove(int x, int y, int mstime, unsigned int butt
mozilla::ScreenSize(1, 1),
180.0f,
1.0f));
mController->ReceiveInputEvent(event, nullptr);
mController->ReceiveInputEvent(event, nullptr, nullptr);
unused << SendMouseEvent(NS_LITERAL_STRING("mousemove"),
x, y, buttons, 1, modifiers,
true);
Expand Down
Expand Up @@ -90,7 +90,7 @@ class EmbedLiteViewThreadParent : public PEmbedLiteViewParent,
const ViewID& aViewId,
const CSSRect& aRect);
virtual bool RecvSetBackgroundColor(const nscolor& aColor);
virtual bool RecvContentReceivedTouch(const ScrollableLayerGuid& aGuid, const bool& aPreventDefault);
virtual bool RecvContentReceivedTouch(const ScrollableLayerGuid& aGuid, const uint64_t& aInputBlockId, const bool& aPreventDefault);

// IME
virtual bool RecvGetInputContext(int32_t* aIMEEnabled,
Expand Down
4 changes: 2 additions & 2 deletions embedding/embedlite/modules/EmbedLiteAppService.cpp
Expand Up @@ -26,7 +26,7 @@
#include "EmbedLiteViewThreadChild.h"
#include "nsIBaseWindow.h"
#include "nsIWebBrowser.h"
#include "mozilla/layers/AsyncPanZoomController.h"
#include "apz/src/AsyncPanZoomController.h" // for AsyncPanZoomController
#include "mozilla/embedlite/EmbedLog.h"
#include "xpcprivate.h"
#include "nsPIDOMWindow.h"
Expand Down Expand Up @@ -283,7 +283,7 @@ EmbedLiteAppService::ContentReceivedTouch(uint32_t aWinId, bool aPreventDefault)
{
EmbedLiteViewThreadChild* view = sGetViewById(aWinId);
NS_ENSURE_TRUE(view, NS_ERROR_FAILURE);
view->SendContentReceivedTouch(ScrollableLayerGuid(0, 0, 0), aPreventDefault);
view->SendContentReceivedTouch(ScrollableLayerGuid(0, 0, 0), aPreventDefault, 0);
return NS_OK;
}

Expand Down
4 changes: 2 additions & 2 deletions embedding/embedlite/modules/EmbedLiteJSON.cpp
Expand Up @@ -11,10 +11,10 @@
#include "nsServiceManagerUtils.h"
#include "jsapi.h"
#include "xpcprivate.h"
#include "XPCQuickStubs.h"
#include "nsJSUtils.h"
#include "nsDOMJSUtils.h"
#include "nsContentUtils.h"
#include "mozilla/dom/BindingUtils.h"

using namespace mozilla;

Expand Down Expand Up @@ -194,7 +194,7 @@ static bool SetPropFromVariant(nsIProperty* aProp, JSContext* aCx, JSObject* aOb
aProp->GetValue(getter_AddRefs(aVariant));
aProp->GetName(name);

if (!xpc_qsVariantToJsval(aCx, aVariant, &rval)) {
if (!VariantToJsval(aCx, aVariant, &rval)) {
NS_ERROR("Failed to convert nsIVariant to jsval");
return false;
}
Expand Down
5 changes: 5 additions & 0 deletions embedding/embedlite/moz.build
Expand Up @@ -64,4 +64,9 @@ IPDL_SOURCES += [
'PEmbedLiteView.ipdl'
]

LOCAL_INCLUDES += [
'/gfx/layers',
'/widget',
]

include('/ipc/chromium/chromium-config.mozbuild')
2 changes: 1 addition & 1 deletion embedding/embedlite/utils/TabChildHelper.cpp
Expand Up @@ -10,7 +10,7 @@

#include "TabChild.h"
#include "EmbedLiteViewThreadChild.h"
#include "mozilla/layers/AsyncPanZoomController.h"
#include "apz/src/AsyncPanZoomController.h" // for AsyncPanZoomController
#include "nsIDOMDocument.h"
#include "mozilla/EventListenerManager.h"

Expand Down

0 comments on commit f03b174

Please sign in to comment.