Backed out changeset 0f2e90feea3b (bug 1174461) for build bustage CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Wed, 30 Mar 2016 10:20:45 -0700
changeset 291094 39e3c3e2970e8a3f59d99349f54d81493d50b1f8
parent 291093 444648c7d761f14aa5176fe9bc044f8f39f3d7ca
child 291095 3b74da083e58b7464159789e20431979713842bd
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1174461
milestone48.0a1
backs out0f2e90feea3b779e6b8cc8ca572c6313e1d0995e
Backed out changeset 0f2e90feea3b (bug 1174461) for build bustage CLOSED TREE MozReview-Commit-ID: IJcI44KBoTm
widget/PluginWidgetProxy.cpp
widget/PluginWidgetProxy.h
widget/nsBaseWidget.cpp
--- 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");
@@ -59,37 +58,37 @@ PluginWidgetProxy::Create(nsIWidget* aPa
   nsresult rv = NS_ERROR_UNEXPECTED;
   mActor->SendCreate(&rv);
   if (NS_FAILED(rv)) {
     NS_WARNING("failed to create chrome widget, plugins won't paint.");
     return rv;
   }
 
   BaseCreate(aParent, aInitData);
-  mParent = aParent;
 
   mBounds = aRect;
   mEnabled = true;
   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();
 }
@@ -131,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
@@ -62,15 +62,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
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -587,25 +587,25 @@ double nsIWidget::DefaultScaleOverride()
 
 //-------------------------------------------------------------------------
 //
 // Add a child to the list of children
 //
 //-------------------------------------------------------------------------
 void nsBaseWidget::AddChild(nsIWidget* aChild)
 {
-  MOZ_RELEASE_ASSERT(!aChild->GetNextSibling() && !aChild->GetPrevSibling(),
-                     "aChild not properly removed from its old child list");
+  NS_PRECONDITION(!aChild->GetNextSibling() && !aChild->GetPrevSibling(),
+                  "aChild not properly removed from its old child list");
 
   if (!mFirstChild) {
     mFirstChild = mLastChild = aChild;
   } else {
     // append to the list
-    MOZ_RELEASE_ASSERT(mLastChild);
-    MOZ_RELEASE_ASSERT(!mLastChild->GetNextSibling());
+    NS_ASSERTION(mLastChild, "Bogus state");
+    NS_ASSERTION(!mLastChild->GetNextSibling(), "Bogus state");
     mLastChild->SetNextSibling(aChild);
     aChild->SetPrevSibling(mLastChild);
     mLastChild = aChild;
   }
 }
 
 
 //-------------------------------------------------------------------------
@@ -617,17 +617,17 @@ void nsBaseWidget::RemoveChild(nsIWidget
 {
 #ifdef DEBUG
 #ifdef XP_MACOSX
   // nsCocoaWindow doesn't implement GetParent, so in that case parent will be
   // null and we'll just have to do without this assertion.
   nsIWidget* parent = aChild->GetParent();
   NS_ASSERTION(!parent || parent == this, "Not one of our kids!");
 #else
-  MOZ_RELEASE_ASSERT(aChild->GetParent() == this, "Not one of our kids!");
+  NS_ASSERTION(aChild->GetParent() == this, "Not one of our kids!");
 #endif
 #endif
 
   if (mLastChild == aChild) {
     mLastChild = mLastChild->GetPrevSibling();
   }
   if (mFirstChild == aChild) {
     mFirstChild = mFirstChild->GetNextSibling();