void
PluginScriptableObjectParent::DropNPObject()
{
  NS_ASSERTION(mObject, "Invalidated object!");
  NS_ASSERTION(mObject->_class == GetClass(), "Wrong type of object!");
  NS_ASSERTION(mType == Proxy, "Shouldn't call this for non-proxy object!");

  // We think we're about to be deleted, but we could be racing with the other
  // process.
  PluginInstanceParent* instance = GetInstance();
  NS_ASSERTION(instance, "Must have an instance!");

  instance->UnregisterNPObject(mObject);
  mObject = nullptr;

  unused << SendUnprotect();
}