Bug 1174461 - [e10s] Return a cached result from SendGetNativePluginPort (r=jimm) a=kwierso
MozReview-Commit-ID: FyeWtg0Py5p
This commit is contained in:
@@ -35,7 +35,8 @@ NS_IMPL_ISUPPORTS_INHERITED(PluginWidgetProxy, PuppetWidget, nsIWidget)
|
||||
PluginWidgetProxy::PluginWidgetProxy(dom::TabChild* aTabChild,
|
||||
mozilla::plugins::PluginWidgetChild* aActor) :
|
||||
PuppetWidget(aTabChild),
|
||||
mActor(aActor)
|
||||
mActor(aActor),
|
||||
mCachedPluginPort(0)
|
||||
{
|
||||
// See ChannelDestroyed() in the header
|
||||
mActor->SetWidget(this);
|
||||
@@ -63,6 +64,7 @@ PluginWidgetProxy::Create(nsIWidget* aParent,
|
||||
}
|
||||
|
||||
BaseCreate(aParent, aInitData);
|
||||
mParent = aParent;
|
||||
|
||||
mBounds = aRect;
|
||||
mEnabled = true;
|
||||
@@ -74,8 +76,6 @@ PluginWidgetProxy::Create(nsIWidget* aParent,
|
||||
NS_IMETHODIMP
|
||||
PluginWidgetProxy::SetParent(nsIWidget* aNewParent)
|
||||
{
|
||||
mParent = aNewParent;
|
||||
|
||||
nsCOMPtr<nsIWidget> kungFuDeathGrip(this);
|
||||
nsIWidget* parent = GetParent();
|
||||
if (parent) {
|
||||
@@ -84,6 +84,7 @@ PluginWidgetProxy::SetParent(nsIWidget* aNewParent)
|
||||
if (aNewParent) {
|
||||
aNewParent->AddChild(this);
|
||||
}
|
||||
mParent = aNewParent;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -135,10 +136,14 @@ PluginWidgetProxy::GetNativeData(uint32_t aDataType)
|
||||
NS_WARNING("PluginWidgetProxy::GetNativeData received request for unsupported data type.");
|
||||
return nullptr;
|
||||
}
|
||||
uintptr_t value = 0;
|
||||
mActor->SendGetNativePluginPort(&value);
|
||||
PWLOG("PluginWidgetProxy::GetNativeData %p\n", (void*)value);
|
||||
return (void*)value;
|
||||
// The parent side window handle or xid never changes so we can
|
||||
// cache this for our lifetime.
|
||||
if (mCachedPluginPort) {
|
||||
return (void*)mCachedPluginPort;
|
||||
}
|
||||
mActor->SendGetNativePluginPort(&mCachedPluginPort);
|
||||
PWLOG("PluginWidgetProxy::GetNativeData %p\n", (void*)mCachedPluginPort);
|
||||
return (void*)mCachedPluginPort;
|
||||
}
|
||||
|
||||
#if defined(XP_WIN)
|
||||
|
||||
Reference in New Issue
Block a user