Backed out changeset f612649fdbaf (bug 1174461) for causing bug bug 1182919. a=topcrash
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 15 Jul 2015 12:44:01 -0400
changeset 252911 a905dc2ebe69b473c2a87cac1eb4d9131aa43242
parent 252910 23157b4b389ee1d1bfb6af589716326e173968f6
child 252912 16e30af059b7184dbc1cecdae5219449bae2f1aa
push id29051
push userryanvm@gmail.com
push dateWed, 15 Jul 2015 16:53:47 +0000
treeherdermozilla-central@16e30af059b7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstopcrash
bugs1174461, 1182919
milestone42.0a1
backs outf612649fdbafd9634f6bd03d8a5a0c360575418a
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset f612649fdbaf (bug 1174461) for causing bug bug 1182919. a=topcrash
widget/PluginWidgetProxy.cpp
widget/PluginWidgetProxy.h
--- a/widget/PluginWidgetProxy.cpp
+++ b/widget/PluginWidgetProxy.cpp
@@ -30,18 +30,17 @@ NS_IMPL_ISUPPORTS_INHERITED(PluginWidget
     NS_WARNING("called on an invalid channel.");              \
     return NS_ERROR_FAILURE;                                  \
   }                                                           \
 } while (0)
 
 PluginWidgetProxy::PluginWidgetProxy(dom::TabChild* aTabChild,
                                      mozilla::plugins::PluginWidgetChild* aActor) :
   PuppetWidget(aTabChild),
-  mActor(aActor),
-  mCachedPluginPort(0)
+  mActor(aActor)
 {
   // See ChannelDestroyed() in the header
   mActor->SetWidget(this);
 }
 
 PluginWidgetProxy::~PluginWidgetProxy()
 {
   PWLOG("PluginWidgetProxy::~PluginWidgetProxy()\n");
@@ -70,25 +69,26 @@ PluginWidgetProxy::Create(nsIWidget*    
   mVisible = true;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 PluginWidgetProxy::SetParent(nsIWidget* aNewParent)
 {
+  mParent = aNewParent;
+
   nsCOMPtr<nsIWidget> kungFuDeathGrip(this);
   nsIWidget* parent = GetParent();
   if (parent) {
     parent->RemoveChild(this);
   }
   if (aNewParent) {
     aNewParent->AddChild(this);
   }
-  mParent = aNewParent;
   return NS_OK;
 }
 
 nsIWidget*
 PluginWidgetProxy::GetParent(void)
 {
   return mParent.get();
 }
@@ -130,24 +130,20 @@ PluginWidgetProxy::GetNativeData(uint32_
     case NS_NATIVE_PLUGIN_PORT:
     case NS_NATIVE_WINDOW:
     case NS_NATIVE_SHAREABLE_WINDOW:
       break;
     default:
       NS_WARNING("PluginWidgetProxy::GetNativeData received request for unsupported data type.");
       return nullptr;
   }
-  // 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;
+  uintptr_t value = 0;
+  mActor->SendGetNativePluginPort(&value);
+  PWLOG("PluginWidgetProxy::GetNativeData %p\n", (void*)value);
+  return (void*)value;
 }
 
 #if defined(XP_WIN)
 void
 PluginWidgetProxy::SetNativeData(uint32_t aDataType, uintptr_t aVal)
 {
   if (!mActor) {
     return;
--- a/widget/PluginWidgetProxy.h
+++ b/widget/PluginWidgetProxy.h
@@ -61,15 +61,14 @@ public:
   void ChannelDestroyed() { mActor = nullptr; }
 
 private:
   // Our connection with the chrome widget, created on PBrowser.
   mozilla::plugins::PluginWidgetChild* mActor;
   // PuppetWidget does not implement parent apis, but we need
   // them for plugin widgets.
   nsCOMPtr<nsIWidget> mParent;
-  uintptr_t mCachedPluginPort;
 };
 
 } // namespace widget
 } // namespace mozilla
 
 #endif