Skip to content

Commit

Permalink
[embedlite] Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
rojkov committed May 13, 2015
1 parent 9d5536a commit e4db14a
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 30 deletions.
4 changes: 2 additions & 2 deletions embedding/embedlite/EmbedLiteApp.cpp
Expand Up @@ -196,7 +196,7 @@ EmbedLiteApp::Start(EmbedType aEmbedType)
mSubThread->Stop();
mSubThread = NULL;
} else if (mListener) {
NS_ABORT_IF_FALSE(mListener->StopChildThread(),
NS_ASSERTION(mListener->StopChildThread(),
"StopChildThread must be implemented when ExecuteChildThread defined");
}
if (mUILoop) {
Expand Down Expand Up @@ -321,7 +321,7 @@ EmbedLiteApp::Shutdown()
mSubThread->Stop();
mSubThread = NULL;
} else if (mListener) {
NS_ABORT_IF_FALSE(mListener->StopChildThread(),
NS_ASSERTION(mListener->StopChildThread(),
"StopChildThread must be implemented when ExecuteChildThread defined");
}
} else if (mEmbedType == EMBED_PROCESS) {
Expand Down
Expand Up @@ -196,6 +196,7 @@ EmbedLiteCompositorProcessParent::ShadowLayersUpdated(
LayerTransactionParent* aLayerTree,
const uint64_t& aTransactionId,
const TargetConfig& aTargetConfig,
const InfallibleTArray<PluginWindowData>& aPlugins,
bool aIsFirstPaint,
bool aScheduleComposite,
uint32_t aPaintSequenceNumber,
Expand Down
Expand Up @@ -16,8 +16,8 @@
namespace mozilla {
namespace embedlite {

class EmbedLiteCompositorProcessParent MOZ_FINAL : public PCompositorParent,
public ShadowLayersManager
class EmbedLiteCompositorProcessParent final : public PCompositorParent,
public ShadowLayersManager
{
friend class CompositorParent;

Expand Down Expand Up @@ -66,6 +66,7 @@ class EmbedLiteCompositorProcessParent MOZ_FINAL : public PCompositorParent,
virtual void ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
const uint64_t& aTransactionId,
const TargetConfig& aTargetConfig,
const InfallibleTArray<PluginWindowData>& aPlugins,
bool aIsFirstPaint,
bool aScheduleComposite,
uint32_t aPaintSequenceNumber,
Expand Down
Expand Up @@ -57,7 +57,7 @@ EmbedLiteViewProcessChild::OnGeckoWindowInitialized()
ShadowLayerForwarder* lf =
WebWidget()->GetLayerManager(shadowManager, textureFactoryIdentifier.mParentBackend)->AsShadowForwarder();

NS_ABORT_IF_FALSE(lf && lf->HasShadowManager(),
NS_ASSERTION(lf && lf->HasShadowManager(),
"PuppetWidget should have shadow manager");
lf->IdentifyTextureHost(textureFactoryIdentifier);
ImageBridgeChild::IdentifyCompositorTextureHost(textureFactoryIdentifier);
Expand Down
12 changes: 5 additions & 7 deletions embedding/embedlite/embedshared/EmbedLitePuppetWidget.cpp
Expand Up @@ -119,14 +119,13 @@ NS_IMETHODIMP
EmbedLitePuppetWidget::Create(nsIWidget* aParent,
nsNativeWidget aNativeParent,
const nsIntRect& aRect,
nsDeviceContext* aContext,
nsWidgetInitData* aInitData)
{
LOGT();
NS_ABORT_IF_FALSE(!aNativeParent, "got a non-Puppet native parent");
NS_ASSERTION(!aNativeParent, "got a non-Puppet native parent");

mParent = aParent;
BaseCreate(aParent, aRect, aContext, aInitData);
BaseCreate(aParent, aRect, aInitData);

mBounds = aRect;
mEnabled = true;
Expand All @@ -149,7 +148,6 @@ EmbedLitePuppetWidget::Create(nsIWidget* aParent,

already_AddRefed<nsIWidget>
EmbedLitePuppetWidget::CreateChild(const nsIntRect& aRect,
nsDeviceContext* aContext,
nsWidgetInitData* aInitData,
bool aForceUseIWidgetParent)
{
Expand All @@ -158,7 +156,7 @@ EmbedLitePuppetWidget::CreateChild(const nsIntRect& aRect,
nsCOMPtr<nsIWidget> widget = new EmbedLitePuppetWidget(mEmbed, mId);
return ((widget &&
NS_SUCCEEDED(widget->Create(isPopup ? nullptr: this, nullptr, aRect,
aContext, aInitData))) ?
aInitData))) ?
widget.forget() : nullptr);
}

Expand Down Expand Up @@ -284,15 +282,15 @@ EmbedLitePuppetWidget::GetNativeData(uint32_t aDataType)
NS_IMETHODIMP
EmbedLitePuppetWidget::DispatchEvent(WidgetGUIEvent* event, nsEventStatus& aStatus)
{
NS_ABORT_IF_FALSE(!mChild || mChild->mWindowType == eWindowType_popup,
NS_ASSERTION(!mChild || mChild->mWindowType == eWindowType_popup,
"Unexpected event dispatch!");

aStatus = nsEventStatus_eIgnore;

nsIWidgetListener* listener =
mAttachedWidgetListener ? mAttachedWidgetListener : mWidgetListener;

NS_ABORT_IF_FALSE(listener, "No listener!");
NS_ASSERTION(listener, "No listener!");

if (event->mClass == eKeyboardEventClass) {
RemoveIMEComposition();
Expand Down
9 changes: 3 additions & 6 deletions embedding/embedlite/embedshared/EmbedLitePuppetWidget.h
Expand Up @@ -26,8 +26,7 @@
namespace mozilla {
namespace embedlite {

class EmbedLitePuppetWidget : public nsBaseWidget,
public nsSupportsWeakReference
class EmbedLitePuppetWidget : public nsBaseWidget
{
typedef nsBaseWidget Base;

Expand All @@ -42,12 +41,10 @@ class EmbedLitePuppetWidget : public nsBaseWidget,
NS_IMETHOD Create(nsIWidget* aParent,
nsNativeWidget aNativeParent,
const nsIntRect& aRect,
nsDeviceContext* aContext,
nsWidgetInitData* aInitData = nullptr);

virtual already_AddRefed<nsIWidget>
CreateChild(const nsIntRect& aRect,
nsDeviceContext* aContext,
nsWidgetInitData* aInitData = nullptr,
bool aForceUseIWidgetParent = false);

Expand Down Expand Up @@ -110,9 +107,9 @@ class EmbedLitePuppetWidget : public nsBaseWidget,
return NS_ERROR_UNEXPECTED;
}
// PuppetWidgets are always at <0, 0>.
virtual nsIntPoint WidgetToScreenOffset() {
virtual mozilla::LayoutDeviceIntPoint WidgetToScreenOffset() {
LOGF();
return nsIntPoint(0, 0);
return LayoutDeviceIntPoint(0, 0);
}
NS_IMETHOD DispatchEvent(WidgetGUIEvent* event, nsEventStatus& aStatus);
NS_IMETHOD CaptureRollupEvents(nsIRollupListener* aListener,
Expand Down
17 changes: 8 additions & 9 deletions embedding/embedlite/embedshared/EmbedLiteViewBaseChild.cpp
Expand Up @@ -163,8 +163,7 @@ EmbedLiteViewBaseChild::InitGeckoWindow(const uint32_t& parentId, const bool& is
mWidget->Create(
nullptr, 0, // no parents
nsIntRect(nsIntPoint(0, 0), nsIntSize(mGLViewSize.width, mGLViewSize.height)),
nullptr, // HandleWidgetEvent
&widgetInit // nsDeviceContext
&widgetInit // HandleWidgetEvent
);

if (!mWidget) {
Expand Down Expand Up @@ -552,7 +551,7 @@ bool
EmbedLiteViewBaseChild::RecvLoadFrameScript(const nsString& uri)
{
if (mHelper) {
return mHelper->DoLoadFrameScript(uri, true);
return mHelper->DoLoadMessageManagerScript(uri, true);
}
return false;
}
Expand Down Expand Up @@ -762,7 +761,7 @@ EmbedLiteViewBaseChild::RecvHandleSingleTap(const nsIntPoint& aPoint)
nsCOMPtr<nsIWidget> widget = mHelper->GetWidget(&offset);
WidgetCompositionEvent event(true, NS_COMPOSITION_END, widget);
InitEvent(event, nullptr);
mHelper->DispatchWidgetEvent(event);
APZCCallbackHelper::DispatchWidgetEvent(event);
mIMEComposing = false;
}

Expand Down Expand Up @@ -838,7 +837,7 @@ EmbedLiteViewBaseChild::RecvHandleTextEvent(const nsString& commit, const nsStri
if (StartComposite) {
WidgetCompositionEvent event(true, NS_COMPOSITION_START, widget);
InitEvent(event, nullptr);
mHelper->DispatchWidgetEvent(event);
APZCCallbackHelper::DispatchWidgetEvent(event);
}

if (StartComposite || ChangeComposite || EndComposite) {
Expand All @@ -858,7 +857,7 @@ EmbedLiteViewBaseChild::RecvHandleTextEvent(const nsString& commit, const nsStri
event.mRanges = new TextRangeArray();
event.mRanges->AppendElement(range);
}
mHelper->DispatchWidgetEvent(event);
APZCCallbackHelper::DispatchWidgetEvent(event);
}

nsCOMPtr<nsIPresShell> ps = mHelper->GetPresContext()->GetPresShell();
Expand All @@ -878,7 +877,7 @@ EmbedLiteViewBaseChild::RecvHandleTextEvent(const nsString& commit, const nsStri
if (EndComposite) {
WidgetCompositionEvent event(true, NS_COMPOSITION_END, widget);
InitEvent(event, nullptr);
mHelper->DispatchWidgetEvent(event);
APZCCallbackHelper::DispatchWidgetEvent(event);
}

return true;
Expand Down Expand Up @@ -957,7 +956,7 @@ EmbedLiteViewBaseChild::RecvInputDataTouchEvent(const ScrollableLayerGuid& aGuid
WidgetTouchEvent localEvent;
if (mHelper->ConvertMutiTouchInputToEvent(aData, localEvent)) {
nsEventStatus status =
mHelper->DispatchWidgetEvent(localEvent);
APZCCallbackHelper::DispatchWidgetEvent(localEvent);
nsCOMPtr<nsPIDOMWindow> outerWindow = do_GetInterface(mWebNavigation);
nsCOMPtr<nsPIDOMWindow> innerWindow = outerWindow->GetCurrentInnerWindow();
if (innerWindow && innerWindow->HasTouchEventListeners()) {
Expand All @@ -973,7 +972,7 @@ EmbedLiteViewBaseChild::RecvInputDataTouchEvent(const ScrollableLayerGuid& aGuid
}
if (status != nsEventStatus_eConsumeNoDefault && mDispatchSynthMouseEvents && sDispatchMouseEvents) {
// Touch event not handled
status = mHelper->DispatchSynthesizedMouseEvent(localEvent.message, localEvent.time, localEvent.refPoint, localEvent.widget);
status = APZCCallbackHelper::DispatchSynthesizedMouseEvent(localEvent.message, localEvent.time, localEvent.refPoint, localEvent.widget);
if (status != nsEventStatus_eConsumeNoDefault && status != nsEventStatus_eConsumeDoDefault) {
mDispatchSynthMouseEvents = false;
}
Expand Down
2 changes: 1 addition & 1 deletion embedding/embedlite/modules/EmbedLiteJSON.cpp
Expand Up @@ -211,7 +211,7 @@ NS_IMETHODIMP
EmbedLiteJSON::CreateJSON(nsIPropertyBag* aRoot, nsAString& outJson)
{
AutoSafeJSContext cx;
JS::Rooted<JSObject*> obj(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr()));
JS::Rooted<JSObject*> obj(cx, JS_NewObject(cx, nullptr));
if (!obj) {
return NS_ERROR_FAILURE;
}
Expand Down
8 changes: 8 additions & 0 deletions embedding/embedlite/utils/EmbedLiteXulAppInfo.cpp
Expand Up @@ -218,3 +218,11 @@ EmbedLiteXulAppInfo::GetAccessibilityEnabled(bool* aResult)
#endif
return NS_OK;
}

NS_IMETHODIMP
EmbedLiteXulAppInfo::GetAccessibilityIsUIA(bool* aResult)
{
*aResult = false;

return NS_OK;
}
4 changes: 2 additions & 2 deletions embedding/embedlite/utils/TabChildHelper.cpp
Expand Up @@ -187,7 +187,7 @@ TabChildHelper::InitTabChildGlobal()
nsISupports* scopeSupports = NS_ISUPPORTS_CAST(nsIDOMEventTarget*, scope);

// Not sure if
NS_ENSURE_TRUE(InitTabChildGlobalInternal(scopeSupports, nsCString("intProcessEmbedChildGlobal")), false);
NS_ENSURE_TRUE(InitChildGlobalInternal(scopeSupports, nsCString("intProcessEmbedChildGlobal")), false);

scope->Init();

Expand Down Expand Up @@ -313,7 +313,7 @@ TabChildHelper::DoLoadMessageManagerScript(const nsAString& aURL, bool aRunInGlo
return false;
}

LoadFrameScriptInternal(aURL, aRunInGlobalScope);
LoadScriptInternal(aURL, aRunInGlobalScope);
return true;
}

Expand Down

0 comments on commit e4db14a

Please sign in to comment.