Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Backed out changeset a1e773337202 (bug 1350633)
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Jun 28, 2017
1 parent b93d8d2 commit f0eebc3
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 41 deletions.
11 changes: 5 additions & 6 deletions dom/ipc/PBrowser.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ parent:

async PPaymentRequest();

/**
* Return native data of root widget
*/
nested(inside_cpow) sync GetWidgetNativeData() returns (WindowsHandle value);

/**
* Sends an NS_NATIVE_CHILD_OF_SHAREABLE_WINDOW to be adopted by the
* widget's shareable window on the chrome side. Only used on Windows.
Expand Down Expand Up @@ -889,12 +894,6 @@ child:
*/
async SetOriginAttributes(OriginAttributes aOriginAttributes);

/**
* Pass the current handle for the current native widget to the content
* process, so it can be used by PuppetWidget.
*/
async SetWidgetNativeData(WindowsHandle aHandle);

/*
* FIXME: write protocol!
Expand Down
8 changes: 0 additions & 8 deletions dom/ipc/TabChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ TabChild::TabChild(nsIContentChild* aManager,
, mPendingDocShellPreserveLayers(false)
, mPendingDocShellReceivedMessage(false)
, mPendingDocShellBlockers(0)
, mWidgetNativeData(0)
{
nsWeakPtr weakPtrThis(do_GetWeakReference(static_cast<nsITabChild*>(this))); // for capture by the lambda
mSetAllowedTouchBehaviorCallback = [weakPtrThis](uint64_t aInputBlockId,
Expand Down Expand Up @@ -3212,13 +3211,6 @@ TabChild::RecvSetOriginAttributes(const OriginAttributes& aOriginAttributes)
return IPC_OK();
}

mozilla::ipc::IPCResult
TabChild::RecvSetWidgetNativeData(const WindowsHandle& aWidgetNativeData)
{
mWidgetNativeData = aWidgetNativeData;
return IPC_OK();
}

mozilla::plugins::PPluginWidgetChild*
TabChild::AllocPPluginWidgetChild()
{
Expand Down
10 changes: 0 additions & 10 deletions dom/ipc/TabChild.h
Original file line number Diff line number Diff line change
Expand Up @@ -697,12 +697,6 @@ class TabChild final : public TabChildBase,
void AddPendingDocShellBlocker();
void RemovePendingDocShellBlocker();

// The HANDLE object for the widget this TabChild in.
WindowsHandle WidgetNativeData()
{
return mWidgetNativeData;
}

protected:
virtual ~TabChild();

Expand Down Expand Up @@ -744,8 +738,6 @@ class TabChild final : public TabChildBase,

virtual mozilla::ipc::IPCResult RecvSetOriginAttributes(const OriginAttributes& aOriginAttributes) override;

virtual mozilla::ipc::IPCResult RecvSetWidgetNativeData(const WindowsHandle& aWidgetNativeData) override;

private:
void HandleDoubleTap(const CSSPoint& aPoint, const Modifiers& aModifiers,
const ScrollableLayerGuid& aGuid);
Expand Down Expand Up @@ -889,8 +881,6 @@ class TabChild final : public TabChildBase,
bool mPendingDocShellReceivedMessage;
uint32_t mPendingDocShellBlockers;

WindowsHandle mWidgetNativeData;

DISALLOW_EVIL_CONSTRUCTORS(TabChild);
};

Expand Down
23 changes: 12 additions & 11 deletions dom/ipc/TabParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,17 +292,6 @@ TabParent::SetOwnerElement(Element* aElement)

AddWindowListeners();
TryCacheDPIAndScale();

// Try to send down WidgetNativeData, now that this TabParent is associated
// with a widget.
nsCOMPtr<nsIWidget> widget = GetTopLevelWidget();
if (widget) {
WindowsHandle widgetNativeData = reinterpret_cast<WindowsHandle>(
widget->GetNativeData(NS_NATIVE_SHAREABLE_WINDOW));
if (widgetNativeData) {
Unused << SendSetWidgetNativeData(widgetNativeData);
}
}
}

void
Expand Down Expand Up @@ -2326,6 +2315,18 @@ TabParent::GetTopLevelWidget()
return nullptr;
}

mozilla::ipc::IPCResult
TabParent::RecvGetWidgetNativeData(WindowsHandle* aValue)
{
*aValue = 0;
nsCOMPtr<nsIWidget> widget = GetTopLevelWidget();
if (widget) {
*aValue = reinterpret_cast<WindowsHandle>(
widget->GetNativeData(NS_NATIVE_SHAREABLE_WINDOW));
}
return IPC_OK();
}

mozilla::ipc::IPCResult
TabParent::RecvSetNativeChildOfShareableWindow(const uintptr_t& aChildWindow)
{
Expand Down
2 changes: 2 additions & 0 deletions dom/ipc/TabParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ class TabParent final : public PBrowserParent

virtual mozilla::ipc::IPCResult RecvGetWidgetRounding(int32_t* aValue) override;

virtual mozilla::ipc::IPCResult RecvGetWidgetNativeData(WindowsHandle* aValue) override;

virtual mozilla::ipc::IPCResult RecvSetNativeChildOfShareableWindow(const uintptr_t& childWindow) override;

virtual mozilla::ipc::IPCResult RecvDispatchFocusToTopLevelWindow() override;
Expand Down
2 changes: 2 additions & 0 deletions ipc/ipdl/sync-messages.ini
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,8 @@ description =
description =
[PBrowser::PPluginWidget]
description =
[PBrowser::GetWidgetNativeData]
description =
[PBrowser::DispatchFocusToTopLevelWindow]
description =
[PBrowser::NotifyIMEFocus]
Expand Down
8 changes: 2 additions & 6 deletions widget/PuppetWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1189,14 +1189,10 @@ PuppetWidget::GetNativeData(uint32_t aDataType)
{
switch (aDataType) {
case NS_NATIVE_SHAREABLE_WINDOW: {
// NOTE: We can not have a tab child in some situations, such as when we're
// rendering to a fake widget for thumbnails.
if (!mTabChild) {
NS_WARNING("Need TabChild to get the nativeWindow from!");
}
MOZ_ASSERT(mTabChild, "Need TabChild to get the nativeWindow from!");
mozilla::WindowsHandle nativeData = 0;
if (mTabChild) {
nativeData = mTabChild->WidgetNativeData();
mTabChild->SendGetWidgetNativeData(&nativeData);
}
return (void*)nativeData;
}
Expand Down

0 comments on commit f0eebc3

Please sign in to comment.